From 3733d85fa1f187566f4f0cef4bd5b3d8f462e78b Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 12 Jul 2023 19:40:11 +0000 Subject: [PATCH 1/4] feat: add advanced_datapath_observability_config to monitoring_config PiperOrigin-RevId: 547520012 Source-Link: https://github.com/googleapis/googleapis/commit/8464e52fb2c09ae308acb6b3e969cb8adf4e984e Source-Link: https://github.com/googleapis/googleapis-gen/commit/ddd3271491355595166c2d185bc24bc0b4aae41f Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNvbnRhaW5lci8uT3dsQm90LnlhbWwiLCJoIjoiZGRkMzI3MTQ5MTM1NTU5NTE2NmMyZDE4NWJjMjRiYzBiNGFhZTQxZiJ9 --- .../google-container/v1/.eslintignore | 7 + .../google-container/v1/.eslintrc.json | 3 + .../google-container/v1/.gitignore | 14 + owl-bot-staging/google-container/v1/.jsdoc.js | 55 + .../google-container/v1/.mocharc.js | 33 + .../google-container/v1/.prettierrc.js | 22 + owl-bot-staging/google-container/v1/README.md | 1 + .../v1/linkinator.config.json | 16 + .../google-container/v1/package.json | 64 + .../google/container/v1/cluster_service.proto | 5087 +++++++++++++++ .../v1/cluster_manager.cancel_operation.js | 61 + ...r_manager.check_autopilot_compatibility.js | 61 + .../cluster_manager.complete_i_p_rotation.js | 61 + ...ster_manager.complete_node_pool_upgrade.js | 62 + .../v1/cluster_manager.create_cluster.js | 67 + .../v1/cluster_manager.create_node_pool.js | 67 + .../v1/cluster_manager.delete_cluster.js | 61 + .../v1/cluster_manager.delete_node_pool.js | 62 + .../v1/cluster_manager.get_cluster.js | 61 + .../cluster_manager.get_j_s_o_n_web_keys.js | 61 + .../v1/cluster_manager.get_node_pool.js | 62 + .../v1/cluster_manager.get_operation.js | 61 + .../v1/cluster_manager.get_server_config.js | 61 + .../v1/cluster_manager.list_clusters.js | 62 + .../v1/cluster_manager.list_node_pools.js | 61 + .../v1/cluster_manager.list_operations.js | 62 + ...cluster_manager.list_usable_subnetworks.js | 82 + ...ster_manager.rollback_node_pool_upgrade.js | 67 + .../v1/cluster_manager.set_addons_config.js | 67 + .../v1/cluster_manager.set_labels.js | 76 + .../v1/cluster_manager.set_legacy_abac.js | 66 + .../v1/cluster_manager.set_locations.js | 71 + .../v1/cluster_manager.set_logging_service.js | 74 + .../cluster_manager.set_maintenance_policy.js | 86 + .../v1/cluster_manager.set_master_auth.js | 71 + .../cluster_manager.set_monitoring_service.js | 74 + .../v1/cluster_manager.set_network_policy.js | 66 + ...uster_manager.set_node_pool_autoscaling.js | 67 + ...luster_manager.set_node_pool_management.js | 67 + .../v1/cluster_manager.set_node_pool_size.js | 67 + .../v1/cluster_manager.start_i_p_rotation.js | 65 + .../v1/cluster_manager.update_cluster.js | 66 + .../v1/cluster_manager.update_master.js | 73 + .../v1/cluster_manager.update_node_pool.js | 164 + .../snippet_metadata.google.container.v1.json | 1915 ++++++ .../google-container/v1/src/index.ts | 25 + .../v1/src/v1/cluster_manager_client.ts | 3551 +++++++++++ .../src/v1/cluster_manager_client_config.json | 192 + .../v1/src/v1/cluster_manager_proto_list.json | 3 + .../v1/src/v1/gapic_metadata.json | 367 ++ .../google-container/v1/src/v1/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../v1/system-test/install.ts | 49 + .../v1/test/gapic_cluster_manager_v1.ts | 5130 +++++++++++++++ .../google-container/v1/tsconfig.json | 19 + .../google-container/v1/webpack.config.js | 64 + .../google-container/v1beta1/.eslintignore | 7 + .../google-container/v1beta1/.eslintrc.json | 3 + .../google-container/v1beta1/.gitignore | 14 + .../google-container/v1beta1/.jsdoc.js | 55 + .../google-container/v1beta1/.mocharc.js | 33 + .../google-container/v1beta1/.prettierrc.js | 22 + .../google-container/v1beta1/README.md | 1 + .../v1beta1/linkinator.config.json | 16 + .../google-container/v1beta1/package.json | 64 + .../container/v1beta1/cluster_service.proto | 5617 +++++++++++++++++ .../cluster_manager.cancel_operation.js | 64 + ...r_manager.check_autopilot_compatibility.js | 61 + .../cluster_manager.complete_i_p_rotation.js | 64 + ...ster_manager.complete_node_pool_upgrade.js | 62 + .../v1beta1/cluster_manager.create_cluster.js | 69 + .../cluster_manager.create_node_pool.js | 70 + .../v1beta1/cluster_manager.delete_cluster.js | 64 + .../cluster_manager.delete_node_pool.js | 66 + .../v1beta1/cluster_manager.get_cluster.js | 64 + .../cluster_manager.get_j_s_o_n_web_keys.js | 61 + .../v1beta1/cluster_manager.get_node_pool.js | 66 + .../v1beta1/cluster_manager.get_operation.js | 64 + .../cluster_manager.get_server_config.js | 63 + .../v1beta1/cluster_manager.list_clusters.js | 64 + .../v1beta1/cluster_manager.list_locations.js | 62 + .../cluster_manager.list_node_pools.js | 64 + .../cluster_manager.list_operations.js | 64 + ...cluster_manager.list_usable_subnetworks.js | 83 + ...ster_manager.rollback_node_pool_upgrade.js | 71 + .../cluster_manager.set_addons_config.js | 70 + .../v1beta1/cluster_manager.set_labels.js | 79 + .../cluster_manager.set_legacy_abac.js | 69 + .../v1beta1/cluster_manager.set_locations.js | 74 + .../cluster_manager.set_logging_service.js | 77 + .../cluster_manager.set_maintenance_policy.js | 86 + .../cluster_manager.set_master_auth.js | 74 + .../cluster_manager.set_monitoring_service.js | 77 + .../cluster_manager.set_network_policy.js | 69 + ...uster_manager.set_node_pool_autoscaling.js | 71 + ...luster_manager.set_node_pool_management.js | 71 + .../cluster_manager.set_node_pool_size.js | 71 + .../cluster_manager.start_i_p_rotation.js | 68 + .../v1beta1/cluster_manager.update_cluster.js | 69 + .../v1beta1/cluster_manager.update_master.js | 76 + .../cluster_manager.update_node_pool.js | 168 + ...pet_metadata.google.container.v1beta1.json | 1955 ++++++ .../google-container/v1beta1/src/index.ts | 25 + .../src/v1beta1/cluster_manager_client.ts | 3623 +++++++++++ .../cluster_manager_client_config.json | 198 + .../v1beta1/cluster_manager_proto_list.json | 3 + .../v1beta1/src/v1beta1/gapic_metadata.json | 377 ++ .../v1beta1/src/v1beta1/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../v1beta1/system-test/install.ts | 49 + .../test/gapic_cluster_manager_v1beta1.ts | 5238 +++++++++++++++ .../google-container/v1beta1/tsconfig.json | 19 + .../v1beta1/webpack.config.js | 64 + 115 files changed, 39033 insertions(+) create mode 100644 owl-bot-staging/google-container/v1/.eslintignore create mode 100644 owl-bot-staging/google-container/v1/.eslintrc.json create mode 100644 owl-bot-staging/google-container/v1/.gitignore create mode 100644 owl-bot-staging/google-container/v1/.jsdoc.js create mode 100644 owl-bot-staging/google-container/v1/.mocharc.js create mode 100644 owl-bot-staging/google-container/v1/.prettierrc.js create mode 100644 owl-bot-staging/google-container/v1/README.md create mode 100644 owl-bot-staging/google-container/v1/linkinator.config.json create mode 100644 owl-bot-staging/google-container/v1/package.json create mode 100644 owl-bot-staging/google-container/v1/protos/google/container/v1/cluster_service.proto create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.cancel_operation.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_i_p_rotation.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_cluster.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_node_pool.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_cluster.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_node_pool.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_cluster.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_j_s_o_n_web_keys.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_node_pool.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_operation.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_server_config.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_clusters.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_node_pools.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_operations.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_usable_subnetworks.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.rollback_node_pool_upgrade.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_addons_config.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_labels.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_legacy_abac.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_locations.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_logging_service.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_maintenance_policy.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_master_auth.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_monitoring_service.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_network_policy.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_autoscaling.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_management.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_size.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.start_i_p_rotation.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_cluster.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_master.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_node_pool.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/snippet_metadata.google.container.v1.json create mode 100644 owl-bot-staging/google-container/v1/src/index.ts create mode 100644 owl-bot-staging/google-container/v1/src/v1/cluster_manager_client.ts create mode 100644 owl-bot-staging/google-container/v1/src/v1/cluster_manager_client_config.json create mode 100644 owl-bot-staging/google-container/v1/src/v1/cluster_manager_proto_list.json create mode 100644 owl-bot-staging/google-container/v1/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-container/v1/src/v1/index.ts create mode 100644 owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-container/v1/system-test/install.ts create mode 100644 owl-bot-staging/google-container/v1/test/gapic_cluster_manager_v1.ts create mode 100644 owl-bot-staging/google-container/v1/tsconfig.json create mode 100644 owl-bot-staging/google-container/v1/webpack.config.js create mode 100644 owl-bot-staging/google-container/v1beta1/.eslintignore create mode 100644 owl-bot-staging/google-container/v1beta1/.eslintrc.json create mode 100644 owl-bot-staging/google-container/v1beta1/.gitignore create mode 100644 owl-bot-staging/google-container/v1beta1/.jsdoc.js create mode 100644 owl-bot-staging/google-container/v1beta1/.mocharc.js create mode 100644 owl-bot-staging/google-container/v1beta1/.prettierrc.js create mode 100644 owl-bot-staging/google-container/v1beta1/README.md create mode 100644 owl-bot-staging/google-container/v1beta1/linkinator.config.json create mode 100644 owl-bot-staging/google-container/v1beta1/package.json create mode 100644 owl-bot-staging/google-container/v1beta1/protos/google/container/v1beta1/cluster_service.proto create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.cancel_operation.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_i_p_rotation.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_node_pool_upgrade.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_cluster.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_node_pool.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_cluster.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_node_pool.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_cluster.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_j_s_o_n_web_keys.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_node_pool.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_operation.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_server_config.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_clusters.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_locations.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_node_pools.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_operations.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_usable_subnetworks.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.rollback_node_pool_upgrade.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_addons_config.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_labels.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_legacy_abac.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_locations.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_logging_service.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_maintenance_policy.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_master_auth.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_monitoring_service.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_network_policy.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_autoscaling.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_management.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_size.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.start_i_p_rotation.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_cluster.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_master.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_node_pool.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json create mode 100644 owl-bot-staging/google-container/v1beta1/src/index.ts create mode 100644 owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client.ts create mode 100644 owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client_config.json create mode 100644 owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_proto_list.json create mode 100644 owl-bot-staging/google-container/v1beta1/src/v1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-container/v1beta1/src/v1beta1/index.ts create mode 100644 owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-container/v1beta1/system-test/install.ts create mode 100644 owl-bot-staging/google-container/v1beta1/test/gapic_cluster_manager_v1beta1.ts create mode 100644 owl-bot-staging/google-container/v1beta1/tsconfig.json create mode 100644 owl-bot-staging/google-container/v1beta1/webpack.config.js diff --git a/owl-bot-staging/google-container/v1/.eslintignore b/owl-bot-staging/google-container/v1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-container/v1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-container/v1/.eslintrc.json b/owl-bot-staging/google-container/v1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-container/v1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-container/v1/.gitignore b/owl-bot-staging/google-container/v1/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-container/v1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-container/v1/.jsdoc.js b/owl-bot-staging/google-container/v1/.jsdoc.js new file mode 100644 index 00000000000..6dc18e81193 --- /dev/null +++ b/owl-bot-staging/google-container/v1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2023 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/container', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-container/v1/.mocharc.js b/owl-bot-staging/google-container/v1/.mocharc.js new file mode 100644 index 00000000000..1a38f257db7 --- /dev/null +++ b/owl-bot-staging/google-container/v1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-container/v1/.prettierrc.js b/owl-bot-staging/google-container/v1/.prettierrc.js new file mode 100644 index 00000000000..55639e70f9e --- /dev/null +++ b/owl-bot-staging/google-container/v1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-container/v1/README.md b/owl-bot-staging/google-container/v1/README.md new file mode 100644 index 00000000000..f32441d7e6b --- /dev/null +++ b/owl-bot-staging/google-container/v1/README.md @@ -0,0 +1 @@ +Container: Nodejs Client diff --git a/owl-bot-staging/google-container/v1/linkinator.config.json b/owl-bot-staging/google-container/v1/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/owl-bot-staging/google-container/v1/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/owl-bot-staging/google-container/v1/package.json b/owl-bot-staging/google-container/v1/package.json new file mode 100644 index 00000000000..9795068794e --- /dev/null +++ b/owl-bot-staging/google-container/v1/package.json @@ -0,0 +1,64 @@ +{ + "name": "@google-cloud/container", + "version": "0.1.0", + "description": "Container client for Node.js", + "repository": "googleapis/nodejs-container", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google container", + "container", + "cluster manager" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^3.5.7" + }, + "devDependencies": { + "@types/mocha": "^10.0.1", + "@types/node": "^18.11.18", + "@types/sinon": "^10.0.13", + "c8": "^7.12.0", + "gts": "^3.1.1", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.1", + "jsdoc-region-tag": "^2.0.1", + "linkinator": "^4.1.2", + "mocha": "^10.2.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^15.0.1", + "ts-loader": "^8.4.0", + "typescript": "^4.8.4", + "webpack": "^4.46.0", + "webpack-cli": "^4.10.0" + }, + "engines": { + "node": ">=v12" + } +} diff --git a/owl-bot-staging/google-container/v1/protos/google/container/v1/cluster_service.proto b/owl-bot-staging/google-container/v1/protos/google/container/v1/cluster_service.proto new file mode 100644 index 00000000000..8fa1e9d0069 --- /dev/null +++ b/owl-bot-staging/google-container/v1/protos/google/container/v1/cluster_service.proto @@ -0,0 +1,5087 @@ +// Copyright 2023 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. + +syntax = "proto3"; + +package google.container.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/rpc/code.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.Container.V1"; +option go_package = "cloud.google.com/go/container/apiv1/containerpb;containerpb"; +option java_multiple_files = true; +option java_outer_classname = "ClusterServiceProto"; +option java_package = "com.google.container.v1"; +option php_namespace = "Google\\Cloud\\Container\\V1"; +option ruby_package = "Google::Cloud::Container::V1"; +option (google.api.resource_definition) = { + type: "pubsub.googleapis.com/Topic" + pattern: "projects/{project}/topics/{topic}" +}; + +// Google Kubernetes Engine Cluster Manager v1 +service ClusterManager { + option (google.api.default_host) = "container.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists all clusters owned by a project in either the specified zone or all + // zones. + rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/clusters" + additional_bindings { + get: "/v1/projects/{project_id}/zones/{zone}/clusters" + } + }; + option (google.api.method_signature) = "project_id,zone"; + option (google.api.method_signature) = "parent"; + } + + // Gets the details of a specific cluster. + rpc GetCluster(GetClusterRequest) returns (Cluster) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/clusters/*}" + additional_bindings { + get: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id"; + option (google.api.method_signature) = "name"; + } + + // 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](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). + // + // 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. + rpc CreateCluster(CreateClusterRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/clusters" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster"; + option (google.api.method_signature) = "parent,cluster"; + } + + // Updates the settings of a specific cluster. + rpc UpdateCluster(UpdateClusterRequest) returns (Operation) { + option (google.api.http) = { + put: "/v1/{name=projects/*/locations/*/clusters/*}" + body: "*" + additional_bindings { + put: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id,update"; + option (google.api.method_signature) = "name,update"; + } + + // Updates the version and/or image type for the specified node pool. + rpc UpdateNodePool(UpdateNodePoolRequest) returns (Operation) { + option (google.api.http) = { + put: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/update" + body: "*" + } + }; + } + + // Sets the autoscaling settings for the specified node pool. + rpc SetNodePoolAutoscaling(SetNodePoolAutoscalingRequest) + returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setAutoscaling" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/autoscaling" + body: "*" + } + }; + } + + // Sets the logging service for a specific cluster. + rpc SetLoggingService(SetLoggingServiceRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:setLogging" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/logging" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,logging_service"; + option (google.api.method_signature) = "name,logging_service"; + } + + // Sets the monitoring service for a specific cluster. + rpc SetMonitoringService(SetMonitoringServiceRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:setMonitoring" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/monitoring" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,monitoring_service"; + option (google.api.method_signature) = "name,monitoring_service"; + } + + // Sets the addons for a specific cluster. + rpc SetAddonsConfig(SetAddonsConfigRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:setAddons" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/addons" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,addons_config"; + option (google.api.method_signature) = "name,addons_config"; + } + + // Sets the locations for a specific cluster. + // Deprecated. Use + // [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update) + // instead. + rpc SetLocations(SetLocationsRequest) returns (Operation) { + option deprecated = true; + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:setLocations" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/locations" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,locations"; + option (google.api.method_signature) = "name,locations"; + } + + // Updates the master for a specific cluster. + rpc UpdateMaster(UpdateMasterRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:updateMaster" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/master" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,master_version"; + option (google.api.method_signature) = "name,master_version"; + } + + // Sets master auth materials. Currently supports changing the admin password + // or a specific cluster, either via password generation or explicitly setting + // the password. + rpc SetMasterAuth(SetMasterAuthRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:setMasterAuth" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setMasterAuth" + body: "*" + } + }; + } + + // 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. + rpc DeleteCluster(DeleteClusterRequest) returns (Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/clusters/*}" + additional_bindings { + delete: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id"; + option (google.api.method_signature) = "name"; + } + + // Lists all operations in a project in a specific zone or all zones. + rpc ListOperations(ListOperationsRequest) returns (ListOperationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/operations" + additional_bindings { + get: "/v1/projects/{project_id}/zones/{zone}/operations" + } + }; + option (google.api.method_signature) = "project_id,zone"; + } + + // Gets the specified operation. + rpc GetOperation(GetOperationRequest) returns (Operation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/operations/*}" + additional_bindings { + get: "/v1/projects/{project_id}/zones/{zone}/operations/{operation_id}" + } + }; + option (google.api.method_signature) = "project_id,zone,operation_id"; + option (google.api.method_signature) = "name"; + } + + // Cancels the specified operation. + rpc CancelOperation(CancelOperationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/operations/*}:cancel" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/operations/{operation_id}:cancel" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,zone,operation_id"; + option (google.api.method_signature) = "name"; + } + + // Returns configuration info about the Google Kubernetes Engine service. + rpc GetServerConfig(GetServerConfigRequest) returns (ServerConfig) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*}/serverConfig" + additional_bindings { + get: "/v1/projects/{project_id}/zones/{zone}/serverconfig" + } + }; + option (google.api.method_signature) = "project_id,zone"; + option (google.api.method_signature) = "name"; + } + + // Gets the public component of the cluster signing keys in + // JSON Web Key format. + // This API is not yet intended for general use, and is not available for all + // clusters. + rpc GetJSONWebKeys(GetJSONWebKeysRequest) returns (GetJSONWebKeysResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/clusters/*}/jwks" + }; + } + + // Lists the node pools for a cluster. + rpc ListNodePools(ListNodePoolsRequest) returns (ListNodePoolsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/clusters/*}/nodePools" + additional_bindings { + get: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id"; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the requested node pool. + rpc GetNodePool(GetNodePoolRequest) returns (NodePool) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}" + additional_bindings { + get: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,node_pool_id"; + option (google.api.method_signature) = "name"; + } + + // Creates a node pool for a cluster. + rpc CreateNodePool(CreateNodePoolRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/clusters/*}/nodePools" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,node_pool"; + option (google.api.method_signature) = "parent,node_pool"; + } + + // Deletes a node pool from a cluster. + rpc DeleteNodePool(DeleteNodePoolRequest) returns (Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}" + additional_bindings { + delete: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,node_pool_id"; + option (google.api.method_signature) = "name"; + } + + // CompleteNodePoolUpgrade will signal an on-going node pool upgrade to + // complete. + rpc CompleteNodePoolUpgrade(CompleteNodePoolUpgradeRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}:completeUpgrade" + body: "*" + }; + } + + // Rolls back a previously Aborted or Failed NodePool upgrade. + // This makes no changes if the last upgrade successfully completed. + rpc RollbackNodePoolUpgrade(RollbackNodePoolUpgradeRequest) + returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}:rollback" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}:rollback" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,node_pool_id"; + option (google.api.method_signature) = "name"; + } + + // Sets the NodeManagement options for a node pool. + rpc SetNodePoolManagement(SetNodePoolManagementRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setManagement" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/setManagement" + body: "*" + } + }; + } + + // Sets labels on a cluster. + rpc SetLabels(SetLabelsRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:setResourceLabels" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/resourceLabels" + body: "*" + } + }; + } + + // Enables or disables the ABAC authorization mechanism on a cluster. + rpc SetLegacyAbac(SetLegacyAbacRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:setLegacyAbac" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/legacyAbac" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id,enabled"; + option (google.api.method_signature) = "name,enabled"; + } + + // Starts master IP rotation. + rpc StartIPRotation(StartIPRotationRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:startIpRotation" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:startIpRotation" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id"; + option (google.api.method_signature) = "name"; + } + + // Completes master IP rotation. + rpc CompleteIPRotation(CompleteIPRotationRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:completeIpRotation" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:completeIpRotation" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id"; + option (google.api.method_signature) = "name"; + } + + // Sets the size for a specific node pool. The new size will be used for all + // replicas, including future replicas created by modifying + // [NodePool.locations][google.container.v1.NodePool.locations]. + rpc SetNodePoolSize(SetNodePoolSizeRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setSize" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/setSize" + body: "*" + } + }; + } + + // Enables or disables Network Policy for a cluster. + rpc SetNetworkPolicy(SetNetworkPolicyRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:setNetworkPolicy" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setNetworkPolicy" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,network_policy"; + option (google.api.method_signature) = "name,network_policy"; + } + + // Sets the maintenance policy for a cluster. + rpc SetMaintenancePolicy(SetMaintenancePolicyRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:setMaintenancePolicy" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setMaintenancePolicy" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,maintenance_policy"; + option (google.api.method_signature) = "name,maintenance_policy"; + } + + // Lists subnetworks that are usable for creating clusters in a project. + rpc ListUsableSubnetworks(ListUsableSubnetworksRequest) + returns (ListUsableSubnetworksResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/aggregated/usableSubnetworks" + }; + } + + // Checks the cluster compatibility with Autopilot mode, and returns a list of + // compatibility issues. + rpc CheckAutopilotCompatibility(CheckAutopilotCompatibilityRequest) + returns (CheckAutopilotCompatibilityResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/clusters/*}:checkAutopilotCompatibility" + }; + } +} + +// Parameters that can be configured on Linux nodes. +message LinuxNodeConfig { + // Possible cgroup modes that can be used. + enum CgroupMode { + // CGROUP_MODE_UNSPECIFIED is when unspecified cgroup configuration is used. + // The default for the GKE node OS image will be used. + CGROUP_MODE_UNSPECIFIED = 0; + + // CGROUP_MODE_V1 specifies to use cgroupv1 for the cgroup configuration on + // the node image. + CGROUP_MODE_V1 = 1; + + // CGROUP_MODE_V2 specifies to use cgroupv2 for the cgroup configuration on + // the node image. + CGROUP_MODE_V2 = 2; + } + + // The Linux kernel parameters to be applied to the nodes and all pods running + // on the nodes. + // + // The following parameters are supported. + // + // net.core.busy_poll + // net.core.busy_read + // net.core.netdev_max_backlog + // net.core.rmem_max + // net.core.wmem_default + // net.core.wmem_max + // net.core.optmem_max + // net.core.somaxconn + // net.ipv4.tcp_rmem + // net.ipv4.tcp_wmem + // net.ipv4.tcp_tw_reuse + map sysctls = 1; + + // cgroup_mode specifies the cgroup mode to be used on the node. + CgroupMode cgroup_mode = 2; +} + +// Parameters that can be configured on Windows nodes. +// Windows Node Config that define the parameters that will be used to +// configure the Windows node pool settings +message WindowsNodeConfig { + // Possible OS version that can be used. + enum OSVersion { + // When OSVersion is not specified + OS_VERSION_UNSPECIFIED = 0; + + // LTSC2019 specifies to use LTSC2019 as the Windows Servercore Base Image + OS_VERSION_LTSC2019 = 1; + + // LTSC2022 specifies to use LTSC2022 as the Windows Servercore Base Image + OS_VERSION_LTSC2022 = 2; + } + + // OSVersion specifies the Windows node config to be used on the node + OSVersion os_version = 1; +} + +// Node kubelet configs. +message NodeKubeletConfig { + // Control the CPU management policy on the node. + // See + // https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/ + // + // The following values are allowed. + // * "none": the default, which represents the existing scheduling behavior. + // * "static": allows pods with certain resource characteristics to be granted + // increased CPU affinity and exclusivity on the node. + // The default value is 'none' if unspecified. + string cpu_manager_policy = 1; + + // Enable CPU CFS quota enforcement for containers that specify CPU limits. + // + // This option is enabled by default which makes kubelet use CFS quota + // (https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt) to + // enforce container CPU limits. Otherwise, CPU limits will not be enforced at + // all. + // + // Disable this option to mitigate CPU throttling problems while still having + // your pods to be in Guaranteed QoS class by specifying the CPU limits. + // + // The default value is 'true' if unspecified. + google.protobuf.BoolValue cpu_cfs_quota = 2; + + // Set the CPU CFS quota period value 'cpu.cfs_period_us'. + // + // The string must be a sequence of decimal numbers, each with optional + // fraction and a unit suffix, such as "300ms". + // Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". + // The value must be a positive duration. + string cpu_cfs_quota_period = 3; + + // Set the Pod PID limits. See + // https://kubernetes.io/docs/concepts/policy/pid-limiting/#pod-pid-limits + // + // Controls the maximum number of processes allowed to run in a pod. The value + // must be greater than or equal to 1024 and less than 4194304. + int64 pod_pids_limit = 4; +} + +// Parameters that describe the nodes in a cluster. +// +// GKE Autopilot clusters do not +// recognize parameters in `NodeConfig`. Use +// [AutoprovisioningNodePoolDefaults][google.container.v1.AutoprovisioningNodePoolDefaults] +// instead. +message NodeConfig { + // The name of a Google Compute Engine [machine + // type](https://cloud.google.com/compute/docs/machine-types) + // + // If unspecified, the default machine type is `e2-medium`. + string machine_type = 1; + + // 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. + int32 disk_size_gb = 2; + + // 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](https://cloud.google.com/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. + repeated string oauth_scopes = 3; + + // The Google Cloud Platform Service Account to be used by the node VMs. + // Specify the email address of the Service Account; otherwise, if no Service + // Account is specified, the "default" service account is used. + string service_account = 9; + + // 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-ensure-gke-docker" + // - "gci-metrics-enabled" + // - "gci-update-strategy" + // - "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" + // + // 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. + map metadata = 4; + + // The image type to use for this node. Note that for a given image type, + // the latest version of it will be used. Please see + // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for + // available image types. + string image_type = 5; + + // 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/ + map labels = 6; + + // 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. + int32 local_ssd_count = 7; + + // 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. + repeated string tags = 8; + + // 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. + bool preemptible = 10; + + // 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. + repeated AcceleratorConfig accelerators = 11; + + // Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or + // 'pd-balanced') + // + // If unspecified, the default disk type is 'pd-standard' + string disk_type = 12; + + // 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](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform) + string min_cpu_platform = 13; + + // The workload metadata configuration for this node. + WorkloadMetadataConfig workload_metadata_config = 14; + + // 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/ + repeated NodeTaint taints = 15; + + // Sandbox configuration for this node. + SandboxConfig sandbox_config = 17; + + // Setting this field will assign instances of this + // pool to run on the specified node group. This is useful for running + // workloads on [sole tenant + // nodes](https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes). + string node_group = 18; + + // The optional reservation affinity. Setting this field will apply + // the specified [Zonal Compute + // Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources) + // to this node pool. + ReservationAffinity reservation_affinity = 19; + + // Shielded Instance options. + ShieldedInstanceConfig shielded_instance_config = 20; + + // Parameters that can be configured on Linux nodes. + LinuxNodeConfig linux_node_config = 21; + + // Node kubelet configs. + NodeKubeletConfig kubelet_config = 22; + + // + // The Customer Managed Encryption Key used to encrypt the boot disk attached + // to each node in the node pool. This should be of the form + // projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. + // For more information about protecting resources with Cloud KMS Keys please + // see: + // https://cloud.google.com/compute/docs/disks/customer-managed-encryption + string boot_disk_kms_key = 23; + + // Google Container File System (image streaming) configs. + GcfsConfig gcfs_config = 25; + + // Advanced features for the Compute Engine VM. + AdvancedMachineFeatures advanced_machine_features = 26; + + // Enable or disable gvnic in the node pool. + VirtualNIC gvnic = 29; + + // Spot flag for enabling Spot VM, which is a rebrand of + // the existing preemptible flag. + bool spot = 32; + + // Confidential nodes config. + // All the nodes in the node pool will be Confidential VM once enabled. + ConfidentialNodes confidential_nodes = 35; + + // Enable or disable NCCL fast socket for the node pool. + optional FastSocket fast_socket = 36; + + // The resource labels for the node pool to use to annotate any related + // Google Compute Engine resources. + map resource_labels = 37; + + // Logging configuration. + NodePoolLoggingConfig logging_config = 38; + + // Parameters that can be configured on Windows nodes. + WindowsNodeConfig windows_node_config = 39; + + // Parameters for using raw-block Local NVMe SSDs. + LocalNvmeSsdBlockConfig local_nvme_ssd_block_config = 40; + + // Parameters for the node ephemeral storage using Local SSDs. + // If unspecified, ephemeral storage is backed by the boot disk. + EphemeralStorageLocalSsdConfig ephemeral_storage_local_ssd_config = 41; + + // Parameters for node pools to be backed by shared sole tenant node groups. + SoleTenantConfig sole_tenant_config = 42; +} + +// Specifies options for controlling advanced machine features. +message AdvancedMachineFeatures { + // The number of threads per physical core. To disable simultaneous + // multithreading (SMT) set this to 1. If unset, the maximum number of threads + // supported per core by the underlying processor is assumed. + optional int64 threads_per_core = 1; +} + +// Parameters for node pool-level network config. +message NodeNetworkConfig { + // Configuration of all network bandwidth tiers + message NetworkPerformanceConfig { + // Node network tier + enum Tier { + // Default value + TIER_UNSPECIFIED = 0; + + // Higher bandwidth, actual values based on VM size. + TIER_1 = 1; + } + + // Specifies the total network bandwidth tier for the NodePool. + optional Tier total_egress_bandwidth_tier = 1; + } + + // Input only. Whether to create a new range for pod IPs in this node pool. + // Defaults are provided for `pod_range` and `pod_ipv4_cidr_block` if they + // are not specified. + // + // If neither `create_pod_range` or `pod_range` are specified, the + // cluster-level default (`ip_allocation_policy.cluster_ipv4_cidr_block`) is + // used. + // + // Only applicable if `ip_allocation_policy.use_ip_aliases` is true. + // + // This field cannot be changed after the node pool has been created. + bool create_pod_range = 4 [(google.api.field_behavior) = INPUT_ONLY]; + + // The ID of the secondary range for pod IPs. + // If `create_pod_range` is true, this ID is used for the new range. + // If `create_pod_range` is false, uses an existing secondary range with this + // ID. + // + // Only applicable if `ip_allocation_policy.use_ip_aliases` is true. + // + // This field cannot be changed after the node pool has been created. + string pod_range = 5; + + // The IP address range for pod IPs in this node pool. + // + // Only applicable if `create_pod_range` 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](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `10.96.0.0/14`) to pick a specific range to use. + // + // Only applicable if `ip_allocation_policy.use_ip_aliases` is true. + // + // This field cannot be changed after the node pool has been created. + string pod_ipv4_cidr_block = 6; + + // Whether nodes have internal IP addresses only. + // If enable_private_nodes is not specified, then the value is derived from + // [cluster.privateClusterConfig.enablePrivateNodes][google.container.v1beta1.PrivateClusterConfig.enablePrivateNodes] + optional bool enable_private_nodes = 9; + + // Network bandwidth tier configuration. + optional NetworkPerformanceConfig network_performance_config = 11; + + // [PRIVATE FIELD] + // Pod CIDR size overprovisioning config for the nodepool. + // + // Pod CIDR size per node depends on max_pods_per_node. By default, the value + // of max_pods_per_node is rounded off to next power of 2 and we then double + // that to get the size of pod CIDR block per node. + // Example: max_pods_per_node of 30 would result in 64 IPs (/26). + // + // This config can disable the doubling of IPs (we still round off to next + // power of 2) + // Example: max_pods_per_node of 30 will result in 32 IPs (/27) when + // overprovisioning is disabled. + PodCIDROverprovisionConfig pod_cidr_overprovision_config = 13; +} + +// A set of Shielded Instance options. +message ShieldedInstanceConfig { + // 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. + bool enable_secure_boot = 1; + + // 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. + bool enable_integrity_monitoring = 2; +} + +// SandboxConfig contains configurations of the sandbox to use for the node. +message SandboxConfig { + // Possible types of sandboxes. + enum Type { + // Default value. This should not be used. + UNSPECIFIED = 0; + + // Run sandbox using gvisor. + GVISOR = 1; + } + + // Type of the sandbox to use for the node. + Type type = 2; +} + +// GcfsConfig contains configurations of Google Container File System +// (image streaming). +message GcfsConfig { + // Whether to use GCFS. + bool enabled = 1; +} + +// [ReservationAffinity](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources) +// is the configuration of desired reservation which instances could take +// capacity from. +message ReservationAffinity { + // Indicates whether to consume capacity from a reservation or not. + enum Type { + // Default value. This should not be used. + UNSPECIFIED = 0; + + // Do not consume from any reserved capacity. + NO_RESERVATION = 1; + + // Consume any reservation available. + ANY_RESERVATION = 2; + + // Must consume from a specific reservation. Must specify key value fields + // for specifying the reservations. + SPECIFIC_RESERVATION = 3; + } + + // Corresponds to the type of reservation consumption. + Type consume_reservation_type = 1; + + // Corresponds to the label key of a reservation resource. To target a + // SPECIFIC_RESERVATION by name, specify + // "compute.googleapis.com/reservation-name" as the key and specify the name + // of your reservation as its value. + string key = 2; + + // Corresponds to the label value(s) of reservation resource(s). + repeated string values = 3; +} + +// SoleTenantConfig contains the NodeAffinities to specify what shared sole +// tenant node groups should back the node pool. +message SoleTenantConfig { + // Specifies the NodeAffinity key, values, and affinity operator according to + // [shared sole tenant node group + // affinities](https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes#node_affinity_and_anti-affinity). + message NodeAffinity { + // Operator allows user to specify affinity or anti-affinity for the + // given key values. + enum Operator { + // Invalid or unspecified affinity operator. + OPERATOR_UNSPECIFIED = 0; + + // Affinity operator. + IN = 1; + + // Anti-affinity operator. + NOT_IN = 2; + } + + // Key for NodeAffinity. + string key = 1; + + // Operator for NodeAffinity. + Operator operator = 2; + + // Values for NodeAffinity. + repeated string values = 3; + } + + // NodeAffinities used to match to a shared sole tenant node group. + repeated NodeAffinity node_affinities = 1; +} + +// Kubernetes taint is composed of three fields: key, value, and effect. Effect +// can only be one of three types: NoSchedule, PreferNoSchedule or NoExecute. +// +// See +// [here](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration) +// for more information, including usage and the valid values. +message NodeTaint { + // Possible values for Effect in taint. + enum Effect { + // Not set + EFFECT_UNSPECIFIED = 0; + + // NoSchedule + NO_SCHEDULE = 1; + + // PreferNoSchedule + PREFER_NO_SCHEDULE = 2; + + // NoExecute + NO_EXECUTE = 3; + } + + // Key for taint. + string key = 1; + + // Value for taint. + string value = 2; + + // Effect for taint. + Effect effect = 3; +} + +// Collection of Kubernetes [node +// taints](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration). +message NodeTaints { + // List of node taints. + repeated NodeTaint taints = 1; +} + +// Collection of node-level [Kubernetes +// labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels). +message NodeLabels { + // Map of node label keys and node label values. + map labels = 1; +} + +// Collection of [GCP +// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). +message ResourceLabels { + // Map of node label keys and node label values. + map labels = 1; +} + +// Collection of Compute Engine network tags that can be applied to a node's +// underlying VM instance. +message NetworkTags { + // List of network tags. + repeated string tags = 1; +} + +// The authentication information for accessing the master endpoint. +// Authentication can be done using HTTP basic auth or using client +// certificates. +message MasterAuth { + // 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). + // + // Warning: basic authentication is deprecated, and will be removed in GKE + // control plane versions 1.19 and newer. For a list of recommended + // authentication methods, see: + // https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication + string username = 1 [deprecated = true]; + + // 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. + // + // Warning: basic authentication is deprecated, and will be removed in GKE + // control plane versions 1.19 and newer. For a list of recommended + // authentication methods, see: + // https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication + string password = 2 [deprecated = true]; + + // Configuration for client certificate authentication on the cluster. For + // clusters before v1.12, if no configuration is specified, a client + // certificate is issued. + ClientCertificateConfig client_certificate_config = 3; + + // [Output only] Base64-encoded public certificate that is the root of + // trust for the cluster. + string cluster_ca_certificate = 100; + + // [Output only] Base64-encoded public certificate used by clients to + // authenticate to the cluster endpoint. + string client_certificate = 101; + + // [Output only] Base64-encoded private key used by clients to authenticate + // to the cluster endpoint. + string client_key = 102; +} + +// Configuration for client certificates on the cluster. +message ClientCertificateConfig { + // Issue a client certificate. + bool issue_client_certificate = 1; +} + +// Configuration for the addons that can be automatically spun up in the +// cluster, enabling additional functionality. +message AddonsConfig { + // Configuration for the HTTP (L7) load balancing controller addon, which + // makes it easy to set up HTTP load balancers for services in a cluster. + HttpLoadBalancing http_load_balancing = 1; + + // 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. + HorizontalPodAutoscaling horizontal_pod_autoscaling = 2; + + // 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 + KubernetesDashboard kubernetes_dashboard = 3 [deprecated = true]; + + // 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. + NetworkPolicyConfig network_policy_config = 4; + + // Configuration for the Cloud Run addon, which allows the user to use a + // managed Knative service. + CloudRunConfig cloud_run_config = 7; + + // Configuration for NodeLocalDNS, a dns cache running on cluster nodes + DnsCacheConfig dns_cache_config = 8; + + // Configuration for the ConfigConnector add-on, a Kubernetes + // extension to manage hosted GCP services through the Kubernetes API + ConfigConnectorConfig config_connector_config = 10; + + // Configuration for the Compute Engine Persistent Disk CSI driver. + GcePersistentDiskCsiDriverConfig gce_persistent_disk_csi_driver_config = 11; + + // Configuration for the GCP Filestore CSI driver. + GcpFilestoreCsiDriverConfig gcp_filestore_csi_driver_config = 14; + + // Configuration for the Backup for GKE agent addon. + GkeBackupAgentConfig gke_backup_agent_config = 16; +} + +// 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. +message HttpLoadBalancing { + // 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. + bool disabled = 1; +} + +// 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. +message HorizontalPodAutoscaling { + // Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. + // When enabled, it ensures that metrics are collected into Stackdriver + // Monitoring. + bool disabled = 1; +} + +// Configuration for the Kubernetes Dashboard. +message KubernetesDashboard { + // Whether the Kubernetes Dashboard is enabled for this cluster. + bool disabled = 1; +} + +// 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. +message NetworkPolicyConfig { + // Whether NetworkPolicy is enabled for this cluster. + bool disabled = 1; +} + +// Configuration for NodeLocal DNSCache +message DnsCacheConfig { + // Whether NodeLocal DNSCache is enabled for this cluster. + bool enabled = 1; +} + +// Configuration for controlling master global access settings. +message PrivateClusterMasterGlobalAccessConfig { + // Whenever master is accessible globally or not. + bool enabled = 1; +} + +// Configuration options for private clusters. +message PrivateClusterConfig { + // 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. + bool enable_private_nodes = 1; + + // Whether the master's internal IP address is used as the cluster endpoint. + bool enable_private_endpoint = 2; + + // 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. + string master_ipv4_cidr_block = 3; + + // Output only. The internal IP address of this cluster's master endpoint. + string private_endpoint = 4; + + // Output only. The external IP address of this cluster's master endpoint. + string public_endpoint = 5; + + // Output only. The peering name in the customer VPC used by this cluster. + string peering_name = 7; + + // Controls master global access settings. + PrivateClusterMasterGlobalAccessConfig master_global_access_config = 8; + + // Subnet to provision the master's private endpoint during cluster creation. + // Specified in projects/*/regions/*/subnetworks/* format. + string private_endpoint_subnetwork = 10; +} + +// Configuration for returning group information from authenticators. +message AuthenticatorGroupsConfig { + // Whether this cluster should return group membership lookups + // during authentication using a group of security groups. + bool enabled = 1; + + // The name of the security group-of-groups to be used. Only relevant + // if enabled = true. + string security_group = 2; +} + +// Configuration options for the Cloud Run feature. +message CloudRunConfig { + // Load balancer type of ingress service of Cloud Run. + enum LoadBalancerType { + // Load balancer type for Cloud Run is unspecified. + LOAD_BALANCER_TYPE_UNSPECIFIED = 0; + + // Install external load balancer for Cloud Run. + LOAD_BALANCER_TYPE_EXTERNAL = 1; + + // Install internal load balancer for Cloud Run. + LOAD_BALANCER_TYPE_INTERNAL = 2; + } + + // Whether Cloud Run addon is enabled for this cluster. + bool disabled = 1; + + // Which load balancer type is installed for Cloud Run. + LoadBalancerType load_balancer_type = 3; +} + +// Configuration options for the Config Connector add-on. +message ConfigConnectorConfig { + // Whether Cloud Connector is enabled for this cluster. + bool enabled = 1; +} + +// Configuration for the Compute Engine PD CSI driver. +message GcePersistentDiskCsiDriverConfig { + // Whether the Compute Engine PD CSI driver is enabled for this cluster. + bool enabled = 1; +} + +// Configuration for the GCP Filestore CSI driver. +message GcpFilestoreCsiDriverConfig { + // Whether the GCP Filestore CSI driver is enabled for this cluster. + bool enabled = 1; +} + +// Configuration for the Backup for GKE Agent. +message GkeBackupAgentConfig { + // Whether the Backup for GKE agent is enabled for this cluster. + bool enabled = 1; +} + +// 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. +message MasterAuthorizedNetworksConfig { + // CidrBlock contains an optional name and one CIDR block. + message CidrBlock { + // display_name is an optional field for users to identify CIDR blocks. + string display_name = 1; + + // cidr_block must be specified in CIDR notation. + string cidr_block = 2; + } + + // Whether or not master authorized networks is enabled. + bool enabled = 1; + + // cidr_blocks define up to 50 external networks that could access + // Kubernetes master through HTTPS. + repeated CidrBlock cidr_blocks = 2; + + // Whether master is accessbile via Google Compute Engine Public IP addresses. + optional bool gcp_public_cidrs_access_enabled = 3; +} + +// Configuration for the legacy Attribute Based Access Control authorization +// mode. +message LegacyAbac { + // 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. + bool enabled = 1; +} + +// Configuration options for the NetworkPolicy feature. +// https://kubernetes.io/docs/concepts/services-networking/networkpolicies/ +message NetworkPolicy { + // Allowed Network Policy providers. + enum Provider { + // Not set + PROVIDER_UNSPECIFIED = 0; + + // Tigera (Calico Felix). + CALICO = 1; + } + + // The selected network policy provider. + Provider provider = 1; + + // Whether network policy is enabled on the cluster. + bool enabled = 2; +} + +// Configuration for Binary Authorization. +message BinaryAuthorization { + // Binary Authorization mode of operation. + enum EvaluationMode { + // Default value + EVALUATION_MODE_UNSPECIFIED = 0; + + // Disable BinaryAuthorization + DISABLED = 1; + + // Enforce Kubernetes admission requests with BinaryAuthorization using the + // project's singleton policy. This is equivalent to setting the + // enabled boolean to true. + PROJECT_SINGLETON_POLICY_ENFORCE = 2; + } + + // This field is deprecated. Leave this unset and instead configure + // BinaryAuthorization using evaluation_mode. If evaluation_mode is set to + // anything other than EVALUATION_MODE_UNSPECIFIED, this field is ignored. + bool enabled = 1 [deprecated = true]; + + // Mode of operation for binauthz policy evaluation. If unspecified, defaults + // to DISABLED. + EvaluationMode evaluation_mode = 2; +} + +// [PRIVATE FIELD] +// Config for pod CIDR size overprovisioning. +message PodCIDROverprovisionConfig { + // Whether Pod CIDR overprovisioning is disabled. + // Note: Pod CIDR overprovisioning is enabled by default. + bool disable = 1; +} + +// Configuration for controlling how IPs are allocated in the cluster. +message IPAllocationPolicy { + // Whether alias IPs will be used for pod IPs in the cluster. + // This is used in conjunction with use_routes. It cannot + // be true if use_routes is true. If both use_ip_aliases and use_routes are + // false, then the server picks the default IP allocation mode + bool use_ip_aliases = 1; + + // Whether a new subnetwork will be created automatically for the cluster. + // + // This field is only applicable when `use_ip_aliases` is true. + bool create_subnetwork = 2; + + // 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. + string subnetwork_name = 3; + + // This field is deprecated, use cluster_ipv4_cidr_block. + string cluster_ipv4_cidr = 4 [deprecated = true]; + + // This field is deprecated, use node_ipv4_cidr_block. + string node_ipv4_cidr = 5 [deprecated = true]; + + // This field is deprecated, use services_ipv4_cidr_block. + string services_ipv4_cidr = 6 [deprecated = true]; + + // 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. + string cluster_secondary_range_name = 7; + + // 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. + string services_secondary_range_name = 8; + + // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // 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. + string cluster_ipv4_cidr_block = 9; + + // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // 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. + string node_ipv4_cidr_block = 10; + + // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // 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. + string services_ipv4_cidr_block = 11; + + // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // 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. + string tpu_ipv4_cidr_block = 13; + + // Whether routes will be used for pod IPs in the cluster. + // This is used in conjunction with use_ip_aliases. It cannot be true if + // use_ip_aliases is true. If both use_ip_aliases and use_routes are false, + // then the server picks the default IP allocation mode + bool use_routes = 15; + + // The IP stack type of the cluster + StackType stack_type = 16; + + // The ipv6 access type (internal or external) when create_subnetwork is true + IPv6AccessType ipv6_access_type = 17; + + // [PRIVATE FIELD] + // Pod CIDR size overprovisioning config for the cluster. + // + // Pod CIDR size per node depends on max_pods_per_node. By default, the value + // of max_pods_per_node is doubled and then rounded off to next power of 2 to + // get the size of pod CIDR block per node. + // Example: max_pods_per_node of 30 would result in 64 IPs (/26). + // + // This config can disable the doubling of IPs (we still round off to next + // power of 2) + // Example: max_pods_per_node of 30 will result in 32 IPs (/27) when + // overprovisioning is disabled. + PodCIDROverprovisionConfig pod_cidr_overprovision_config = 21; + + // Output only. [Output only] The subnet's IPv6 CIDR block used by nodes and + // pods. + string subnet_ipv6_cidr_block = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output only] The services IPv6 CIDR block for the cluster. + string services_ipv6_cidr_block = 23 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output only] The additional pod ranges that are added to the + // cluster. These pod ranges can be used by new node pools to allocate pod IPs + // automatically. Once the range is removed it will not show up in + // IPAllocationPolicy. + AdditionalPodRangesConfig additional_pod_ranges_config = 24 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A Google Kubernetes Engine cluster. +message Cluster { + // The current status of the cluster. + enum Status { + // Not set. + STATUS_UNSPECIFIED = 0; + + // The PROVISIONING state indicates the cluster is being created. + PROVISIONING = 1; + + // The RUNNING state indicates the cluster has been created and is fully + // usable. + RUNNING = 2; + + // 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. + RECONCILING = 3; + + // The STOPPING state indicates the cluster is being deleted. + STOPPING = 4; + + // The ERROR state indicates the cluster is unusable. It will be + // automatically deleted. Details can be found in the `statusMessage` field. + ERROR = 5; + + // The DEGRADED state indicates the cluster requires user action to restore + // full functionality. Details can be found in the `statusMessage` field. + DEGRADED = 6; + } + + // 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. + string name = 1; + + // An optional description of this cluster. + string description = 2; + + // The number of nodes to create in this cluster. You must ensure that your + // 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 + // "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. + int32 initial_node_count = 3 [deprecated = true]; + + // 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. + NodeConfig node_config = 4 [deprecated = true]; + + // 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. + MasterAuth master_auth = 5; + + // The logging service the cluster should use to write logs. + // Currently available options: + // + // * `logging.googleapis.com/kubernetes` - The Cloud Logging + // service with a Kubernetes-native resource model + // * `logging.googleapis.com` - The legacy Cloud Logging service (no longer + // available as of GKE 1.15). + // * `none` - no logs will be exported from the cluster. + // + // If left as an empty string,`logging.googleapis.com/kubernetes` will be + // used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. + string logging_service = 6; + + // The monitoring service the cluster should use to write metrics. + // Currently available options: + // + // * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring + // service with a Kubernetes-native resource model + // * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no + // longer available as of GKE 1.15). + // * `none` - No metrics will be exported from the cluster. + // + // If left as an empty string,`monitoring.googleapis.com/kubernetes` will be + // used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. + string monitoring_service = 7; + + // The name of the Google Compute Engine + // [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) + // to which the cluster is connected. If left unspecified, the `default` + // network will be used. + string network = 8; + + // The IP address range of the container pods in this cluster, in + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // 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`. + string cluster_ipv4_cidr = 9; + + // Configurations for the various addons available to run in the cluster. + AddonsConfig addons_config = 10; + + // The name of the Google Compute Engine + // [subnetwork](https://cloud.google.com/compute/docs/subnetworks) to which + // the cluster is connected. + string subnetwork = 11; + + // The node pools associated with this cluster. + // This field should not be set if "node_config" or "initial_node_count" are + // specified. + repeated NodePool node_pools = 12; + + // The list of Google Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster's nodes should be located. + // + // This field provides a default value if + // [NodePool.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools#NodePool.FIELDS.locations) + // are not specified during node pool creation. + // + // Warning: changing cluster locations will update the + // [NodePool.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools#NodePool.FIELDS.locations) + // of all node pools and will result in nodes being added and/or removed. + repeated string locations = 13; + + // 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. + bool enable_kubernetes_alpha = 14; + + // The resource labels for the cluster to use to annotate any related + // Google Compute Engine resources. + map resource_labels = 15; + + // The fingerprint of the set of labels for this cluster. + string label_fingerprint = 16; + + // Configuration for the legacy ABAC authorization mode. + LegacyAbac legacy_abac = 18; + + // Configuration options for the NetworkPolicy feature. + NetworkPolicy network_policy = 19; + + // Configuration for cluster IP allocation. + IPAllocationPolicy ip_allocation_policy = 20; + + // The configuration options for master authorized networks feature. + MasterAuthorizedNetworksConfig master_authorized_networks_config = 22; + + // Configure the maintenance policy for this cluster. + MaintenancePolicy maintenance_policy = 23; + + // Configuration for Binary Authorization. + BinaryAuthorization binary_authorization = 24; + + // Cluster-level autoscaling configuration. + ClusterAutoscaling autoscaling = 26; + + // Configuration for cluster networking. + NetworkConfig network_config = 27; + + // 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. + MaxPodsConstraint default_max_pods_constraint = 30; + + // Configuration for exporting resource usages. Resource usage export is + // disabled when this config is unspecified. + ResourceUsageExportConfig resource_usage_export_config = 33; + + // Configuration controlling RBAC group membership information. + AuthenticatorGroupsConfig authenticator_groups_config = 34; + + // Configuration for private cluster. + PrivateClusterConfig private_cluster_config = 37; + + // Configuration of etcd encryption. + DatabaseEncryption database_encryption = 38; + + // Cluster-level Vertical Pod Autoscaling configuration. + VerticalPodAutoscaling vertical_pod_autoscaling = 39; + + // Shielded Nodes configuration. + ShieldedNodes shielded_nodes = 40; + + // Release channel configuration. If left unspecified on cluster creation and + // a version is specified, the cluster is enrolled in the most mature release + // channel where the version is available (first checking STABLE, then + // REGULAR, and finally RAPID). Otherwise, if no release channel + // configuration and no version is specified, the cluster is enrolled in the + // REGULAR channel with its default version. + ReleaseChannel release_channel = 41; + + // Configuration for the use of Kubernetes Service Accounts in GCP IAM + // policies. + WorkloadIdentityConfig workload_identity_config = 43; + + // Configuration for issuance of mTLS keys and certificates to Kubernetes + // pods. + MeshCertificates mesh_certificates = 67; + + // Configuration for the fine-grained cost management feature. + CostManagementConfig cost_management_config = 45; + + // Notification configuration of the cluster. + NotificationConfig notification_config = 49; + + // Configuration of Confidential Nodes. + // All the nodes in the cluster will be Confidential VM once enabled. + ConfidentialNodes confidential_nodes = 50; + + // Configuration for Identity Service component. + IdentityServiceConfig identity_service_config = 54; + + // [Output only] Server-defined URL for the resource. + string self_link = 100; + + // [Output only] The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field is deprecated, use location instead. + string zone = 101 [deprecated = true]; + + // [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. + string endpoint = 102; + + // 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 + string initial_cluster_version = 103; + + // [Output only] The current software version of the master endpoint. + string current_master_version = 104; + + // [Output only] Deprecated, use + // [NodePools.version](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools) + // 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. + string current_node_version = 105 [deprecated = true]; + + // [Output only] The time the cluster was created, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + string create_time = 106; + + // [Output only] The current status of this cluster. + Status status = 107; + + // [Output only] Deprecated. Use conditions instead. + // Additional information about the current status of this + // cluster, if available. + string status_message = 108 [deprecated = true]; + + // [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. + int32 node_ipv4_cidr_size = 109; + + // [Output only] The IP address range of the Kubernetes services in + // this cluster, in + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `1.2.3.4/29`). Service addresses are + // typically put in the last `/16` from the container CIDR. + string services_ipv4_cidr = 110; + + // Deprecated. Use node_pools.instance_group_urls. + repeated string instance_group_urls = 111 [deprecated = true]; + + // [Output only] The number of nodes currently in the cluster. Deprecated. + // Call Kubernetes API directly to retrieve node information. + int32 current_node_count = 112 [deprecated = true]; + + // [Output only] The time the cluster will be automatically + // deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + string expire_time = 113; + + // [Output only] The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) + // or + // [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) + // in which the cluster resides. + string location = 114; + + // Enable the ability to use Cloud TPUs in this cluster. + bool enable_tpu = 115; + + // [Output only] The IP address range of the Cloud TPUs in this cluster, in + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `1.2.3.4/29`). + string tpu_ipv4_cidr_block = 116; + + // Which conditions caused the current cluster state. + repeated StatusCondition conditions = 118; + + // Autopilot configuration for the cluster. + Autopilot autopilot = 128; + + // Output only. Unique id for the cluster. + string id = 129 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Default NodePool settings for the entire cluster. These settings are + // overridden if specified on the specific NodePool object. + optional NodePoolDefaults node_pool_defaults = 131; + + // Logging configuration for the cluster. + LoggingConfig logging_config = 132; + + // Monitoring configuration for the cluster. + MonitoringConfig monitoring_config = 133; + + // Node pool configs that apply to all auto-provisioned node pools + // in autopilot clusters and node auto-provisioning enabled clusters. + NodePoolAutoConfig node_pool_auto_config = 136; + + // This checksum is computed by the server based on the value of cluster + // fields, and may be sent on update requests to ensure the client has an + // up-to-date value before proceeding. + string etag = 139; + + // Fleet information for the cluster. + Fleet fleet = 140; + + // Enable/Disable Security Posture API features for the cluster. + SecurityPostureConfig security_posture_config = 145; + + // Beta APIs Config + K8sBetaAPIConfig enable_k8s_beta_apis = 143; +} + +// K8sBetaAPIConfig , configuration for beta APIs +message K8sBetaAPIConfig { + // Enabled k8s beta APIs. + repeated string enabled_apis = 1; +} + +// SecurityPostureConfig defines the flags needed to enable/disable features for +// the Security Posture API. +message SecurityPostureConfig { + // Mode defines enablement mode for GKE Security posture features. + enum Mode { + // Default value not specified. + MODE_UNSPECIFIED = 0; + + // Disables Security Posture features on the cluster. + DISABLED = 1; + + // Applies Security Posture features on the cluster. + BASIC = 2; + } + + // VulnerabilityMode defines enablement mode for vulnerability scanning. + enum VulnerabilityMode { + // Default value not specified. + VULNERABILITY_MODE_UNSPECIFIED = 0; + + // Disables vulnerability scanning on the cluster. + VULNERABILITY_DISABLED = 1; + + // Applies basic vulnerability scanning on the cluster. + VULNERABILITY_BASIC = 2; + } + + // Sets which mode to use for Security Posture features. + optional Mode mode = 1; + + // Sets which mode to use for vulnerability scanning. + optional VulnerabilityMode vulnerability_mode = 2; +} + +// Node pool configs that apply to all auto-provisioned node pools +// in autopilot clusters and node auto-provisioning enabled clusters. +message NodePoolAutoConfig { + // 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 creation. Each tag within the list + // must comply with RFC1035. + NetworkTags network_tags = 1; +} + +// Subset of Nodepool message that has defaults. +message NodePoolDefaults { + // Subset of NodeConfig message that has defaults. + NodeConfigDefaults node_config_defaults = 1; +} + +// Subset of NodeConfig message that has defaults. +message NodeConfigDefaults { + // GCFS (Google Container File System, also known as Riptide) options. + GcfsConfig gcfs_config = 1; + + // Logging configuration for node pools. + NodePoolLoggingConfig logging_config = 3; +} + +// 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. +message ClusterUpdate { + // 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 + string desired_node_version = 4; + + // The monitoring service the cluster should use to write metrics. + // Currently available options: + // + // * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring + // service with a Kubernetes-native resource model + // * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no + // longer available as of GKE 1.15). + // * `none` - No metrics will be exported from the cluster. + // + // If left as an empty string,`monitoring.googleapis.com/kubernetes` will be + // used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. + string desired_monitoring_service = 5; + + // Configurations for the various addons available to run in the cluster. + AddonsConfig desired_addons_config = 6; + + // 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. + string desired_node_pool_id = 7; + + // The desired image type for the node pool. + // NOTE: Set the "desired_node_pool" field as well. + string desired_image_type = 8; + + // Configuration of etcd encryption. + DatabaseEncryption desired_database_encryption = 46; + + // Configuration for Workload Identity. + WorkloadIdentityConfig desired_workload_identity_config = 47; + + // Configuration for issuance of mTLS keys and certificates to Kubernetes + // pods. + MeshCertificates desired_mesh_certificates = 67; + + // Configuration for Shielded Nodes. + ShieldedNodes desired_shielded_nodes = 48; + + // The desired configuration for the fine-grained cost management feature. + CostManagementConfig desired_cost_management_config = 49; + + // DNSConfig contains clusterDNS config for this cluster. + DNSConfig desired_dns_config = 53; + + // 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. + NodePoolAutoscaling desired_node_pool_autoscaling = 9; + + // The desired list of Google Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster's nodes should be located. + // + // This list must always include the cluster's primary zone. + // + // Warning: changing cluster locations will update the locations of all node + // pools and will result in nodes being added and/or removed. + repeated string desired_locations = 10; + + // The desired configuration options for master authorized networks feature. + MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12; + + // Cluster-level autoscaling configuration. + ClusterAutoscaling desired_cluster_autoscaling = 15; + + // The desired configuration options for the Binary Authorization feature. + BinaryAuthorization desired_binary_authorization = 16; + + // The logging service the cluster should use to write logs. + // Currently available options: + // + // * `logging.googleapis.com/kubernetes` - The Cloud Logging + // service with a Kubernetes-native resource model + // * `logging.googleapis.com` - The legacy Cloud Logging service (no longer + // available as of GKE 1.15). + // * `none` - no logs will be exported from the cluster. + // + // If left as an empty string,`logging.googleapis.com/kubernetes` will be + // used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. + string desired_logging_service = 19; + + // The desired configuration for exporting resource usage. + ResourceUsageExportConfig desired_resource_usage_export_config = 21; + + // Cluster-level Vertical Pod Autoscaling configuration. + VerticalPodAutoscaling desired_vertical_pod_autoscaling = 22; + + // The desired private cluster configuration. + PrivateClusterConfig desired_private_cluster_config = 25; + + // The desired config of Intra-node visibility. + IntraNodeVisibilityConfig desired_intra_node_visibility_config = 26; + + // The desired status of whether to disable default sNAT for this cluster. + DefaultSnatStatus desired_default_snat_status = 28; + + // The desired release channel configuration. + ReleaseChannel desired_release_channel = 31; + + // The desired L4 Internal Load Balancer Subsetting configuration. + ILBSubsettingConfig desired_l4ilb_subsetting_config = 39; + + // The desired datapath provider for the cluster. + DatapathProvider desired_datapath_provider = 50; + + // The desired state of IPv6 connectivity to Google Services. + PrivateIPv6GoogleAccess desired_private_ipv6_google_access = 51; + + // The desired notification configuration. + NotificationConfig desired_notification_config = 55; + + // The desired authenticator groups config for the cluster. + AuthenticatorGroupsConfig desired_authenticator_groups_config = 63; + + // The desired logging configuration. + LoggingConfig desired_logging_config = 64; + + // The desired monitoring configuration. + MonitoringConfig desired_monitoring_config = 65; + + // The desired Identity Service component configuration. + IdentityServiceConfig desired_identity_service_config = 66; + + // ServiceExternalIPsConfig specifies the config for the use of Services with + // ExternalIPs field. + ServiceExternalIPsConfig desired_service_external_ips_config = 60; + + // Enable/Disable private endpoint for the cluster's master. + optional bool desired_enable_private_endpoint = 71; + + // 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 + string desired_master_version = 100; + + // The desired GCFS config for the cluster + GcfsConfig desired_gcfs_config = 109; + + // The desired network tags that apply to all auto-provisioned node pools + // in autopilot clusters and node auto-provisioning enabled clusters. + NetworkTags desired_node_pool_auto_config_network_tags = 110; + + // The desired config of Gateway API on this cluster. + GatewayAPIConfig desired_gateway_api_config = 114; + + // The current etag of the cluster. + // If an etag is provided and does not match the current etag of the cluster, + // update will be blocked and an ABORTED error will be returned. + string etag = 115; + + // The desired node pool logging configuration defaults for the cluster. + NodePoolLoggingConfig desired_node_pool_logging_config = 116; + + // The desired fleet configuration for the cluster. + Fleet desired_fleet = 117; + + // The desired stack type of the cluster. + // If a stack type is provided and does not match the current stack type of + // the cluster, update will attempt to change the stack type to the new type. + StackType desired_stack_type = 119; + + // The additional pod ranges to be added to the cluster. These pod ranges + // can be used by node pools to allocate pod IPs. + AdditionalPodRangesConfig additional_pod_ranges_config = 120; + + // The additional pod ranges that are to be removed from the cluster. + // The pod ranges specified here must have been specified earlier in the + // 'additional_pod_ranges_config' argument. + AdditionalPodRangesConfig removed_additional_pod_ranges_config = 121; + + // Kubernetes open source beta apis enabled on the cluster. Only beta apis + K8sBetaAPIConfig enable_k8s_beta_apis = 122; + + // Enable/Disable Security Posture API features for the cluster. + SecurityPostureConfig desired_security_posture_config = 124; + + // The desired network performance config. + NetworkConfig.ClusterNetworkPerformanceConfig + desired_network_performance_config = 125; + + // Enable/Disable FQDN Network Policy for the cluster. + optional bool desired_enable_fqdn_network_policy = 126; + + // The desired workload policy configuration for the autopilot cluster. + WorkloadPolicyConfig desired_autopilot_workload_policy_config = 128; + + // Desired Beta APIs to be enabled for cluster. + K8sBetaAPIConfig desired_k8s_beta_apis = 131; +} + +// AdditionalPodRangesConfig is the configuration for additional pod secondary +// ranges supporting the ClusterUpdate message. +message AdditionalPodRangesConfig { + // Name for pod secondary ipv4 range which has the actual range defined ahead. + repeated string pod_range_names = 1; +} + +// This operation resource represents operations that may have happened or are +// happening on the cluster. All fields are output only. +message Operation { + // Current status of the operation. + enum Status { + // Not set. + STATUS_UNSPECIFIED = 0; + + // The operation has been created. + PENDING = 1; + + // The operation is currently running. + RUNNING = 2; + + // The operation is done, either cancelled or completed. + DONE = 3; + + // The operation is aborting. + ABORTING = 4; + } + + // Operation type categorizes the operation. + enum Type { + // Not set. + TYPE_UNSPECIFIED = 0; + + // The cluster is being created. The cluster should be assumed to be + // unusable until the operation finishes. + // + // In the event of the operation failing, the cluster will enter the [ERROR + // state][Cluster.Status.ERROR] and eventually be deleted. + CREATE_CLUSTER = 1; + + // The cluster is being deleted. The cluster should be assumed to be + // unusable as soon as this operation starts. + // + // In the event of the operation failing, the cluster will enter the [ERROR + // state][Cluster.Status.ERROR] and the deletion will be automatically + // retried until completed. + DELETE_CLUSTER = 2; + + // The [cluster + // version][google.container.v1.ClusterUpdate.desired_master_version] is + // being updated. Note that this includes "upgrades" to the same version, + // which are simply a recreation. This also includes + // [auto-upgrades](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades#upgrading_automatically). + // For more details, see [documentation on cluster + // upgrades](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades#cluster_upgrades). + UPGRADE_MASTER = 3; + + // A node pool is being updated. Despite calling this an "upgrade", this + // includes most forms of updates to node pools. This also includes + // [auto-upgrades](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-upgrades). + // + // This operation sets the + // [progress][google.container.v1.Operation.progress] field and may be + // [canceled][google.container.v1.ClusterManager.CancelOperation]. + // + // The upgrade strategy depends on [node pool + // configuration](https://cloud.google.com/kubernetes-engine/docs/concepts/node-pool-upgrade-strategies). + // The nodes are generally still usable during this operation. + UPGRADE_NODES = 4; + + // A problem has been detected with the control plane and is being repaired. + // This operation type is initiated by GKE. For more details, see + // [documentation on + // repairs](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#repairs). + REPAIR_CLUSTER = 5; + + // The cluster is being updated. This is a broad category of operations and + // includes operations that only change metadata as well as those that must + // recreate the entire cluster. If the control plane must be recreated, this + // will cause temporary downtime for zonal clusters. + // + // Some features require recreating the nodes as well. Those will be + // recreated as separate operations and the update may not be completely + // functional until the node pools recreations finish. Node recreations will + // generally follow [maintenance + // policies](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions). + // + // Some GKE-initiated operations use this type. This includes certain types + // of auto-upgrades and incident mitigations. + UPDATE_CLUSTER = 6; + + // A node pool is being created. The node pool should be assumed to be + // unusable until this operation finishes. In the event of an error, the + // node pool may be partially created. + // + // If enabled, [node + // autoprovisioning](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-provisioning) + // may have automatically initiated such operations. + CREATE_NODE_POOL = 7; + + // The node pool is being deleted. The node pool should be assumed to be + // unusable as soon as this operation starts. + DELETE_NODE_POOL = 8; + + // The node pool's [manamagent][google.container.v1.NodePool.management] + // field is being updated. These operations only update metadata and may be + // concurrent with most other operations. + SET_NODE_POOL_MANAGEMENT = 9; + + // A problem has been detected with nodes and [they are being + // repaired](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-repair). + // This operation type is initiated by GKE, typically automatically. This + // operation may be concurrent with other operations and there may be + // multiple repairs occurring on the same node pool. + AUTO_REPAIR_NODES = 10; + + // Unused. Automatic node upgrade uses + // [UPGRADE_NODES][google.container.v1.Operation.Type.UPGRADE_NODES]. + AUTO_UPGRADE_NODES = 11 [deprecated = true]; + + // Unused. Updating labels uses + // [UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER]. + SET_LABELS = 12 [deprecated = true]; + + // Unused. Updating master auth uses + // [UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER]. + SET_MASTER_AUTH = 13 [deprecated = true]; + + // The node pool is being resized. With the exception of resizing to or from + // size zero, the node pool is generally usable during this operation. + SET_NODE_POOL_SIZE = 14; + + // Unused. Updating network policy uses + // [UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER]. + SET_NETWORK_POLICY = 15 [deprecated = true]; + + // Unused. Updating maintenance policy uses + // [UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER]. + SET_MAINTENANCE_POLICY = 16 [deprecated = true]; + + // The control plane is being resized. This operation type is initiated by + // GKE. These operations are often performed preemptively to ensure that the + // control plane has sufficient resources and is not typically an indication + // of issues. For more details, see + // [documentation on + // resizes](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#repairs). + RESIZE_CLUSTER = 18; + } + + // The server-assigned ID for the operation. + string name = 1; + + // The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // operation is taking place. This field is deprecated, use location instead. + string zone = 2 [deprecated = true]; + + // The operation type. + Type operation_type = 3; + + // The current status of the operation. + Status status = 4; + + // Detailed operation progress, if available. + string detail = 8; + + // Output only. If an error has occurred, a textual description of the error. + // Deprecated. Use the field error instead. + string status_message = 5 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Server-defined URI for the operation. Example: + // `https://container.googleapis.com/v1alpha1/projects/123/locations/us-central1/operations/operation-123`. + string self_link = 6; + + // Server-defined URI for the target of the operation. The format of this is a + // URI to the resource being modified (such as a cluster, node pool, or node). + // For node pool repairs, there may be multiple nodes being repaired, but only + // one will be the target. + // + // Examples: + // + // - + // ## + // `https://container.googleapis.com/v1/projects/123/locations/us-central1/clusters/my-cluster` + // + // ## + // `https://container.googleapis.com/v1/projects/123/zones/us-central1-c/clusters/my-cluster/nodePools/my-np` + // + // `https://container.googleapis.com/v1/projects/123/zones/us-central1-c/clusters/my-cluster/nodePools/my-np/node/my-node` + string target_link = 7; + + // [Output only] The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) + // or + // [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) + // in which the cluster resides. + string location = 9; + + // [Output only] The time the operation started, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + string start_time = 10; + + // [Output only] The time the operation completed, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + string end_time = 11; + + // Output only. [Output only] Progress information for an operation. + OperationProgress progress = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Which conditions caused the current cluster state. + // Deprecated. Use field error instead. + repeated StatusCondition cluster_conditions = 13 [deprecated = true]; + + // Which conditions caused the current node pool state. + // Deprecated. Use field error instead. + repeated StatusCondition nodepool_conditions = 14 [deprecated = true]; + + // The error result of the operation in case of failure. + google.rpc.Status error = 15; +} + +// Information about operation (or operation stage) progress. +message OperationProgress { + // Progress metric is (string, int|float|string) pair. + message Metric { + // Required. Metric name, e.g., "nodes total", "percent done". + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Strictly one of the values is required. + oneof value { + // For metrics with integer value. + int64 int_value = 2; + + // For metrics with floating point value. + double double_value = 3; + + // For metrics with custom values (ratios, visual progress, etc.). + string string_value = 4; + } + } + + // A non-parameterized string describing an operation stage. + // Unset for single-stage operations. + string name = 1; + + // Status of an operation stage. + // Unset for single-stage operations. + Operation.Status status = 2; + + // Progress metric bundle, for example: + // metrics: [{name: "nodes done", int_value: 15}, + // {name: "nodes total", int_value: 32}] + // or + // metrics: [{name: "progress", double_value: 0.56}, + // {name: "progress scale", double_value: 1.0}] + repeated Metric metrics = 3; + + // Substages of an operation or a stage. + repeated OperationProgress stages = 4; +} + +// CreateClusterRequest creates a cluster. +message CreateClusterRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the parent field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the parent + // field. + string zone = 2 [deprecated = true]; + + // Required. A [cluster + // resource](https://cloud.google.com/container-engine/reference/rest/v1/projects.locations.clusters) + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // The parent (project and location) where the cluster will be created. + // Specified in the format `projects/*/locations/*`. + string parent = 5; +} + +// GetClusterRequest gets the settings of a cluster. +message GetClusterRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to retrieve. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // The name (project, location, cluster) of the cluster to retrieve. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 5; +} + +// UpdateClusterRequest updates the settings of a cluster. +message UpdateClusterRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Required. A description of the update. + ClusterUpdate update = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to update. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 5; +} + +// UpdateNodePoolRequests update a node pool's image and/or version. +message UpdateNodePoolRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Deprecated. The name of the node pool to upgrade. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 [deprecated = true]; + + // 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 + string node_version = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. The desired image type for the node pool. Please see + // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for + // available image types. + string image_type = 6 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster, node pool) of the node pool to + // update. Specified in the format + // `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 8; + + // The desired list of Google Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) in which the + // node pool's nodes should be located. Changing the locations for a node pool + // will result in nodes being either created or removed from the node pool, + // depending on whether locations are being added or removed. + repeated string locations = 13; + + // The desired workload metadata config for the node pool. + WorkloadMetadataConfig workload_metadata_config = 14; + + // Upgrade settings control disruption and speed of the upgrade. + NodePool.UpgradeSettings upgrade_settings = 15; + + // The desired network tags to be applied to all nodes in the node pool. + // If this field is not present, the tags will not be changed. Otherwise, + // the existing network tags will be *replaced* with the provided tags. + NetworkTags tags = 16; + + // The desired node taints to be applied to all nodes in the node pool. + // If this field is not present, the taints will not be changed. Otherwise, + // the existing node taints will be *replaced* with the provided taints. + NodeTaints taints = 17; + + // The desired node labels to be applied to all nodes in the node pool. + // If this field is not present, the labels will not be changed. Otherwise, + // the existing node labels will be *replaced* with the provided labels. + NodeLabels labels = 18; + + // Parameters that can be configured on Linux nodes. + LinuxNodeConfig linux_node_config = 19; + + // Node kubelet configs. + NodeKubeletConfig kubelet_config = 20; + + // Node network config. + NodeNetworkConfig node_network_config = 21; + + // GCFS config. + GcfsConfig gcfs_config = 22; + + // Confidential nodes config. + // All the nodes in the node pool will be Confidential VM once enabled. + ConfidentialNodes confidential_nodes = 23; + + // Enable or disable gvnic on the node pool. + VirtualNIC gvnic = 29; + + // The current etag of the node pool. + // If an etag is provided and does not match the current etag of the node + // pool, update will be blocked and an ABORTED error will be returned. + string etag = 30; + + // Enable or disable NCCL fast socket for the node pool. + FastSocket fast_socket = 31; + + // Logging configuration. + NodePoolLoggingConfig logging_config = 32; + + // The resource labels for the node pool to use to annotate any related + // Google Compute Engine resources. + ResourceLabels resource_labels = 33; + + // Parameters that can be configured on Windows nodes. + WindowsNodeConfig windows_node_config = 34; +} + +// SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool. +message SetNodePoolAutoscalingRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Deprecated. The name of the node pool to upgrade. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 [deprecated = true]; + + // Required. Autoscaling configuration for the node pool. + NodePoolAutoscaling autoscaling = 5 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster, node pool) of the node pool to set + // autoscaler settings. Specified in the format + // `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 6; +} + +// SetLoggingServiceRequest sets the logging service of a cluster. +message SetLoggingServiceRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Required. The logging service the cluster should use to write logs. + // Currently available options: + // + // * `logging.googleapis.com/kubernetes` - The Cloud Logging + // service with a Kubernetes-native resource model + // * `logging.googleapis.com` - The legacy Cloud Logging service (no longer + // available as of GKE 1.15). + // * `none` - no logs will be exported from the cluster. + // + // If left as an empty string,`logging.googleapis.com/kubernetes` will be + // used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. + string logging_service = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to set logging. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 5; +} + +// SetMonitoringServiceRequest sets the monitoring service of a cluster. +message SetMonitoringServiceRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Required. The monitoring service the cluster should use to write metrics. + // Currently available options: + // + // * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring + // service with a Kubernetes-native resource model + // * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no + // longer available as of GKE 1.15). + // * `none` - No metrics will be exported from the cluster. + // + // If left as an empty string,`monitoring.googleapis.com/kubernetes` will be + // used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. + string monitoring_service = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to set monitoring. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 6; +} + +// SetAddonsConfigRequest sets the addons associated with the cluster. +message SetAddonsConfigRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Required. The desired configurations for the various addons available to + // run in the cluster. + AddonsConfig addons_config = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to set addons. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 6; +} + +// SetLocationsRequest sets the locations of the cluster. +message SetLocationsRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Required. The desired list of Google Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) 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. + repeated string locations = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to set locations. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 6; +} + +// UpdateMasterRequest updates the master of the cluster. +message UpdateMasterRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // 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 + string master_version = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to update. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 7; +} + +// SetMasterAuthRequest updates the admin password of a cluster. +message SetMasterAuthRequest { + // Operation type: what type update to perform. + enum Action { + // Operation is unknown and will error out. + UNKNOWN = 0; + + // Set the password to a user generated value. + SET_PASSWORD = 1; + + // Generate a new password and set it to that. + GENERATE_PASSWORD = 2; + + // 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. + SET_USERNAME = 3; + } + + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Required. The exact form of action to be taken on the master auth. + Action action = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. A description of the update. + MasterAuth update = 5 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to set auth. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 7; +} + +// DeleteClusterRequest deletes a cluster. +message DeleteClusterRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to delete. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // The name (project, location, cluster) of the cluster to delete. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 4; +} + +// ListClustersRequest lists clusters. +message ListClustersRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the parent field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides, or "-" for all zones. This field has been deprecated and + // replaced by the parent field. + string zone = 2 [deprecated = true]; + + // The parent (project and location) where the clusters will be listed. + // Specified in the format `projects/*/locations/*`. + // Location "-" matches all zones and all regions. + string parent = 4; +} + +// ListClustersResponse is the result of ListClustersRequest. +message ListClustersResponse { + // A list of clusters in the project in the specified zone, or + // across all ones. + repeated Cluster clusters = 1; + + // If any zones are listed here, the list of clusters returned + // may be missing those zones. + repeated string missing_zones = 2; +} + +// GetOperationRequest gets a single operation. +message GetOperationRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The server-assigned `name` of the operation. + // This field has been deprecated and replaced by the name field. + string operation_id = 3 [deprecated = true]; + + // The name (project, location, operation id) of the operation to get. + // Specified in the format `projects/*/locations/*/operations/*`. + string name = 5; +} + +// ListOperationsRequest lists operations. +message ListOperationsRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the parent field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) to return + // operations for, or `-` for all zones. This field has been deprecated and + // replaced by the parent field. + string zone = 2 [deprecated = true]; + + // The parent (project and location) where the operations will be listed. + // Specified in the format `projects/*/locations/*`. + // Location "-" matches all zones and all regions. + string parent = 4; +} + +// CancelOperationRequest cancels a single operation. +message CancelOperationRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // operation resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The server-assigned `name` of the operation. + // This field has been deprecated and replaced by the name field. + string operation_id = 3 [deprecated = true]; + + // The name (project, location, operation id) of the operation to cancel. + // Specified in the format `projects/*/locations/*/operations/*`. + string name = 4; +} + +// ListOperationsResponse is the result of ListOperationsRequest. +message ListOperationsResponse { + // A list of operations in the project in the specified zone. + repeated Operation operations = 1; + + // If any zones are listed here, the list of operations returned + // may be missing the operations from those zones. + repeated string missing_zones = 2; +} + +// Gets the current Kubernetes Engine service configuration. +message GetServerConfigRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) to return + // operations for. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // The name (project and location) of the server config to get, + // specified in the format `projects/*/locations/*`. + string name = 4; +} + +// Kubernetes Engine service configuration. +message ServerConfig { + // ReleaseChannelConfig exposes configuration for a release channel. + message ReleaseChannelConfig { + // The release channel this configuration applies to. + ReleaseChannel.Channel channel = 1; + + // The default version for newly created clusters on the channel. + string default_version = 2; + + // List of valid versions for the channel. + repeated string valid_versions = 4; + } + + // Version of Kubernetes the service deploys by default. + string default_cluster_version = 1; + + // List of valid node upgrade target versions, in descending order. + repeated string valid_node_versions = 3; + + // Default image type. + string default_image_type = 4; + + // List of valid image types. + repeated string valid_image_types = 5; + + // List of valid master versions, in descending order. + repeated string valid_master_versions = 6; + + // List of release channel configurations. + repeated ReleaseChannelConfig channels = 9; +} + +// CreateNodePoolRequest creates a node pool for a cluster. +message CreateNodePoolRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the parent field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the parent + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the parent field. + string cluster_id = 3 [deprecated = true]; + + // Required. The node pool to create. + NodePool node_pool = 4 [(google.api.field_behavior) = REQUIRED]; + + // The parent (project, location, cluster name) where the node pool will be + // created. Specified in the format + // `projects/*/locations/*/clusters/*`. + string parent = 6; +} + +// DeleteNodePoolRequest deletes a node pool for a cluster. +message DeleteNodePoolRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Deprecated. The name of the node pool to delete. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 [deprecated = true]; + + // The name (project, location, cluster, node pool id) of the node pool to + // delete. Specified in the format + // `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 6; +} + +// ListNodePoolsRequest lists the node pool(s) for a cluster. +message ListNodePoolsRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the parent field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the parent + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the parent field. + string cluster_id = 3 [deprecated = true]; + + // The parent (project, location, cluster name) where the node pools will be + // listed. Specified in the format `projects/*/locations/*/clusters/*`. + string parent = 5; +} + +// GetNodePoolRequest retrieves a node pool for a cluster. +message GetNodePoolRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Deprecated. The name of the node pool. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 [deprecated = true]; + + // The name (project, location, cluster, node pool id) of the node pool to + // get. Specified in the format + // `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 6; +} + +// Settings for blue-green upgrade. +message BlueGreenSettings { + // Standard rollout policy is the default policy for blue-green. + message StandardRolloutPolicy { + // Blue pool size to drain in a batch. + oneof update_batch_size { + // Percentage of the blue pool nodes to drain in a batch. + // The range of this field should be (0.0, 1.0]. + float batch_percentage = 1; + + // Number of blue nodes to drain in a batch. + int32 batch_node_count = 2; + } + + // Soak time after each batch gets drained. Default to zero. + optional google.protobuf.Duration batch_soak_duration = 3; + } + + // The rollout policy controls the general rollout progress of blue-green. + oneof rollout_policy { + // Standard policy for the blue-green upgrade. + StandardRolloutPolicy standard_rollout_policy = 1; + } + + // Time needed after draining entire blue pool. After this period, blue pool + // will be cleaned up. + optional google.protobuf.Duration node_pool_soak_duration = 2; +} + +// 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. +message NodePool { + // These upgrade settings control the level of parallelism and the level of + // disruption caused by an upgrade. + // + // maxUnavailable controls the number of nodes that can be simultaneously + // unavailable. + // + // maxSurge controls the number of additional nodes that can be added to the + // node pool temporarily for the time of the upgrade to increase the number of + // available nodes. + // + // (maxUnavailable + maxSurge) determines the level of parallelism (how many + // nodes are being upgraded at the same time). + // + // Note: upgrades inevitably introduce some disruption since workloads need to + // be moved from old nodes to new, upgraded ones. Even if maxUnavailable=0, + // this holds true. (Disruption stays within the limits of + // PodDisruptionBudget, if it is configured.) + // + // Consider a hypothetical node pool with 5 nodes having maxSurge=2, + // maxUnavailable=1. This means the upgrade process upgrades 3 nodes + // simultaneously. It creates 2 additional (upgraded) nodes, then it brings + // down 3 old (not yet upgraded) nodes at the same time. This ensures that + // there are always at least 4 nodes available. + // + // These upgrade settings configure the upgrade strategy for the node pool. + // Use strategy to switch between the strategies applied to the node pool. + // + // If the strategy is ROLLING, use max_surge and max_unavailable to control + // the level of parallelism and the level of disruption caused by upgrade. + // 1. maxSurge controls the number of additional nodes that can be added to + // the node pool temporarily for the time of the upgrade to increase the + // number of available nodes. + // 2. maxUnavailable controls the number of nodes that can be simultaneously + // unavailable. + // 3. (maxUnavailable + maxSurge) determines the level of parallelism (how + // many nodes are being upgraded at the same time). + // + // If the strategy is BLUE_GREEN, use blue_green_settings to configure the + // blue-green upgrade related settings. + // 1. standard_rollout_policy is the default policy. The policy is used to + // control the way blue pool gets drained. The draining is executed in the + // batch mode. The batch size could be specified as either percentage of the + // node pool size or the number of nodes. batch_soak_duration is the soak + // time after each batch gets drained. + // 2. node_pool_soak_duration is the soak time after all blue nodes are + // drained. After this period, the blue pool nodes will be deleted. + message UpgradeSettings { + // The maximum number of nodes that can be created beyond the current size + // of the node pool during the upgrade process. + int32 max_surge = 1; + + // The maximum number of nodes that can be simultaneously unavailable during + // the upgrade process. A node is considered available if its status is + // Ready. + int32 max_unavailable = 2; + + // Update strategy of the node pool. + optional NodePoolUpdateStrategy strategy = 3; + + // Settings for blue-green upgrade strategy. + optional BlueGreenSettings blue_green_settings = 4; + } + + // UpdateInfo contains resource (instance groups, etc), status and other + // intermediate information relevant to a node pool upgrade. + message UpdateInfo { + // Information relevant to blue-green upgrade. + message BlueGreenInfo { + // Phase represents the different stages blue-green upgrade is running in. + enum Phase { + // Unspecified phase. + PHASE_UNSPECIFIED = 0; + + // blue-green upgrade has been initiated. + UPDATE_STARTED = 1; + + // Start creating green pool nodes. + CREATING_GREEN_POOL = 2; + + // Start cordoning blue pool nodes. + CORDONING_BLUE_POOL = 3; + + // Start draining blue pool nodes. + DRAINING_BLUE_POOL = 4; + + // Start soaking time after draining entire blue pool. + NODE_POOL_SOAKING = 5; + + // Start deleting blue nodes. + DELETING_BLUE_POOL = 6; + + // Rollback has been initiated. + ROLLBACK_STARTED = 7; + } + + // Current blue-green upgrade phase. + Phase phase = 1; + + // The resource URLs of the [managed instance groups] + // (/compute/docs/instance-groups/creating-groups-of-managed-instances) + // associated with blue pool. + repeated string blue_instance_group_urls = 2; + + // The resource URLs of the [managed instance groups] + // (/compute/docs/instance-groups/creating-groups-of-managed-instances) + // associated with green pool. + repeated string green_instance_group_urls = 3; + + // Time to start deleting blue pool to complete blue-green upgrade, + // in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + string blue_pool_deletion_start_time = 4; + + // Version of green pool. + string green_pool_version = 5; + } + + // Information of a blue-green upgrade. + BlueGreenInfo blue_green_info = 1; + } + + // The current status of the node pool instance. + enum Status { + // Not set. + STATUS_UNSPECIFIED = 0; + + // The PROVISIONING state indicates the node pool is being created. + PROVISIONING = 1; + + // The RUNNING state indicates the node pool has been created + // and is fully usable. + RUNNING = 2; + + // 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. + RUNNING_WITH_ERROR = 3; + + // 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. + RECONCILING = 4; + + // The STOPPING state indicates the node pool is being deleted. + STOPPING = 5; + + // The ERROR state indicates the node pool may be unusable. Details + // can be found in the `statusMessage` field. + ERROR = 6; + } + + // PlacementPolicy defines the placement policy used by the node pool. + message PlacementPolicy { + // Type defines the type of placement policy. + enum Type { + // TYPE_UNSPECIFIED specifies no requirements on nodes + // placement. + TYPE_UNSPECIFIED = 0; + + // COMPACT specifies node placement in the same availability domain to + // ensure low communication latency. + COMPACT = 1; + } + + // The type of placement. + Type type = 1; + } + + // The name of the node pool. + string name = 1; + + // The node configuration of the pool. + NodeConfig config = 2; + + // The initial node count for the pool. You must ensure that your + // 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; + + // The list of Google Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) in which the + // NodePool's nodes should be located. + // + // If this value is unspecified during node pool creation, the + // [Cluster.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters#Cluster.FIELDS.locations) + // value will be used, instead. + // + // Warning: changing node pool locations will result in nodes being added + // and/or removed. + repeated string locations = 13; + + // Networking configuration for this NodePool. If specified, it overrides the + // cluster-level defaults. + NodeNetworkConfig network_config = 14; + + // [Output only] Server-defined URL for the resource. + string self_link = 100; + + // The version of Kubernetes running on this NodePool's nodes. If unspecified, + // it defaults as described + // [here](https://cloud.google.com/kubernetes-engine/versioning#specifying_node_version). + string version = 101; + + // [Output only] The resource URLs of the [managed instance + // groups](https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-managed-instances) + // associated with this node pool. + // During the node pool blue-green upgrade operation, the URLs contain both + // blue and green resources. + repeated string instance_group_urls = 102; + + // [Output only] The status of the nodes in this pool instance. + Status status = 103; + + // [Output only] Deprecated. Use conditions instead. + // Additional information about the current status of this + // node pool instance, if available. + string status_message = 104 [deprecated = true]; + + // Autoscaler configuration for this NodePool. Autoscaler is enabled + // only if a valid configuration is present. + NodePoolAutoscaling autoscaling = 4; + + // NodeManagement configuration for this NodePool. + NodeManagement management = 5; + + // The constraint on the maximum number of pods that can be run + // simultaneously on a node in the node pool. + MaxPodsConstraint max_pods_constraint = 6; + + // Which conditions caused the current node pool state. + repeated StatusCondition conditions = 105; + + // [Output only] The pod CIDR block size per node in this node pool. + int32 pod_ipv4_cidr_size = 7; + + // Upgrade settings control disruption and speed of the upgrade. + UpgradeSettings upgrade_settings = 107; + + // Specifies the node placement policy. + PlacementPolicy placement_policy = 108; + + // Output only. [Output only] Update info contains relevant information during + // a node pool update. + UpdateInfo update_info = 109 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // This checksum is computed by the server based on the value of node pool + // fields, and may be sent on update requests to ensure the client has an + // up-to-date value before proceeding. + string etag = 110; + + // Enable best effort provisioning for nodes + BestEffortProvisioning best_effort_provisioning = 113; +} + +// NodeManagement defines the set of node management services turned on for the +// node pool. +message NodeManagement { + // 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. + bool auto_upgrade = 1; + + // 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. + bool auto_repair = 2; + + // Specifies the Auto Upgrade knobs for the node pool. + AutoUpgradeOptions upgrade_options = 10; +} + +// Best effort provisioning. +message BestEffortProvisioning { + // When this is enabled, cluster/node pool creations will ignore non-fatal + // errors like stockout to best provision as many nodes as possible right now + // and eventually bring up all target number of nodes + bool enabled = 1; + + // Minimum number of nodes to be provisioned to be considered as succeeded, + // and the rest of nodes will be provisioned gradually and eventually when + // stockout issue has been resolved. + int32 min_provision_nodes = 2; +} + +// AutoUpgradeOptions defines the set of options for the user to control how +// the Auto Upgrades will proceed. +message AutoUpgradeOptions { + // [Output only] This field is set when upgrades are about to commence + // with the approximate start time for the upgrades, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + string auto_upgrade_start_time = 1; + + // [Output only] This field is set when upgrades are about to commence + // with the description of the upgrade. + string description = 2; +} + +// MaintenancePolicy defines the maintenance policy to be used for the cluster. +message MaintenancePolicy { + // Specifies the maintenance window in which maintenance may be performed. + MaintenanceWindow window = 1; + + // 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. + string resource_version = 3; +} + +// MaintenanceWindow defines the maintenance window to be used for the cluster. +message MaintenanceWindow { + oneof policy { + // DailyMaintenanceWindow specifies a daily maintenance operation window. + DailyMaintenanceWindow daily_maintenance_window = 2; + + // 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. + RecurringTimeWindow recurring_window = 3; + } + + // Exceptions to maintenance window. Non-emergency maintenance should not + // occur in these windows. + map maintenance_exclusions = 4; +} + +// Represents an arbitrary window of time. +message TimeWindow { + oneof options { + // MaintenanceExclusionOptions provides maintenance exclusion related + // options. + MaintenanceExclusionOptions maintenance_exclusion_options = 3; + } + + // The time that the window first starts. + google.protobuf.Timestamp start_time = 1; + + // The time that the window ends. The end time should take place after the + // start time. + google.protobuf.Timestamp end_time = 2; +} + +// Represents the Maintenance exclusion option. +message MaintenanceExclusionOptions { + // Scope of exclusion. + enum Scope { + // NO_UPGRADES excludes all upgrades, including patch upgrades and minor + // upgrades across control planes and nodes. This is the default exclusion + // behavior. + NO_UPGRADES = 0; + + // NO_MINOR_UPGRADES excludes all minor upgrades for the cluster, only + // patches are allowed. + NO_MINOR_UPGRADES = 1; + + // NO_MINOR_OR_NODE_UPGRADES excludes all minor upgrades for the cluster, + // and also exclude all node pool upgrades. Only control + // plane patches are allowed. + NO_MINOR_OR_NODE_UPGRADES = 2; + } + + // Scope specifies the upgrade scope which upgrades are blocked by the + // exclusion. + Scope scope = 1; +} + +// Represents an arbitrary window of time that recurs. +message RecurringTimeWindow { + // The window of the first recurrence. + TimeWindow window = 1; + + // 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. + string recurrence = 2; +} + +// Time window specified for daily maintenance operations. +message DailyMaintenanceWindow { + // Time within the maintenance window to start the maintenance operations. + // Time format should be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) + // format "HH:MM", where HH : [00-23] and MM : [00-59] GMT. + string start_time = 2; + + // [Output only] Duration of the time window, automatically chosen to be + // smallest possible in the given scenario. + // Duration will be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) + // format "PTnHnMnS". + string duration = 3; +} + +// SetNodePoolManagementRequest sets the node management properties of a node +// pool. +message SetNodePoolManagementRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to update. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Deprecated. The name of the node pool to update. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 [deprecated = true]; + + // Required. NodeManagement configuration for the node pool. + NodeManagement management = 5 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster, node pool id) of the node pool to set + // management properties. Specified in the format + // `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 7; +} + +// SetNodePoolSizeRequest sets the size of a node pool. +message SetNodePoolSizeRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to update. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Deprecated. The name of the node pool to update. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 [deprecated = true]; + + // Required. The desired node count for the pool. + int32 node_count = 5 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster, node pool id) of the node pool to set + // size. + // Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 7; +} + +// CompleteNodePoolUpgradeRequest sets the name of target node pool to complete +// upgrade. +message CompleteNodePoolUpgradeRequest { + // The name (project, location, cluster, node pool id) of the node pool to + // complete upgrade. + // Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 1; +} + +// RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed +// NodePool upgrade. This will be an no-op if the last upgrade successfully +// completed. +message RollbackNodePoolUpgradeRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to rollback. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Deprecated. The name of the node pool to rollback. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 [deprecated = true]; + + // The name (project, location, cluster, node pool id) of the node poll to + // rollback upgrade. + // Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 6; + + // Option for rollback to ignore the PodDisruptionBudget. + // Default value is false. + bool respect_pdb = 7; +} + +// ListNodePoolsResponse is the result of ListNodePoolsRequest. +message ListNodePoolsResponse { + // A list of node pools for a cluster. + repeated NodePool node_pools = 1; +} + +// 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. +message ClusterAutoscaling { + // Defines possible options for autoscaling_profile field. + enum AutoscalingProfile { + // No change to autoscaling configuration. + PROFILE_UNSPECIFIED = 0; + + // Prioritize optimizing utilization of resources. + OPTIMIZE_UTILIZATION = 1; + + // Use default (balanced) autoscaling configuration. + BALANCED = 2; + } + + // Enables automatic node pool creation and deletion. + bool enable_node_autoprovisioning = 1; + + // Contains global constraints regarding minimum and maximum + // amount of resources in the cluster. + repeated ResourceLimit resource_limits = 2; + + // Defines autoscaling behaviour. + AutoscalingProfile autoscaling_profile = 3; + + // AutoprovisioningNodePoolDefaults contains defaults for a node pool + // created by NAP. + AutoprovisioningNodePoolDefaults autoprovisioning_node_pool_defaults = 4; + + // The list of Google Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) in which the + // NodePool's nodes can be created by NAP. + repeated string autoprovisioning_locations = 5; +} + +// AutoprovisioningNodePoolDefaults contains defaults for a node pool created +// by NAP. +message AutoprovisioningNodePoolDefaults { + // Scopes that are used by NAP when creating node pools. + repeated string oauth_scopes = 1; + + // The Google Cloud Platform Service Account to be used by the node VMs. + string service_account = 2; + + // Specifies the upgrade settings for NAP created node pools + NodePool.UpgradeSettings upgrade_settings = 3; + + // Specifies the node management options for NAP created node-pools. + NodeManagement management = 4; + + // Deprecated. Minimum CPU platform to be used for NAP created node pools. + // 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](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform). + // This field is deprecated, min_cpu_platform should be specified using + // `cloud.google.com/requested-min-cpu-platform` label selector on the pod. + // To unset the min cpu platform field pass "automatic" + // as field value. + string min_cpu_platform = 5 [deprecated = true]; + + // 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. + int32 disk_size_gb = 6; + + // Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or + // 'pd-balanced') + // + // If unspecified, the default disk type is 'pd-standard' + string disk_type = 7; + + // Shielded Instance options. + ShieldedInstanceConfig shielded_instance_config = 8; + + // The Customer Managed Encryption Key used to encrypt the boot disk attached + // to each node in the node pool. This should be of the form + // projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. + // For more information about protecting resources with Cloud KMS Keys please + // see: + // https://cloud.google.com/compute/docs/disks/customer-managed-encryption + string boot_disk_kms_key = 9; + + // The image type to use for NAP created node. Please see + // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for + // available image types. + string image_type = 10; +} + +// Contains information about amount of some resource in the cluster. +// For memory, value should be in GB. +message ResourceLimit { + // Resource name "cpu", "memory" or gpu-specific string. + string resource_type = 1; + + // Minimum amount of the resource in the cluster. + int64 minimum = 2; + + // Maximum amount of the resource in the cluster. + int64 maximum = 3; +} + +// NodePoolAutoscaling contains information required by cluster autoscaler to +// adjust the size of the node pool to the current cluster usage. +message NodePoolAutoscaling { + // Location policy specifies how zones are picked when scaling up the + // nodepool. + enum LocationPolicy { + // Not set. + LOCATION_POLICY_UNSPECIFIED = 0; + + // BALANCED is a best effort policy that aims to balance the sizes of + // different zones. + BALANCED = 1; + + // ANY policy picks zones that have the highest capacity available. + ANY = 2; + } + + // Is autoscaling enabled for this node pool. + bool enabled = 1; + + // Minimum number of nodes for one location in the NodePool. Must be >= 1 and + // <= max_node_count. + int32 min_node_count = 2; + + // Maximum number of nodes for one location in the NodePool. Must be >= + // min_node_count. There has to be enough quota to scale up the cluster. + int32 max_node_count = 3; + + // Can this node pool be deleted automatically. + bool autoprovisioned = 4; + + // Location policy used when scaling up a nodepool. + LocationPolicy location_policy = 5; + + // Minimum number of nodes in the node pool. Must be greater than 1 less than + // total_max_node_count. + // The total_*_node_count fields are mutually exclusive with the *_node_count + // fields. + int32 total_min_node_count = 6; + + // Maximum number of nodes in the node pool. Must be greater than + // total_min_node_count. There has to be enough quota to scale up the cluster. + // The total_*_node_count fields are mutually exclusive with the *_node_count + // fields. + int32 total_max_node_count = 7; +} + +// 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 +message SetLabelsRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Required. The labels to set for that cluster. + map resource_labels = 4 + [(google.api.field_behavior) = REQUIRED]; + + // 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. + string label_fingerprint = 5 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster name) of the cluster to set labels. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 7; +} + +// SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for +// a cluster. +message SetLegacyAbacRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to update. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Required. Whether ABAC authorization will be enabled in the cluster. + bool enabled = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster name) of the cluster to set legacy + // abac. Specified in the format `projects/*/locations/*/clusters/*`. + string name = 6; +} + +// StartIPRotationRequest creates a new IP for the cluster and then performs +// a node upgrade on each node pool to point to the new IP. +message StartIPRotationRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // The name (project, location, cluster name) of the cluster to start IP + // rotation. Specified in the format `projects/*/locations/*/clusters/*`. + string name = 6; + + // Whether to rotate credentials during IP rotation. + bool rotate_credentials = 7; +} + +// CompleteIPRotationRequest moves the cluster master back into single-IP mode. +message CompleteIPRotationRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // The name (project, location, cluster name) of the cluster to complete IP + // rotation. Specified in the format `projects/*/locations/*/clusters/*`. + string name = 7; +} + +// AcceleratorConfig represents a Hardware Accelerator request. +message AcceleratorConfig { + // The number of the accelerator cards exposed to an instance. + int64 accelerator_count = 1; + + // The accelerator type resource name. List of supported accelerators + // [here](https://cloud.google.com/compute/docs/gpus) + string accelerator_type = 2; + + // Size of partitions to create on the GPU. Valid values are described in the + // NVIDIA [mig user + // guide](https://docs.nvidia.com/datacenter/tesla/mig-user-guide/#partitioning). + string gpu_partition_size = 3; + + // The configuration for GPU sharing options. + optional GPUSharingConfig gpu_sharing_config = 5; + + // The configuration for auto installation of GPU driver. + optional GPUDriverInstallationConfig gpu_driver_installation_config = 6; +} + +// GPUSharingConfig represents the GPU sharing configuration for Hardware +// Accelerators. +message GPUSharingConfig { + // The type of GPU sharing strategy currently provided. + enum GPUSharingStrategy { + // Default value. + GPU_SHARING_STRATEGY_UNSPECIFIED = 0; + + // GPUs are time-shared between containers. + TIME_SHARING = 1; + } + + // The max number of containers that can share a physical GPU. + int64 max_shared_clients_per_gpu = 1; + + // The type of GPU sharing strategy to enable on the GPU node. + optional GPUSharingStrategy gpu_sharing_strategy = 2; +} + +// GPUDriverInstallationConfig specifies the version of GPU driver to be auto +// installed. +message GPUDriverInstallationConfig { + // The GPU driver version to install. + enum GPUDriverVersion { + // Default value is to not install any GPU driver. + GPU_DRIVER_VERSION_UNSPECIFIED = 0; + + // Disable GPU driver auto installation and needs manual installation + INSTALLATION_DISABLED = 1; + + // "Default" GPU driver in COS and Ubuntu. + DEFAULT = 2; + + // "Latest" GPU driver in COS. + LATEST = 3; + } + + // Mode for how the GPU driver is installed. + optional GPUDriverVersion gpu_driver_version = 1; +} + +// WorkloadMetadataConfig defines the metadata configuration to expose to +// workloads on the node pool. +message WorkloadMetadataConfig { + // Mode is the configuration for how to expose metadata to workloads running + // on the node. + enum Mode { + // Not set. + MODE_UNSPECIFIED = 0; + + // Expose all Compute Engine metadata to pods. + GCE_METADATA = 1; + + // Run the GKE Metadata Server on this node. The GKE Metadata Server exposes + // a metadata API to workloads that is compatible with the V1 Compute + // Metadata APIs exposed by the Compute Engine and App Engine Metadata + // Servers. This feature can only be enabled if Workload Identity is enabled + // at the cluster level. + GKE_METADATA = 2; + } + + // Mode is the configuration for how to expose metadata to workloads running + // on the node pool. + Mode mode = 2; +} + +// SetNetworkPolicyRequest enables/disables network policy for a cluster. +message SetNetworkPolicyRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Required. Configuration options for the NetworkPolicy feature. + NetworkPolicy network_policy = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster name) of the cluster to set networking + // policy. Specified in the format `projects/*/locations/*/clusters/*`. + string name = 6; +} + +// SetMaintenancePolicyRequest sets the maintenance policy for a cluster. +message SetMaintenancePolicyRequest { + // Required. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. + string zone = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the cluster to update. + string cluster_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The maintenance policy to be set for the cluster. An empty field + // clears the existing maintenance policy. + MaintenancePolicy maintenance_policy = 4 + [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster name) of the cluster to set + // maintenance policy. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 5; +} + +// StatusCondition describes why a cluster or a node pool has a certain status +// (e.g., ERROR or DEGRADED). +message StatusCondition { + // Code for each condition + enum Code { + // UNKNOWN indicates a generic condition. + UNKNOWN = 0; + + // GCE_STOCKOUT indicates that Google Compute Engine resources are + // temporarily unavailable. + GCE_STOCKOUT = 1; + + // GKE_SERVICE_ACCOUNT_DELETED indicates that the user deleted their robot + // service account. + GKE_SERVICE_ACCOUNT_DELETED = 2; + + // Google Compute Engine quota was exceeded. + GCE_QUOTA_EXCEEDED = 3; + + // Cluster state was manually changed by an SRE due to a system logic error. + SET_BY_OPERATOR = 4; + + // Unable to perform an encrypt operation against the CloudKMS key used for + // etcd level encryption. + CLOUD_KMS_KEY_ERROR = 7; + + // Cluster CA is expiring soon. + CA_EXPIRING = 9; + } + + // Machine-friendly representation of the condition + // Deprecated. Use canonical_code instead. + Code code = 1 [deprecated = true]; + + // Human-friendly representation of the condition + string message = 2; + + // Canonical code of the condition. + google.rpc.Code canonical_code = 3; +} + +// NetworkConfig reports the relative names of network & subnetwork. +message NetworkConfig { + // Configuration of network bandwidth tiers + message ClusterNetworkPerformanceConfig { + // Node network tier + enum Tier { + // Default value + TIER_UNSPECIFIED = 0; + + // Higher bandwidth, actual values based on VM size. + TIER_1 = 1; + } + + // Specifies the total network bandwidth tier for NodePools in the cluster. + optional Tier total_egress_bandwidth_tier = 1; + } + + // Output only. The relative name of the Google Compute Engine + // [network][google.container.v1.NetworkConfig.network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) + // to which the cluster is connected. Example: + // projects/my-project/global/networks/my-network + string network = 1; + + // Output only. The relative name of the Google Compute Engine + // [subnetwork](https://cloud.google.com/compute/docs/vpc) to which the + // cluster is connected. Example: + // projects/my-project/regions/us-central1/subnetworks/my-subnet + string subnetwork = 2; + + // Whether Intra-node visibility is enabled for this cluster. + // This makes same node pod to pod traffic visible for VPC network. + bool enable_intra_node_visibility = 5; + + // Whether the cluster disables default in-node sNAT rules. In-node sNAT rules + // will be disabled when default_snat_status is disabled. When disabled is set + // to false, default IP masquerade rules will be applied to the nodes to + // prevent sNAT on cluster internal traffic. + DefaultSnatStatus default_snat_status = 7; + + // Whether L4ILB Subsetting is enabled for this cluster. + bool enable_l4ilb_subsetting = 10; + + // The desired datapath provider for this cluster. By default, uses the + // IPTables-based kube-proxy implementation. + DatapathProvider datapath_provider = 11; + + // The desired state of IPv6 connectivity to Google Services. + // By default, no private IPv6 access to or from Google Services (all access + // will be via IPv4) + PrivateIPv6GoogleAccess private_ipv6_google_access = 12; + + // DNSConfig contains clusterDNS config for this cluster. + DNSConfig dns_config = 13; + + // ServiceExternalIPsConfig specifies if services with externalIPs field are + // blocked or not. + ServiceExternalIPsConfig service_external_ips_config = 15; + + // GatewayAPIConfig contains the desired config of Gateway API on this + // cluster. + GatewayAPIConfig gateway_api_config = 16; + + // Network bandwidth tier configuration. + ClusterNetworkPerformanceConfig network_performance_config = 18; + + // Whether FQDN Network Policy is enabled on this cluster. + optional bool enable_fqdn_network_policy = 19; +} + +// GatewayAPIConfig contains the desired config of Gateway API on this cluster. +message GatewayAPIConfig { + // Channel describes if/how Gateway API should be installed and implemented in + // a cluster. + enum Channel { + // Default value. + CHANNEL_UNSPECIFIED = 0; + + // Gateway API support is disabled + CHANNEL_DISABLED = 1; + + // Gateway API support is enabled, experimental CRDs are installed + CHANNEL_EXPERIMENTAL = 3; + + // Gateway API support is enabled, standard CRDs are installed + CHANNEL_STANDARD = 4; + } + + // The Gateway API release channel to use for Gateway API. + Channel channel = 1; +} + +// Config to block services with externalIPs field. +message ServiceExternalIPsConfig { + // Whether Services with ExternalIPs field are allowed or not. + bool enabled = 1; +} + +// GetOpenIDConfigRequest gets the OIDC discovery document for the +// cluster. See the OpenID Connect Discovery 1.0 specification for details. +message GetOpenIDConfigRequest { + // The cluster (project, location, cluster name) to get the discovery document + // for. Specified in the format `projects/*/locations/*/clusters/*`. + string parent = 1; +} + +// GetOpenIDConfigResponse is an OIDC discovery document for the cluster. +// See the OpenID Connect Discovery 1.0 specification for details. +message GetOpenIDConfigResponse { + // OIDC Issuer. + string issuer = 1; + + // JSON Web Key uri. + string jwks_uri = 2; + + // Supported response types. + repeated string response_types_supported = 3; + + // Supported subject types. + repeated string subject_types_supported = 4; + + // supported ID Token signing Algorithms. + repeated string id_token_signing_alg_values_supported = 5; + + // Supported claims. + repeated string claims_supported = 6; + + // Supported grant types. + repeated string grant_types = 7; +} + +// GetJSONWebKeysRequest gets the public component of the keys used by the +// cluster to sign token requests. This will be the jwks_uri for the discover +// document returned by getOpenIDConfig. See the OpenID Connect +// Discovery 1.0 specification for details. +message GetJSONWebKeysRequest { + // The cluster (project, location, cluster name) to get keys for. Specified in + // the format `projects/*/locations/*/clusters/*`. + string parent = 1; +} + +// Jwk is a JSON Web Key as specified in RFC 7517 +message Jwk { + // Key Type. + string kty = 1; + + // Algorithm. + string alg = 2; + + // Permitted uses for the public keys. + string use = 3; + + // Key ID. + string kid = 4; + + // Used for RSA keys. + string n = 5; + + // Used for RSA keys. + string e = 6; + + // Used for ECDSA keys. + string x = 7; + + // Used for ECDSA keys. + string y = 8; + + // Used for ECDSA keys. + string crv = 9; +} + +// GetJSONWebKeysResponse is a valid JSON Web Key Set as specififed in rfc 7517 +message GetJSONWebKeysResponse { + // The public component of the keys used by the cluster to sign token + // requests. + repeated Jwk keys = 1; +} + +// CheckAutopilotCompatibilityRequest requests getting the blockers for the +// given operation in the cluster. +message CheckAutopilotCompatibilityRequest { + // The name (project, location, cluster) of the cluster to retrieve. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 1; +} + +// AutopilotCompatibilityIssue contains information about a specific +// compatibility issue with Autopilot mode. +message AutopilotCompatibilityIssue { + // The type of the reported issue. + enum IssueType { + // Default value, should not be used. + UNSPECIFIED = 0; + + // Indicates that the issue is a known incompatibility between the + // cluster and Autopilot mode. + INCOMPATIBILITY = 1; + + // Indicates the issue is an incompatibility if customers take no further + // action to resolve. + ADDITIONAL_CONFIG_REQUIRED = 2; + + // Indicates the issue is not an incompatibility, but depending on the + // workloads business logic, there is a potential that they won't work on + // Autopilot. + PASSED_WITH_OPTIONAL_CONFIG = 3; + } + + // The last time when this issue was observed. + google.protobuf.Timestamp last_observation = 1; + + // The constraint type of the issue. + string constraint_type = 2; + + // The incompatibility type of this issue. + IssueType incompatibility_type = 3; + + // The name of the resources which are subject to this issue. + repeated string subjects = 4; + + // A URL to a public documnetation, which addresses resolving this issue. + string documentation_url = 5; + + // The description of the issue. + string description = 6; +} + +// CheckAutopilotCompatibilityResponse has a list of compatibility issues. +message CheckAutopilotCompatibilityResponse { + // The list of issues for the given operation. + repeated AutopilotCompatibilityIssue issues = 1; + + // The summary of the autopilot compatibility response. + string summary = 2; +} + +// ReleaseChannel indicates which release channel a cluster is +// subscribed to. Release channels are arranged in order of risk. +// +// When a cluster is subscribed to a release channel, Google maintains +// both the master version and the node version. Node auto-upgrade +// defaults to true and cannot be disabled. +message ReleaseChannel { + // Possible values for 'channel'. + enum Channel { + // No channel specified. + UNSPECIFIED = 0; + + // RAPID channel is offered on an early access basis for customers who want + // to test new releases. + // + // WARNING: Versions available in the RAPID Channel may be subject to + // unresolved issues with no known workaround and are not subject to any + // SLAs. + RAPID = 1; + + // Clusters subscribed to REGULAR receive versions that are considered GA + // quality. REGULAR is intended for production users who want to take + // advantage of new features. + REGULAR = 2; + + // Clusters subscribed to STABLE receive versions that are known to be + // stable and reliable in production. + STABLE = 3; + } + + // channel specifies which release channel the cluster is subscribed to. + Channel channel = 1; +} + +// Configuration for fine-grained cost management feature. +message CostManagementConfig { + // Whether the feature is enabled or not. + bool enabled = 1; +} + +// IntraNodeVisibilityConfig contains the desired config of the intra-node +// visibility on this cluster. +message IntraNodeVisibilityConfig { + // Enables intra node visibility for this cluster. + bool enabled = 1; +} + +// ILBSubsettingConfig contains the desired config of L4 Internal LoadBalancer +// subsetting on this cluster. +message ILBSubsettingConfig { + // Enables l4 ILB subsetting for this cluster. + bool enabled = 1; +} + +// DNSConfig contains the desired set of options for configuring clusterDNS. +message DNSConfig { + // Provider lists the various in-cluster DNS providers. + enum Provider { + // Default value + PROVIDER_UNSPECIFIED = 0; + + // Use GKE default DNS provider(kube-dns) for DNS resolution. + PLATFORM_DEFAULT = 1; + + // Use CloudDNS for DNS resolution. + CLOUD_DNS = 2; + + // Use KubeDNS for DNS resolution + KUBE_DNS = 3; + } + + // DNSScope lists the various scopes of access to cluster DNS records. + enum DNSScope { + // Default value, will be inferred as cluster scope. + DNS_SCOPE_UNSPECIFIED = 0; + + // DNS records are accessible from within the cluster. + CLUSTER_SCOPE = 1; + + // DNS records are accessible from within the VPC. + VPC_SCOPE = 2; + } + + // cluster_dns indicates which in-cluster DNS provider should be used. + Provider cluster_dns = 1; + + // cluster_dns_scope indicates the scope of access to cluster DNS records. + DNSScope cluster_dns_scope = 2; + + // cluster_dns_domain is the suffix used for all cluster service records. + string cluster_dns_domain = 3; +} + +// Constraints applied to pods. +message MaxPodsConstraint { + // Constraint enforced on the max num of pods per node. + int64 max_pods_per_node = 1; +} + +// Configuration for the use of Kubernetes Service Accounts in GCP IAM +// policies. +message WorkloadIdentityConfig { + // The workload pool to attach all Kubernetes service accounts to. + string workload_pool = 2; +} + +// IdentityServiceConfig is configuration for Identity Service which allows +// customers to use external identity providers with the K8S API +message IdentityServiceConfig { + // Whether to enable the Identity Service component + bool enabled = 1; +} + +// Configuration for issuance of mTLS keys and certificates to Kubernetes pods. +message MeshCertificates { + // enable_certificates controls issuance of workload mTLS certificates. + // + // If set, the GKE Workload Identity Certificates controller and node agent + // will be deployed in the cluster, which can then be configured by creating a + // WorkloadCertificateConfig Custom Resource. + // + // Requires Workload Identity + // ([workload_pool][google.container.v1.WorkloadIdentityConfig.workload_pool] + // must be non-empty). + google.protobuf.BoolValue enable_certificates = 1; +} + +// Configuration of etcd encryption. +message DatabaseEncryption { + // State of etcd encryption. + enum State { + // Should never be set + UNKNOWN = 0; + + // Secrets in etcd are encrypted. + ENCRYPTED = 1; + + // Secrets in etcd are stored in plain text (at etcd level) - this is + // unrelated to Compute Engine level full disk encryption. + DECRYPTED = 2; + } + + // 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 + string key_name = 1; + + // The desired state of etcd encryption. + State state = 2; +} + +// ListUsableSubnetworksRequest requests the list of usable subnetworks +// available to a user for creating clusters. +message ListUsableSubnetworksRequest { + // The parent project where subnetworks are usable. + // Specified in the format `projects/*`. + string parent = 1; + + // 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. + string filter = 2; + + // 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) + int32 page_size = 3; + + // Specifies a page token to use. Set this to the nextPageToken returned by + // previous list requests to get the next page of results. + string page_token = 4; +} + +// ListUsableSubnetworksResponse is the response of +// ListUsableSubnetworksRequest. +message ListUsableSubnetworksResponse { + // A list of usable subnetworks in the specified network project. + repeated UsableSubnetwork subnetworks = 1; + + // 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. + string next_page_token = 2; +} + +// Secondary IP range of a usable subnetwork. +message UsableSubnetworkSecondaryRange { + // Status shows the current usage of a secondary IP range. + enum Status { + // UNKNOWN is the zero value of the Status enum. It's not a valid status. + UNKNOWN = 0; + + // UNUSED denotes that this range is unclaimed by any cluster. + UNUSED = 1; + + // IN_USE_SERVICE denotes that this range is claimed by cluster(s) for + // services. User-managed services range can be shared between clusters + // within the same subnetwork. + IN_USE_SERVICE = 2; + + // 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_SHAREABLE_POD = 3; + + // IN_USE_MANAGED_POD denotes this range was created by GKE and is claimed + // for pods. It cannot be used for other clusters. + IN_USE_MANAGED_POD = 4; + } + + // The name associated with this subnetwork secondary range, used when adding + // an alias IP range to a VM instance. + string range_name = 1; + + // The range of IP addresses belonging to this subnetwork secondary range. + string ip_cidr_range = 2; + + // This field is to determine the status of the secondary range programmably. + Status status = 3; +} + +// UsableSubnetwork resource returns the subnetwork name, its associated network +// and the primary CIDR range. +message UsableSubnetwork { + // Subnetwork Name. + // Example: projects/my-project/regions/us-central1/subnetworks/my-subnet + string subnetwork = 1; + + // Network Name. + // Example: projects/my-project/global/networks/my-network + string network = 2; + + // The range of internal addresses that are owned by this subnetwork. + string ip_cidr_range = 3; + + // Secondary IP ranges. + repeated UsableSubnetworkSecondaryRange secondary_ip_ranges = 4; + + // 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. + string status_message = 5; +} + +// Configuration for exporting cluster resource usages. +message ResourceUsageExportConfig { + // Parameters for using BigQuery as the destination of resource usage export. + message BigQueryDestination { + // The ID of a BigQuery Dataset. + string dataset_id = 1; + } + + // Parameters for controlling consumption metering. + message ConsumptionMeteringConfig { + // Whether to enable consumption metering for this cluster. If enabled, a + // second BigQuery table will be created to hold resource consumption + // records. + bool enabled = 1; + } + + // Configuration to use BigQuery as usage export destination. + BigQueryDestination bigquery_destination = 1; + + // Whether to enable network egress metering for this cluster. If enabled, a + // daemonset will be created in the cluster to meter network egress traffic. + bool enable_network_egress_metering = 2; + + // Configuration to enable resource consumption metering. + ConsumptionMeteringConfig consumption_metering_config = 3; +} + +// VerticalPodAutoscaling contains global, per-cluster information +// required by Vertical Pod Autoscaler to automatically adjust +// the resources of pods controlled by it. +message VerticalPodAutoscaling { + // Enables vertical pod autoscaling. + bool enabled = 1; +} + +// DefaultSnatStatus contains the desired state of whether default sNAT should +// be disabled on the cluster. +message DefaultSnatStatus { + // Disables cluster default sNAT rules. + bool disabled = 1; +} + +// Configuration of Shielded Nodes feature. +message ShieldedNodes { + // Whether Shielded Nodes features are enabled on all nodes in this cluster. + bool enabled = 1; +} + +// Configuration of gVNIC feature. +message VirtualNIC { + // Whether gVNIC features are enabled in the node pool. + bool enabled = 1; +} + +// Configuration of Fast Socket feature. +message FastSocket { + // Whether Fast Socket features are enabled in the node pool. + bool enabled = 1; +} + +// PrivateIPv6GoogleAccess controls whether and how the pods can communicate +// with Google Services through gRPC over IPv6. +enum PrivateIPv6GoogleAccess { + // Default value. Same as DISABLED + PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0; + + // No private access to or from Google Services + PRIVATE_IPV6_GOOGLE_ACCESS_DISABLED = 1; + + // Enables private IPv6 access to Google Services from GKE + PRIVATE_IPV6_GOOGLE_ACCESS_TO_GOOGLE = 2; + + // Enables private IPv6 access to and from Google Services + PRIVATE_IPV6_GOOGLE_ACCESS_BIDIRECTIONAL = 3; +} + +// NotificationConfig is the configuration of notifications. +message NotificationConfig { + // Types of notifications currently supported. Can be used to filter what + // notifications are sent. + enum EventType { + // Not set, will be ignored. + EVENT_TYPE_UNSPECIFIED = 0; + + // Corresponds with UpgradeAvailableEvent. + UPGRADE_AVAILABLE_EVENT = 1; + + // Corresponds with UpgradeEvent. + UPGRADE_EVENT = 2; + + // Corresponds with SecurityBulletinEvent. + SECURITY_BULLETIN_EVENT = 3; + } + + // Pub/Sub specific notification config. + message PubSub { + // Enable notifications for Pub/Sub. + bool enabled = 1; + + // The desired Pub/Sub topic to which notifications will be + // sent by GKE. Format is `projects/{project}/topics/{topic}`. + string topic = 2 [ + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; + + // Allows filtering to one or more specific event types. If no filter is + // specified, or if a filter is specified with no event types, all event + // types will be sent + Filter filter = 3; + } + + // Allows filtering to one or more specific event types. If event types are + // present, those and only those event types will be transmitted to the + // cluster. Other types will be skipped. If no filter is specified, or no + // event types are present, all event types will be sent + message Filter { + // Event types to allowlist. + repeated EventType event_type = 1; + } + + // Notification config for Pub/Sub. + PubSub pubsub = 1; +} + +// ConfidentialNodes is configuration for the confidential nodes feature, which +// makes nodes run on confidential VMs. +message ConfidentialNodes { + // Whether Confidential Nodes feature is enabled. + bool enabled = 1; +} + +// UpgradeResourceType is the resource type that is upgrading. It is used +// in upgrade notifications. +enum UpgradeResourceType { + // Default value. This shouldn't be used. + UPGRADE_RESOURCE_TYPE_UNSPECIFIED = 0; + + // Master / control plane + MASTER = 1; + + // Node pool + NODE_POOL = 2; +} + +// UpgradeEvent is a notification sent to customers by the cluster server when +// a resource is upgrading. +message UpgradeEvent { + // The resource type that is upgrading. + UpgradeResourceType resource_type = 1; + + // The operation associated with this upgrade. + string operation = 2; + + // The time when the operation was started. + google.protobuf.Timestamp operation_start_time = 3; + + // The current version before the upgrade. + string current_version = 4; + + // The target version for the upgrade. + string target_version = 5; + + // Optional relative path to the resource. For example in node pool upgrades, + // the relative path of the node pool. + string resource = 6; +} + +// UpgradeAvailableEvent is a notification sent to customers when a new +// available version is released. +message UpgradeAvailableEvent { + // The release version available for upgrade. + string version = 1; + + // The resource type of the release version. + UpgradeResourceType resource_type = 2; + + // The release channel of the version. If empty, it means a non-channel + // release. + ReleaseChannel release_channel = 3; + + // Optional relative path to the resource. For example, the relative path of + // the node pool. + string resource = 4; +} + +// SecurityBulletinEvent is a notification sent to customers when a security +// bulletin has been posted that they are vulnerable to. +message SecurityBulletinEvent { + // The resource type (node/control plane) that has the vulnerability. Multiple + // notifications (1 notification per resource type) will be sent for a + // vulnerability that affects > 1 resource type. + string resource_type_affected = 1; + + // The ID of the bulletin corresponding to the vulnerability. + string bulletin_id = 2; + + // The CVEs associated with this bulletin. + repeated string cve_ids = 3; + + // The severity of this bulletin as it relates to GKE. + string severity = 4; + + // The URI link to the bulletin on the website for more information. + string bulletin_uri = 5; + + // A brief description of the bulletin. See the bulletin pointed to by the + // bulletin_uri field for an expanded description. + string brief_description = 6; + + // The GKE minor versions affected by this vulnerability. + repeated string affected_supported_minors = 7; + + // The GKE versions where this vulnerability is patched. + repeated string patched_versions = 8; + + // This represents a version selected from the patched_versions field that + // the cluster receiving this notification should most likely want to upgrade + // to based on its current version. Note that if this notification is being + // received by a given cluster, it means that this version is currently + // available as an upgrade target in that cluster's location. + string suggested_upgrade_target = 9; + + // If this field is specified, it means there are manual steps that the user + // must take to make their clusters safe. + bool manual_steps_required = 10; +} + +// Autopilot is the configuration for Autopilot settings on the cluster. +message Autopilot { + // Enable Autopilot + bool enabled = 1; + + // Workload policy configuration for Autopilot. + WorkloadPolicyConfig workload_policy_config = 2; +} + +// WorkloadPolicyConfig is the configuration of workload policy for autopilot +// clusters. +message WorkloadPolicyConfig { + // If true, workloads can use NET_ADMIN capability. + optional bool allow_net_admin = 1; +} + +// LoggingConfig is cluster logging configuration. +message LoggingConfig { + // Logging components configuration + LoggingComponentConfig component_config = 1; +} + +// LoggingComponentConfig is cluster logging component configuration. +message LoggingComponentConfig { + // GKE components exposing logs + enum Component { + // Default value. This shouldn't be used. + COMPONENT_UNSPECIFIED = 0; + + // system components + SYSTEM_COMPONENTS = 1; + + // workloads + WORKLOADS = 2; + + // kube-apiserver + APISERVER = 3; + + // kube-scheduler + SCHEDULER = 4; + + // kube-controller-manager + CONTROLLER_MANAGER = 5; + } + + // Select components to collect logs. An empty set would disable all logging. + repeated Component enable_components = 1; +} + +// MonitoringConfig is cluster monitoring configuration. +message MonitoringConfig { + // Monitoring components configuration + MonitoringComponentConfig component_config = 1; + + // Enable Google Cloud Managed Service for Prometheus + // in the cluster. + ManagedPrometheusConfig managed_prometheus_config = 2; +} + +// NodePoolLoggingConfig specifies logging configuration for nodepools. +message NodePoolLoggingConfig { + // Logging variant configuration. + LoggingVariantConfig variant_config = 1; +} + +// LoggingVariantConfig specifies the behaviour of the logging component. +message LoggingVariantConfig { + // Logging component variants. + enum Variant { + // Default value. This shouldn't be used. + VARIANT_UNSPECIFIED = 0; + + // default logging variant. + DEFAULT = 1; + + // maximum logging throughput variant. + MAX_THROUGHPUT = 2; + } + + // Logging variant deployed on nodes. + Variant variant = 1; +} + +// MonitoringComponentConfig is cluster monitoring component configuration. +message MonitoringComponentConfig { + // GKE components exposing metrics + enum Component { + // Default value. This shouldn't be used. + COMPONENT_UNSPECIFIED = 0; + + // system components + SYSTEM_COMPONENTS = 1; + + // kube-apiserver + APISERVER = 3; + + // kube-scheduler + SCHEDULER = 4; + + // kube-controller-manager + CONTROLLER_MANAGER = 5; + } + + // Select components to collect metrics. An empty set would disable all + // monitoring. + repeated Component enable_components = 1; +} + +// The datapath provider selects the implementation of the Kubernetes networking +// model for service resolution and network policy enforcement. +enum DatapathProvider { + // Default value. + DATAPATH_PROVIDER_UNSPECIFIED = 0; + + // Use the IPTables implementation based on kube-proxy. + LEGACY_DATAPATH = 1; + + // Use the eBPF based GKE Dataplane V2 with additional features. See the [GKE + // Dataplane V2 + // documentation](https://cloud.google.com/kubernetes-engine/docs/how-to/dataplane-v2) + // for more. + ADVANCED_DATAPATH = 2; +} + +// Strategy used for node pool update. +enum NodePoolUpdateStrategy { + // Default value if unset. GKE internally defaults the update strategy to + // SURGE for unspecified strategies. + NODE_POOL_UPDATE_STRATEGY_UNSPECIFIED = 0; + + // blue-green upgrade. + BLUE_GREEN = 2; + + // SURGE is the traditional way of upgrade a node pool. + // max_surge and max_unavailable determines the level of upgrade parallelism. + SURGE = 3; +} + +// ManagedPrometheusConfig defines the configuration for +// Google Cloud Managed Service for Prometheus. +message ManagedPrometheusConfig { + // Enable Managed Collection. + bool enabled = 1; +} + +// Fleet is the fleet configuration for the cluster. +message Fleet { + // The Fleet host project(project ID or project number) where this cluster + // will be registered to. This field cannot be changed after the cluster has + // been registered. + string project = 1; + + // [Output only] The full resource name of the registered fleet membership of + // the cluster, in the format + // `//gkehub.googleapis.com/projects/*/locations/*/memberships/*`. + string membership = 2; + + // [Output only] Whether the cluster has been registered through the fleet + // API. + bool pre_registered = 3; +} + +// Possible values for IP stack type +enum StackType { + // Default value, will be defaulted as IPV4 only + STACK_TYPE_UNSPECIFIED = 0; + + // Cluster is IPV4 only + IPV4 = 1; + + // Cluster can use both IPv4 and IPv6 + IPV4_IPV6 = 2; +} + +// Possible values for IPv6 access type +enum IPv6AccessType { + // Default value, will be defaulted as type external. + IPV6_ACCESS_TYPE_UNSPECIFIED = 0; + + // Access type internal (all v6 addresses are internal IPs) + INTERNAL = 1; + + // Access type external (all v6 addresses are external IPs) + EXTERNAL = 2; +} + +// LocalNvmeSsdBlockConfig contains configuration for using raw-block local +// NVMe SSD. +message LocalNvmeSsdBlockConfig { + // The number of raw-block local NVMe SSD disks to be attached to the node. + // Each local SSD is 375 GB in size. If zero, it means no raw-block local NVMe + // 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. + int32 local_ssd_count = 1; +} + +// EphemeralStorageLocalSsdConfig contains configuration for the node ephemeral +// storage using Local SSD. +message EphemeralStorageLocalSsdConfig { + // Number of local SSDs to use to back ephemeral storage. Uses NVMe + // interfaces. Each local SSD is 375 GB in size. + // If zero, it means to disable using local SSDs as ephemeral storage. + // 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. + int32 local_ssd_count = 1; +} diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.cancel_operation.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.cancel_operation.js new file mode 100644 index 00000000000..e556c2aaf76 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.cancel_operation.js @@ -0,0 +1,61 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_CancelOperation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, operation id) of the operation to cancel. + * Specified in the format `projects/* /locations/* /operations/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCancelOperation() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.cancelOperation(request); + console.log(response); + } + + callCancelOperation(); + // [END container_v1_generated_ClusterManager_CancelOperation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js new file mode 100644 index 00000000000..e4d731fc2d0 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js @@ -0,0 +1,61 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_CheckAutopilotCompatibility_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster) of the cluster to retrieve. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCheckAutopilotCompatibility() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.checkAutopilotCompatibility(request); + console.log(response); + } + + callCheckAutopilotCompatibility(); + // [END container_v1_generated_ClusterManager_CheckAutopilotCompatibility_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_i_p_rotation.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_i_p_rotation.js new file mode 100644 index 00000000000..82b71531860 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_i_p_rotation.js @@ -0,0 +1,61 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_CompleteIPRotation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster name) of the cluster to complete IP + * rotation. Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCompleteIPRotation() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.completeIPRotation(request); + console.log(response); + } + + callCompleteIPRotation(); + // [END container_v1_generated_ClusterManager_CompleteIPRotation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js new file mode 100644 index 00000000000..8cf74642faf --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js @@ -0,0 +1,62 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_CompleteNodePoolUpgrade_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster, node pool id) of the node pool to + * complete upgrade. + * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCompleteNodePoolUpgrade() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.completeNodePoolUpgrade(request); + console.log(response); + } + + callCompleteNodePoolUpgrade(); + // [END container_v1_generated_ClusterManager_CompleteNodePoolUpgrade_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_cluster.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_cluster.js new file mode 100644 index 00000000000..bc132fbb109 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_cluster.js @@ -0,0 +1,67 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(cluster) { + // [START container_v1_generated_ClusterManager_CreateCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A cluster + * resource (https://cloud.google.com/container-engine/reference/rest/v1/projects.locations.clusters) + */ + // const cluster = {} + /** + * The parent (project and location) where the cluster will be created. + * Specified in the format `projects/* /locations/*`. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCreateCluster() { + // Construct request + const request = { + cluster, + }; + + // Run request + const response = await containerClient.createCluster(request); + console.log(response); + } + + callCreateCluster(); + // [END container_v1_generated_ClusterManager_CreateCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_node_pool.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_node_pool.js new file mode 100644 index 00000000000..c2526e72425 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_node_pool.js @@ -0,0 +1,67 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(nodePool) { + // [START container_v1_generated_ClusterManager_CreateNodePool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The node pool to create. + */ + // const nodePool = {} + /** + * The parent (project, location, cluster name) where the node pool will be + * created. Specified in the format + * `projects/* /locations/* /clusters/*`. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCreateNodePool() { + // Construct request + const request = { + nodePool, + }; + + // Run request + const response = await containerClient.createNodePool(request); + console.log(response); + } + + callCreateNodePool(); + // [END container_v1_generated_ClusterManager_CreateNodePool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_cluster.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_cluster.js new file mode 100644 index 00000000000..b7f789d7b80 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_cluster.js @@ -0,0 +1,61 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_DeleteCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster) of the cluster to delete. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callDeleteCluster() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.deleteCluster(request); + console.log(response); + } + + callDeleteCluster(); + // [END container_v1_generated_ClusterManager_DeleteCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_node_pool.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_node_pool.js new file mode 100644 index 00000000000..1d286e9963b --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_node_pool.js @@ -0,0 +1,62 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_DeleteNodePool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster, node pool id) of the node pool to + * delete. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callDeleteNodePool() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.deleteNodePool(request); + console.log(response); + } + + callDeleteNodePool(); + // [END container_v1_generated_ClusterManager_DeleteNodePool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_cluster.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_cluster.js new file mode 100644 index 00000000000..565479929b5 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_cluster.js @@ -0,0 +1,61 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_GetCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster) of the cluster to retrieve. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callGetCluster() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.getCluster(request); + console.log(response); + } + + callGetCluster(); + // [END container_v1_generated_ClusterManager_GetCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_j_s_o_n_web_keys.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_j_s_o_n_web_keys.js new file mode 100644 index 00000000000..ce76d378ce1 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_j_s_o_n_web_keys.js @@ -0,0 +1,61 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_GetJSONWebKeys_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The cluster (project, location, cluster name) to get keys for. Specified in + * the format `projects/* /locations/* /clusters/*`. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callGetJSONWebKeys() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.getJSONWebKeys(request); + console.log(response); + } + + callGetJSONWebKeys(); + // [END container_v1_generated_ClusterManager_GetJSONWebKeys_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_node_pool.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_node_pool.js new file mode 100644 index 00000000000..fb3301234b1 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_node_pool.js @@ -0,0 +1,62 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_GetNodePool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster, node pool id) of the node pool to + * get. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callGetNodePool() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.getNodePool(request); + console.log(response); + } + + callGetNodePool(); + // [END container_v1_generated_ClusterManager_GetNodePool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_operation.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_operation.js new file mode 100644 index 00000000000..58a774ae645 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_operation.js @@ -0,0 +1,61 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_GetOperation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, operation id) of the operation to get. + * Specified in the format `projects/* /locations/* /operations/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callGetOperation() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.getOperation(request); + console.log(response); + } + + callGetOperation(); + // [END container_v1_generated_ClusterManager_GetOperation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_server_config.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_server_config.js new file mode 100644 index 00000000000..6a1e2ef0e69 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_server_config.js @@ -0,0 +1,61 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_GetServerConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project and location) of the server config to get, + * specified in the format `projects/* /locations/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callGetServerConfig() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.getServerConfig(request); + console.log(response); + } + + callGetServerConfig(); + // [END container_v1_generated_ClusterManager_GetServerConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_clusters.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_clusters.js new file mode 100644 index 00000000000..fb7dbc835b2 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_clusters.js @@ -0,0 +1,62 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_ListClusters_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The parent (project and location) where the clusters will be listed. + * Specified in the format `projects/* /locations/*`. + * Location "-" matches all zones and all regions. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callListClusters() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.listClusters(request); + console.log(response); + } + + callListClusters(); + // [END container_v1_generated_ClusterManager_ListClusters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_node_pools.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_node_pools.js new file mode 100644 index 00000000000..fa48c06009a --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_node_pools.js @@ -0,0 +1,61 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_ListNodePools_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The parent (project, location, cluster name) where the node pools will be + * listed. Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callListNodePools() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.listNodePools(request); + console.log(response); + } + + callListNodePools(); + // [END container_v1_generated_ClusterManager_ListNodePools_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_operations.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_operations.js new file mode 100644 index 00000000000..69eb1730393 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_operations.js @@ -0,0 +1,62 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_ListOperations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The parent (project and location) where the operations will be listed. + * Specified in the format `projects/* /locations/*`. + * Location "-" matches all zones and all regions. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callListOperations() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.listOperations(request); + console.log(response); + } + + callListOperations(); + // [END container_v1_generated_ClusterManager_ListOperations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_usable_subnetworks.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_usable_subnetworks.js new file mode 100644 index 00000000000..a70af157bf3 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_usable_subnetworks.js @@ -0,0 +1,82 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_ListUsableSubnetworks_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The parent project where subnetworks are usable. + * Specified in the format `projects/*`. + */ + // const parent = 'abc123' + /** + * 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. + */ + // const filter = 'abc123' + /** + * 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) + */ + // const pageSize = 1234 + /** + * Specifies a page token to use. Set this to the nextPageToken returned by + * previous list requests to get the next page of results. + */ + // const pageToken = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callListUsableSubnetworks() { + // Construct request + const request = { + }; + + // Run request + const iterable = await containerClient.listUsableSubnetworksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListUsableSubnetworks(); + // [END container_v1_generated_ClusterManager_ListUsableSubnetworks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.rollback_node_pool_upgrade.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.rollback_node_pool_upgrade.js new file mode 100644 index 00000000000..3356c397660 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.rollback_node_pool_upgrade.js @@ -0,0 +1,67 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_RollbackNodePoolUpgrade_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster, node pool id) of the node poll to + * rollback upgrade. + * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + /** + * Option for rollback to ignore the PodDisruptionBudget. + * Default value is false. + */ + // const respectPdb = true + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callRollbackNodePoolUpgrade() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.rollbackNodePoolUpgrade(request); + console.log(response); + } + + callRollbackNodePoolUpgrade(); + // [END container_v1_generated_ClusterManager_RollbackNodePoolUpgrade_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_addons_config.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_addons_config.js new file mode 100644 index 00000000000..c6e24e63456 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_addons_config.js @@ -0,0 +1,67 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(addonsConfig) { + // [START container_v1_generated_ClusterManager_SetAddonsConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The desired configurations for the various addons available to + * run in the cluster. + */ + // const addonsConfig = {} + /** + * The name (project, location, cluster) of the cluster to set addons. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetAddonsConfig() { + // Construct request + const request = { + addonsConfig, + }; + + // Run request + const response = await containerClient.setAddonsConfig(request); + console.log(response); + } + + callSetAddonsConfig(); + // [END container_v1_generated_ClusterManager_SetAddonsConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_labels.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_labels.js new file mode 100644 index 00000000000..dd281c82cc6 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_labels.js @@ -0,0 +1,76 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resourceLabels, labelFingerprint) { + // [START container_v1_generated_ClusterManager_SetLabels_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The labels to set for that cluster. + */ + // const resourceLabels = 1234 + /** + * 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. + */ + // const labelFingerprint = 'abc123' + /** + * The name (project, location, cluster name) of the cluster to set labels. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetLabels() { + // Construct request + const request = { + resourceLabels, + labelFingerprint, + }; + + // Run request + const response = await containerClient.setLabels(request); + console.log(response); + } + + callSetLabels(); + // [END container_v1_generated_ClusterManager_SetLabels_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_legacy_abac.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_legacy_abac.js new file mode 100644 index 00000000000..9c2a450c361 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_legacy_abac.js @@ -0,0 +1,66 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(enabled) { + // [START container_v1_generated_ClusterManager_SetLegacyAbac_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Whether ABAC authorization will be enabled in the cluster. + */ + // const enabled = true + /** + * The name (project, location, cluster name) of the cluster to set legacy + * abac. Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetLegacyAbac() { + // Construct request + const request = { + enabled, + }; + + // Run request + const response = await containerClient.setLegacyAbac(request); + console.log(response); + } + + callSetLegacyAbac(); + // [END container_v1_generated_ClusterManager_SetLegacyAbac_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_locations.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_locations.js new file mode 100644 index 00000000000..a5f7a5f0349 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_locations.js @@ -0,0 +1,71 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(locations) { + // [START container_v1_generated_ClusterManager_SetLocations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The desired list of Google Compute Engine + * zones (https://cloud.google.com/compute/docs/zones#available) 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. + */ + // const locations = 'abc123' + /** + * The name (project, location, cluster) of the cluster to set locations. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetLocations() { + // Construct request + const request = { + locations, + }; + + // Run request + const response = await containerClient.setLocations(request); + console.log(response); + } + + callSetLocations(); + // [END container_v1_generated_ClusterManager_SetLocations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_logging_service.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_logging_service.js new file mode 100644 index 00000000000..3333d0219c5 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_logging_service.js @@ -0,0 +1,74 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(loggingService) { + // [START container_v1_generated_ClusterManager_SetLoggingService_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The logging service the cluster should use to write logs. + * Currently available options: + * * `logging.googleapis.com/kubernetes` - The Cloud Logging + * service with a Kubernetes-native resource model + * * `logging.googleapis.com` - The legacy Cloud Logging service (no longer + * available as of GKE 1.15). + * * `none` - no logs will be exported from the cluster. + * If left as an empty string,`logging.googleapis.com/kubernetes` will be + * used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. + */ + // const loggingService = 'abc123' + /** + * The name (project, location, cluster) of the cluster to set logging. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetLoggingService() { + // Construct request + const request = { + loggingService, + }; + + // Run request + const response = await containerClient.setLoggingService(request); + console.log(response); + } + + callSetLoggingService(); + // [END container_v1_generated_ClusterManager_SetLoggingService_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_maintenance_policy.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_maintenance_policy.js new file mode 100644 index 00000000000..4e675414de2 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_maintenance_policy.js @@ -0,0 +1,86 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, maintenancePolicy) { + // [START container_v1_generated_ClusterManager_SetMaintenancePolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The Google Developers Console project ID or project + * number (https://cloud.google.com/resource-manager/docs/creating-managing-projects). + */ + // const projectId = 'abc123' + /** + * Required. The name of the Google Compute Engine + * zone (https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. + */ + // const zone = 'abc123' + /** + * Required. The name of the cluster to update. + */ + // const clusterId = 'abc123' + /** + * Required. The maintenance policy to be set for the cluster. An empty field + * clears the existing maintenance policy. + */ + // const maintenancePolicy = {} + /** + * The name (project, location, cluster name) of the cluster to set + * maintenance policy. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetMaintenancePolicy() { + // Construct request + const request = { + projectId, + zone, + clusterId, + maintenancePolicy, + }; + + // Run request + const response = await containerClient.setMaintenancePolicy(request); + console.log(response); + } + + callSetMaintenancePolicy(); + // [END container_v1_generated_ClusterManager_SetMaintenancePolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_master_auth.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_master_auth.js new file mode 100644 index 00000000000..4376ebb1adc --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_master_auth.js @@ -0,0 +1,71 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(action, update) { + // [START container_v1_generated_ClusterManager_SetMasterAuth_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The exact form of action to be taken on the master auth. + */ + // const action = {} + /** + * Required. A description of the update. + */ + // const update = {} + /** + * The name (project, location, cluster) of the cluster to set auth. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetMasterAuth() { + // Construct request + const request = { + action, + update, + }; + + // Run request + const response = await containerClient.setMasterAuth(request); + console.log(response); + } + + callSetMasterAuth(); + // [END container_v1_generated_ClusterManager_SetMasterAuth_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_monitoring_service.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_monitoring_service.js new file mode 100644 index 00000000000..5767da6da8f --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_monitoring_service.js @@ -0,0 +1,74 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(monitoringService) { + // [START container_v1_generated_ClusterManager_SetMonitoringService_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The monitoring service the cluster should use to write metrics. + * Currently available options: + * * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring + * service with a Kubernetes-native resource model + * * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no + * longer available as of GKE 1.15). + * * `none` - No metrics will be exported from the cluster. + * If left as an empty string,`monitoring.googleapis.com/kubernetes` will be + * used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. + */ + // const monitoringService = 'abc123' + /** + * The name (project, location, cluster) of the cluster to set monitoring. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetMonitoringService() { + // Construct request + const request = { + monitoringService, + }; + + // Run request + const response = await containerClient.setMonitoringService(request); + console.log(response); + } + + callSetMonitoringService(); + // [END container_v1_generated_ClusterManager_SetMonitoringService_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_network_policy.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_network_policy.js new file mode 100644 index 00000000000..70e4a954cd3 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_network_policy.js @@ -0,0 +1,66 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(networkPolicy) { + // [START container_v1_generated_ClusterManager_SetNetworkPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Configuration options for the NetworkPolicy feature. + */ + // const networkPolicy = {} + /** + * The name (project, location, cluster name) of the cluster to set networking + * policy. Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetNetworkPolicy() { + // Construct request + const request = { + networkPolicy, + }; + + // Run request + const response = await containerClient.setNetworkPolicy(request); + console.log(response); + } + + callSetNetworkPolicy(); + // [END container_v1_generated_ClusterManager_SetNetworkPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_autoscaling.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_autoscaling.js new file mode 100644 index 00000000000..fde99e8483c --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_autoscaling.js @@ -0,0 +1,67 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(autoscaling) { + // [START container_v1_generated_ClusterManager_SetNodePoolAutoscaling_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Autoscaling configuration for the node pool. + */ + // const autoscaling = {} + /** + * The name (project, location, cluster, node pool) of the node pool to set + * autoscaler settings. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetNodePoolAutoscaling() { + // Construct request + const request = { + autoscaling, + }; + + // Run request + const response = await containerClient.setNodePoolAutoscaling(request); + console.log(response); + } + + callSetNodePoolAutoscaling(); + // [END container_v1_generated_ClusterManager_SetNodePoolAutoscaling_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_management.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_management.js new file mode 100644 index 00000000000..e1ea4030588 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_management.js @@ -0,0 +1,67 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(management) { + // [START container_v1_generated_ClusterManager_SetNodePoolManagement_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. NodeManagement configuration for the node pool. + */ + // const management = {} + /** + * The name (project, location, cluster, node pool id) of the node pool to set + * management properties. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetNodePoolManagement() { + // Construct request + const request = { + management, + }; + + // Run request + const response = await containerClient.setNodePoolManagement(request); + console.log(response); + } + + callSetNodePoolManagement(); + // [END container_v1_generated_ClusterManager_SetNodePoolManagement_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_size.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_size.js new file mode 100644 index 00000000000..aedfdd9f71b --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_size.js @@ -0,0 +1,67 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(nodeCount) { + // [START container_v1_generated_ClusterManager_SetNodePoolSize_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The desired node count for the pool. + */ + // const nodeCount = 1234 + /** + * The name (project, location, cluster, node pool id) of the node pool to set + * size. + * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetNodePoolSize() { + // Construct request + const request = { + nodeCount, + }; + + // Run request + const response = await containerClient.setNodePoolSize(request); + console.log(response); + } + + callSetNodePoolSize(); + // [END container_v1_generated_ClusterManager_SetNodePoolSize_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.start_i_p_rotation.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.start_i_p_rotation.js new file mode 100644 index 00000000000..a8f65196353 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.start_i_p_rotation.js @@ -0,0 +1,65 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_StartIPRotation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster name) of the cluster to start IP + * rotation. Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + /** + * Whether to rotate credentials during IP rotation. + */ + // const rotateCredentials = true + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callStartIPRotation() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.startIPRotation(request); + console.log(response); + } + + callStartIPRotation(); + // [END container_v1_generated_ClusterManager_StartIPRotation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_cluster.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_cluster.js new file mode 100644 index 00000000000..b0280b7fea6 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_cluster.js @@ -0,0 +1,66 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(update) { + // [START container_v1_generated_ClusterManager_UpdateCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A description of the update. + */ + // const update = {} + /** + * The name (project, location, cluster) of the cluster to update. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callUpdateCluster() { + // Construct request + const request = { + update, + }; + + // Run request + const response = await containerClient.updateCluster(request); + console.log(response); + } + + callUpdateCluster(); + // [END container_v1_generated_ClusterManager_UpdateCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_master.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_master.js new file mode 100644 index 00000000000..37f555312f8 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_master.js @@ -0,0 +1,73 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(masterVersion) { + // [START container_v1_generated_ClusterManager_UpdateMaster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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 + */ + // const masterVersion = 'abc123' + /** + * The name (project, location, cluster) of the cluster to update. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callUpdateMaster() { + // Construct request + const request = { + masterVersion, + }; + + // Run request + const response = await containerClient.updateMaster(request); + console.log(response); + } + + callUpdateMaster(); + // [END container_v1_generated_ClusterManager_UpdateMaster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_node_pool.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_node_pool.js new file mode 100644 index 00000000000..10715ac0d85 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_node_pool.js @@ -0,0 +1,164 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(nodeVersion, imageType) { + // [START container_v1_generated_ClusterManager_UpdateNodePool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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 + */ + // const nodeVersion = 'abc123' + /** + * Required. The desired image type for the node pool. Please see + * https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for + * available image types. + */ + // const imageType = 'abc123' + /** + * The name (project, location, cluster, node pool) of the node pool to + * update. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + /** + * The desired list of Google Compute Engine + * zones (https://cloud.google.com/compute/docs/zones#available) in which the + * node pool's nodes should be located. Changing the locations for a node pool + * will result in nodes being either created or removed from the node pool, + * depending on whether locations are being added or removed. + */ + // const locations = 'abc123' + /** + * The desired workload metadata config for the node pool. + */ + // const workloadMetadataConfig = {} + /** + * Upgrade settings control disruption and speed of the upgrade. + */ + // const upgradeSettings = {} + /** + * The desired network tags to be applied to all nodes in the node pool. + * If this field is not present, the tags will not be changed. Otherwise, + * the existing network tags will be *replaced* with the provided tags. + */ + // const tags = {} + /** + * The desired node taints to be applied to all nodes in the node pool. + * If this field is not present, the taints will not be changed. Otherwise, + * the existing node taints will be *replaced* with the provided taints. + */ + // const taints = {} + /** + * The desired node labels to be applied to all nodes in the node pool. + * If this field is not present, the labels will not be changed. Otherwise, + * the existing node labels will be *replaced* with the provided labels. + */ + // const labels = {} + /** + * Parameters that can be configured on Linux nodes. + */ + // const linuxNodeConfig = {} + /** + * Node kubelet configs. + */ + // const kubeletConfig = {} + /** + * Node network config. + */ + // const nodeNetworkConfig = {} + /** + * GCFS config. + */ + // const gcfsConfig = {} + /** + * Confidential nodes config. + * All the nodes in the node pool will be Confidential VM once enabled. + */ + // const confidentialNodes = {} + /** + * Enable or disable gvnic on the node pool. + */ + // const gvnic = {} + /** + * The current etag of the node pool. + * If an etag is provided and does not match the current etag of the node + * pool, update will be blocked and an ABORTED error will be returned. + */ + // const etag = 'abc123' + /** + * Enable or disable NCCL fast socket for the node pool. + */ + // const fastSocket = {} + /** + * Logging configuration. + */ + // const loggingConfig = {} + /** + * The resource labels for the node pool to use to annotate any related + * Google Compute Engine resources. + */ + // const resourceLabels = {} + /** + * Parameters that can be configured on Windows nodes. + */ + // const windowsNodeConfig = {} + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callUpdateNodePool() { + // Construct request + const request = { + nodeVersion, + imageType, + }; + + // Run request + const response = await containerClient.updateNodePool(request); + console.log(response); + } + + callUpdateNodePool(); + // [END container_v1_generated_ClusterManager_UpdateNodePool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/snippet_metadata.google.container.v1.json b/owl-bot-staging/google-container/v1/samples/generated/v1/snippet_metadata.google.container.v1.json new file mode 100644 index 00000000000..66a864e5ad7 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/snippet_metadata.google.container.v1.json @@ -0,0 +1,1915 @@ +{ + "clientLibrary": { + "name": "nodejs-container", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.container.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "container_v1_generated_ClusterManager_ListClusters_async", + "title": "ClusterManager listClusters Sample", + "origin": "API_DEFINITION", + "description": " Lists all clusters owned by a project in either the specified zone or all zones.", + "canonical": true, + "file": "cluster_manager.list_clusters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListClusters", + "fullName": "google.container.v1.ClusterManager.ListClusters", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.ListClustersResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "ListClusters", + "fullName": "google.container.v1.ClusterManager.ListClusters", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_GetCluster_async", + "title": "ClusterManager getCluster Sample", + "origin": "API_DEFINITION", + "description": " Gets the details of a specific cluster.", + "canonical": true, + "file": "cluster_manager.get_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCluster", + "fullName": "google.container.v1.ClusterManager.GetCluster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Cluster", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "GetCluster", + "fullName": "google.container.v1.ClusterManager.GetCluster", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_CreateCluster_async", + "title": "ClusterManager createCluster Sample", + "origin": "API_DEFINITION", + "description": " 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](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). 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.", + "canonical": true, + "file": "cluster_manager.create_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCluster", + "fullName": "google.container.v1.ClusterManager.CreateCluster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster", + "type": ".google.container.v1.Cluster" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "CreateCluster", + "fullName": "google.container.v1.ClusterManager.CreateCluster", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_UpdateCluster_async", + "title": "ClusterManager updateCluster Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a specific cluster.", + "canonical": true, + "file": "cluster_manager.update_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCluster", + "fullName": "google.container.v1.ClusterManager.UpdateCluster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "update", + "type": ".google.container.v1.ClusterUpdate" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "UpdateCluster", + "fullName": "google.container.v1.ClusterManager.UpdateCluster", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_UpdateNodePool_async", + "title": "ClusterManager updateNodePool Sample", + "origin": "API_DEFINITION", + "description": " Updates the version and/or image type for the specified node pool.", + "canonical": true, + "file": "cluster_manager.update_node_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 156, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateNodePool", + "fullName": "google.container.v1.ClusterManager.UpdateNodePool", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "node_version", + "type": "TYPE_STRING" + }, + { + "name": "image_type", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "locations", + "type": "TYPE_STRING[]" + }, + { + "name": "workload_metadata_config", + "type": ".google.container.v1.WorkloadMetadataConfig" + }, + { + "name": "upgrade_settings", + "type": ".google.container.v1.NodePool.UpgradeSettings" + }, + { + "name": "tags", + "type": ".google.container.v1.NetworkTags" + }, + { + "name": "taints", + "type": ".google.container.v1.NodeTaints" + }, + { + "name": "labels", + "type": ".google.container.v1.NodeLabels" + }, + { + "name": "linux_node_config", + "type": ".google.container.v1.LinuxNodeConfig" + }, + { + "name": "kubelet_config", + "type": ".google.container.v1.NodeKubeletConfig" + }, + { + "name": "node_network_config", + "type": ".google.container.v1.NodeNetworkConfig" + }, + { + "name": "gcfs_config", + "type": ".google.container.v1.GcfsConfig" + }, + { + "name": "confidential_nodes", + "type": ".google.container.v1.ConfidentialNodes" + }, + { + "name": "gvnic", + "type": ".google.container.v1.VirtualNIC" + }, + { + "name": "etag", + "type": "TYPE_STRING" + }, + { + "name": "fast_socket", + "type": ".google.container.v1.FastSocket" + }, + { + "name": "logging_config", + "type": ".google.container.v1.NodePoolLoggingConfig" + }, + { + "name": "resource_labels", + "type": ".google.container.v1.ResourceLabels" + }, + { + "name": "windows_node_config", + "type": ".google.container.v1.WindowsNodeConfig" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "UpdateNodePool", + "fullName": "google.container.v1.ClusterManager.UpdateNodePool", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_SetNodePoolAutoscaling_async", + "title": "ClusterManager setNodePoolAutoscaling Sample", + "origin": "API_DEFINITION", + "description": " Sets the autoscaling settings for the specified node pool.", + "canonical": true, + "file": "cluster_manager.set_node_pool_autoscaling.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetNodePoolAutoscaling", + "fullName": "google.container.v1.ClusterManager.SetNodePoolAutoscaling", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "autoscaling", + "type": ".google.container.v1.NodePoolAutoscaling" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "SetNodePoolAutoscaling", + "fullName": "google.container.v1.ClusterManager.SetNodePoolAutoscaling", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_SetLoggingService_async", + "title": "ClusterManager setLoggingService Sample", + "origin": "API_DEFINITION", + "description": " Sets the logging service for a specific cluster.", + "canonical": true, + "file": "cluster_manager.set_logging_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetLoggingService", + "fullName": "google.container.v1.ClusterManager.SetLoggingService", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "logging_service", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "SetLoggingService", + "fullName": "google.container.v1.ClusterManager.SetLoggingService", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_SetMonitoringService_async", + "title": "ClusterManager setMonitoringService Sample", + "origin": "API_DEFINITION", + "description": " Sets the monitoring service for a specific cluster.", + "canonical": true, + "file": "cluster_manager.set_monitoring_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetMonitoringService", + "fullName": "google.container.v1.ClusterManager.SetMonitoringService", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "monitoring_service", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "SetMonitoringService", + "fullName": "google.container.v1.ClusterManager.SetMonitoringService", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_SetAddonsConfig_async", + "title": "ClusterManager setAddonsConfig Sample", + "origin": "API_DEFINITION", + "description": " Sets the addons for a specific cluster.", + "canonical": true, + "file": "cluster_manager.set_addons_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetAddonsConfig", + "fullName": "google.container.v1.ClusterManager.SetAddonsConfig", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "addons_config", + "type": ".google.container.v1.AddonsConfig" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "SetAddonsConfig", + "fullName": "google.container.v1.ClusterManager.SetAddonsConfig", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_SetLocations_async", + "title": "ClusterManager setLocations Sample", + "origin": "API_DEFINITION", + "description": " Sets the locations for a specific cluster. Deprecated. Use [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update) instead.", + "canonical": true, + "file": "cluster_manager.set_locations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetLocations", + "fullName": "google.container.v1.ClusterManager.SetLocations", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "locations", + "type": "TYPE_STRING[]" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "SetLocations", + "fullName": "google.container.v1.ClusterManager.SetLocations", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_UpdateMaster_async", + "title": "ClusterManager updateMaster Sample", + "origin": "API_DEFINITION", + "description": " Updates the master for a specific cluster.", + "canonical": true, + "file": "cluster_manager.update_master.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateMaster", + "fullName": "google.container.v1.ClusterManager.UpdateMaster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "master_version", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "UpdateMaster", + "fullName": "google.container.v1.ClusterManager.UpdateMaster", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_SetMasterAuth_async", + "title": "ClusterManager setMasterAuth Sample", + "origin": "API_DEFINITION", + "description": " Sets master auth materials. Currently supports changing the admin password or a specific cluster, either via password generation or explicitly setting the password.", + "canonical": true, + "file": "cluster_manager.set_master_auth.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetMasterAuth", + "fullName": "google.container.v1.ClusterManager.SetMasterAuth", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "action", + "type": ".google.container.v1.SetMasterAuthRequest.Action" + }, + { + "name": "update", + "type": ".google.container.v1.MasterAuth" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "SetMasterAuth", + "fullName": "google.container.v1.ClusterManager.SetMasterAuth", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_DeleteCluster_async", + "title": "ClusterManager deleteCluster Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "cluster_manager.delete_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCluster", + "fullName": "google.container.v1.ClusterManager.DeleteCluster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "DeleteCluster", + "fullName": "google.container.v1.ClusterManager.DeleteCluster", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_ListOperations_async", + "title": "ClusterManager listOperations Sample", + "origin": "API_DEFINITION", + "description": " Lists all operations in a project in a specific zone or all zones.", + "canonical": true, + "file": "cluster_manager.list_operations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListOperations", + "fullName": "google.container.v1.ClusterManager.ListOperations", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.ListOperationsResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "ListOperations", + "fullName": "google.container.v1.ClusterManager.ListOperations", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_GetOperation_async", + "title": "ClusterManager getOperation Sample", + "origin": "API_DEFINITION", + "description": " Gets the specified operation.", + "canonical": true, + "file": "cluster_manager.get_operation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetOperation", + "fullName": "google.container.v1.ClusterManager.GetOperation", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "operation_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "GetOperation", + "fullName": "google.container.v1.ClusterManager.GetOperation", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_CancelOperation_async", + "title": "ClusterManager cancelOperation Sample", + "origin": "API_DEFINITION", + "description": " Cancels the specified operation.", + "canonical": true, + "file": "cluster_manager.cancel_operation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CancelOperation", + "fullName": "google.container.v1.ClusterManager.CancelOperation", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "operation_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "CancelOperation", + "fullName": "google.container.v1.ClusterManager.CancelOperation", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_GetServerConfig_async", + "title": "ClusterManager getServerConfig Sample", + "origin": "API_DEFINITION", + "description": " Returns configuration info about the Google Kubernetes Engine service.", + "canonical": true, + "file": "cluster_manager.get_server_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetServerConfig", + "fullName": "google.container.v1.ClusterManager.GetServerConfig", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.ServerConfig", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "GetServerConfig", + "fullName": "google.container.v1.ClusterManager.GetServerConfig", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_GetJSONWebKeys_async", + "title": "ClusterManager getJSONWebKeys Sample", + "origin": "API_DEFINITION", + "description": " Gets the public component of the cluster signing keys in JSON Web Key format. This API is not yet intended for general use, and is not available for all clusters.", + "canonical": true, + "file": "cluster_manager.get_j_s_o_n_web_keys.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetJSONWebKeys", + "fullName": "google.container.v1.ClusterManager.GetJSONWebKeys", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.GetJSONWebKeysResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "GetJSONWebKeys", + "fullName": "google.container.v1.ClusterManager.GetJSONWebKeys", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_ListNodePools_async", + "title": "ClusterManager listNodePools Sample", + "origin": "API_DEFINITION", + "description": " Lists the node pools for a cluster.", + "canonical": true, + "file": "cluster_manager.list_node_pools.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListNodePools", + "fullName": "google.container.v1.ClusterManager.ListNodePools", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.ListNodePoolsResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "ListNodePools", + "fullName": "google.container.v1.ClusterManager.ListNodePools", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_GetNodePool_async", + "title": "ClusterManager getNodePool Sample", + "origin": "API_DEFINITION", + "description": " Retrieves the requested node pool.", + "canonical": true, + "file": "cluster_manager.get_node_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetNodePool", + "fullName": "google.container.v1.ClusterManager.GetNodePool", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.NodePool", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "GetNodePool", + "fullName": "google.container.v1.ClusterManager.GetNodePool", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_CreateNodePool_async", + "title": "ClusterManager createNodePool Sample", + "origin": "API_DEFINITION", + "description": " Creates a node pool for a cluster.", + "canonical": true, + "file": "cluster_manager.create_node_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateNodePool", + "fullName": "google.container.v1.ClusterManager.CreateNodePool", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool", + "type": ".google.container.v1.NodePool" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "CreateNodePool", + "fullName": "google.container.v1.ClusterManager.CreateNodePool", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_DeleteNodePool_async", + "title": "ClusterManager deleteNodePool Sample", + "origin": "API_DEFINITION", + "description": " Deletes a node pool from a cluster.", + "canonical": true, + "file": "cluster_manager.delete_node_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteNodePool", + "fullName": "google.container.v1.ClusterManager.DeleteNodePool", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "DeleteNodePool", + "fullName": "google.container.v1.ClusterManager.DeleteNodePool", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_CompleteNodePoolUpgrade_async", + "title": "ClusterManager completeNodePoolUpgrade Sample", + "origin": "API_DEFINITION", + "description": " CompleteNodePoolUpgrade will signal an on-going node pool upgrade to complete.", + "canonical": true, + "file": "cluster_manager.complete_node_pool_upgrade.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CompleteNodePoolUpgrade", + "fullName": "google.container.v1.ClusterManager.CompleteNodePoolUpgrade", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "CompleteNodePoolUpgrade", + "fullName": "google.container.v1.ClusterManager.CompleteNodePoolUpgrade", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_RollbackNodePoolUpgrade_async", + "title": "ClusterManager rollbackNodePoolUpgrade Sample", + "origin": "API_DEFINITION", + "description": " Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last upgrade successfully completed.", + "canonical": true, + "file": "cluster_manager.rollback_node_pool_upgrade.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RollbackNodePoolUpgrade", + "fullName": "google.container.v1.ClusterManager.RollbackNodePoolUpgrade", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "respect_pdb", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "RollbackNodePoolUpgrade", + "fullName": "google.container.v1.ClusterManager.RollbackNodePoolUpgrade", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_SetNodePoolManagement_async", + "title": "ClusterManager setNodePoolManagement Sample", + "origin": "API_DEFINITION", + "description": " Sets the NodeManagement options for a node pool.", + "canonical": true, + "file": "cluster_manager.set_node_pool_management.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetNodePoolManagement", + "fullName": "google.container.v1.ClusterManager.SetNodePoolManagement", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "management", + "type": ".google.container.v1.NodeManagement" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "SetNodePoolManagement", + "fullName": "google.container.v1.ClusterManager.SetNodePoolManagement", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_SetLabels_async", + "title": "ClusterManager setLabels Sample", + "origin": "API_DEFINITION", + "description": " Sets labels on a cluster.", + "canonical": true, + "file": "cluster_manager.set_labels.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetLabels", + "fullName": "google.container.v1.ClusterManager.SetLabels", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "resource_labels", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "label_fingerprint", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "SetLabels", + "fullName": "google.container.v1.ClusterManager.SetLabels", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_SetLegacyAbac_async", + "title": "ClusterManager setLegacyAbac Sample", + "origin": "API_DEFINITION", + "description": " Enables or disables the ABAC authorization mechanism on a cluster.", + "canonical": true, + "file": "cluster_manager.set_legacy_abac.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetLegacyAbac", + "fullName": "google.container.v1.ClusterManager.SetLegacyAbac", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "enabled", + "type": "TYPE_BOOL" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "SetLegacyAbac", + "fullName": "google.container.v1.ClusterManager.SetLegacyAbac", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_StartIPRotation_async", + "title": "ClusterManager startIPRotation Sample", + "origin": "API_DEFINITION", + "description": " Starts master IP rotation.", + "canonical": true, + "file": "cluster_manager.start_i_p_rotation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StartIPRotation", + "fullName": "google.container.v1.ClusterManager.StartIPRotation", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "rotate_credentials", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "StartIPRotation", + "fullName": "google.container.v1.ClusterManager.StartIPRotation", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_CompleteIPRotation_async", + "title": "ClusterManager completeIPRotation Sample", + "origin": "API_DEFINITION", + "description": " Completes master IP rotation.", + "canonical": true, + "file": "cluster_manager.complete_i_p_rotation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CompleteIPRotation", + "fullName": "google.container.v1.ClusterManager.CompleteIPRotation", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "CompleteIPRotation", + "fullName": "google.container.v1.ClusterManager.CompleteIPRotation", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_SetNodePoolSize_async", + "title": "ClusterManager setNodePoolSize Sample", + "origin": "API_DEFINITION", + "description": " Sets the size for a specific node pool. The new size will be used for all replicas, including future replicas created by modifying [NodePool.locations][google.container.v1.NodePool.locations].", + "canonical": true, + "file": "cluster_manager.set_node_pool_size.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetNodePoolSize", + "fullName": "google.container.v1.ClusterManager.SetNodePoolSize", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "node_count", + "type": "TYPE_INT32" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "SetNodePoolSize", + "fullName": "google.container.v1.ClusterManager.SetNodePoolSize", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_SetNetworkPolicy_async", + "title": "ClusterManager setNetworkPolicy Sample", + "origin": "API_DEFINITION", + "description": " Enables or disables Network Policy for a cluster.", + "canonical": true, + "file": "cluster_manager.set_network_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetNetworkPolicy", + "fullName": "google.container.v1.ClusterManager.SetNetworkPolicy", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "network_policy", + "type": ".google.container.v1.NetworkPolicy" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "SetNetworkPolicy", + "fullName": "google.container.v1.ClusterManager.SetNetworkPolicy", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_SetMaintenancePolicy_async", + "title": "ClusterManager setMaintenancePolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the maintenance policy for a cluster.", + "canonical": true, + "file": "cluster_manager.set_maintenance_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetMaintenancePolicy", + "fullName": "google.container.v1.ClusterManager.SetMaintenancePolicy", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "maintenance_policy", + "type": ".google.container.v1.MaintenancePolicy" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "SetMaintenancePolicy", + "fullName": "google.container.v1.ClusterManager.SetMaintenancePolicy", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_ListUsableSubnetworks_async", + "title": "ClusterManager listUsableSubnetworks Sample", + "origin": "API_DEFINITION", + "description": " Lists subnetworks that are usable for creating clusters in a project.", + "canonical": true, + "file": "cluster_manager.list_usable_subnetworks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListUsableSubnetworks", + "fullName": "google.container.v1.ClusterManager.ListUsableSubnetworks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.ListUsableSubnetworksResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "ListUsableSubnetworks", + "fullName": "google.container.v1.ClusterManager.ListUsableSubnetworks", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_CheckAutopilotCompatibility_async", + "title": "ClusterManager checkAutopilotCompatibility Sample", + "origin": "API_DEFINITION", + "description": " Checks the cluster compatibility with Autopilot mode, and returns a list of compatibility issues.", + "canonical": true, + "file": "cluster_manager.check_autopilot_compatibility.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CheckAutopilotCompatibility", + "fullName": "google.container.v1.ClusterManager.CheckAutopilotCompatibility", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.CheckAutopilotCompatibilityResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "CheckAutopilotCompatibility", + "fullName": "google.container.v1.ClusterManager.CheckAutopilotCompatibility", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-container/v1/src/index.ts b/owl-bot-staging/google-container/v1/src/index.ts new file mode 100644 index 00000000000..7f3539e2b2d --- /dev/null +++ b/owl-bot-staging/google-container/v1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +const ClusterManagerClient = v1.ClusterManagerClient; +type ClusterManagerClient = v1.ClusterManagerClient; +export {v1, ClusterManagerClient}; +export default {v1, ClusterManagerClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-container/v1/src/v1/cluster_manager_client.ts b/owl-bot-staging/google-container/v1/src/v1/cluster_manager_client.ts new file mode 100644 index 00000000000..6805bf5ddf2 --- /dev/null +++ b/owl-bot-staging/google-container/v1/src/v1/cluster_manager_client.ts @@ -0,0 +1,3551 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/cluster_manager_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './cluster_manager_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Google Kubernetes Engine Cluster Manager v1 + * @class + * @memberof v1 + */ +export class ClusterManagerClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + clusterManagerStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ClusterManagerClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new ClusterManagerClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ClusterManagerClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listUsableSubnetworks: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'subnetworks') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.container.v1.ClusterManager', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.clusterManagerStub) { + return this.clusterManagerStub; + } + + // Put together the "service stub" for + // google.container.v1.ClusterManager. + this.clusterManagerStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.container.v1.ClusterManager') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.container.v1.ClusterManager, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const clusterManagerStubMethods = + ['listClusters', 'getCluster', 'createCluster', 'updateCluster', 'updateNodePool', 'setNodePoolAutoscaling', 'setLoggingService', 'setMonitoringService', 'setAddonsConfig', 'setLocations', 'updateMaster', 'setMasterAuth', 'deleteCluster', 'listOperations', 'getOperation', 'cancelOperation', 'getServerConfig', 'getJsonWebKeys', 'listNodePools', 'getNodePool', 'createNodePool', 'deleteNodePool', 'completeNodePoolUpgrade', 'rollbackNodePoolUpgrade', 'setNodePoolManagement', 'setLabels', 'setLegacyAbac', 'startIpRotation', 'completeIpRotation', 'setNodePoolSize', 'setNetworkPolicy', 'setMaintenancePolicy', 'listUsableSubnetworks', 'checkAutopilotCompatibility']; + for (const methodName of clusterManagerStubMethods) { + const callPromise = this.clusterManagerStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.clusterManagerStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'container.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'container.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Lists all clusters owned by a project in either the specified zone or all + * zones. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the parent field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides, or "-" for all zones. This field has been deprecated and + * replaced by the parent field. + * @param {string} request.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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.ListClustersResponse | ListClustersResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.list_clusters.js + * region_tag:container_v1_generated_ClusterManager_ListClusters_async + */ + listClusters( + request?: protos.google.container.v1.IListClustersRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IListClustersResponse, + protos.google.container.v1.IListClustersRequest|undefined, {}|undefined + ]>; + listClusters( + request: protos.google.container.v1.IListClustersRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IListClustersResponse, + protos.google.container.v1.IListClustersRequest|null|undefined, + {}|null|undefined>): void; + listClusters( + request: protos.google.container.v1.IListClustersRequest, + callback: Callback< + protos.google.container.v1.IListClustersResponse, + protos.google.container.v1.IListClustersRequest|null|undefined, + {}|null|undefined>): void; + listClusters( + request?: protos.google.container.v1.IListClustersRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IListClustersResponse, + protos.google.container.v1.IListClustersRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IListClustersResponse, + protos.google.container.v1.IListClustersRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IListClustersResponse, + protos.google.container.v1.IListClustersRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + }); + this.initialize(); + return this.innerApiCalls.listClusters(request, options, callback); + } +/** + * Gets the details of a specific cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to retrieve. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to retrieve. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Cluster | Cluster}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.get_cluster.js + * region_tag:container_v1_generated_ClusterManager_GetCluster_async + */ + getCluster( + request?: protos.google.container.v1.IGetClusterRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.ICluster, + protos.google.container.v1.IGetClusterRequest|undefined, {}|undefined + ]>; + getCluster( + request: protos.google.container.v1.IGetClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.ICluster, + protos.google.container.v1.IGetClusterRequest|null|undefined, + {}|null|undefined>): void; + getCluster( + request: protos.google.container.v1.IGetClusterRequest, + callback: Callback< + protos.google.container.v1.ICluster, + protos.google.container.v1.IGetClusterRequest|null|undefined, + {}|null|undefined>): void; + getCluster( + request?: protos.google.container.v1.IGetClusterRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.ICluster, + protos.google.container.v1.IGetClusterRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.ICluster, + protos.google.container.v1.IGetClusterRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.ICluster, + protos.google.container.v1.IGetClusterRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.getCluster(request, options, callback); + } +/** + * 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](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). + * + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the parent field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the parent + * field. + * @param {google.container.v1.Cluster} request.cluster + * Required. A [cluster + * resource](https://cloud.google.com/container-engine/reference/rest/v1/projects.locations.clusters) + * @param {string} request.parent + * The parent (project and location) where the cluster will be created. + * Specified in the format `projects/* /locations/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.create_cluster.js + * region_tag:container_v1_generated_ClusterManager_CreateCluster_async + */ + createCluster( + request?: protos.google.container.v1.ICreateClusterRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ICreateClusterRequest|undefined, {}|undefined + ]>; + createCluster( + request: protos.google.container.v1.ICreateClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ICreateClusterRequest|null|undefined, + {}|null|undefined>): void; + createCluster( + request: protos.google.container.v1.ICreateClusterRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ICreateClusterRequest|null|undefined, + {}|null|undefined>): void; + createCluster( + request?: protos.google.container.v1.ICreateClusterRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ICreateClusterRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ICreateClusterRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ICreateClusterRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + }); + this.initialize(); + return this.innerApiCalls.createCluster(request, options, callback); + } +/** + * Updates the settings of a specific cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {google.container.v1.ClusterUpdate} request.update + * Required. A description of the update. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to update. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.update_cluster.js + * region_tag:container_v1_generated_ClusterManager_UpdateCluster_async + */ + updateCluster( + request?: protos.google.container.v1.IUpdateClusterRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateClusterRequest|undefined, {}|undefined + ]>; + updateCluster( + request: protos.google.container.v1.IUpdateClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateClusterRequest|null|undefined, + {}|null|undefined>): void; + updateCluster( + request: protos.google.container.v1.IUpdateClusterRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateClusterRequest|null|undefined, + {}|null|undefined>): void; + updateCluster( + request?: protos.google.container.v1.IUpdateClusterRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateClusterRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateClusterRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateClusterRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateCluster(request, options, callback); + } +/** + * Updates the version and/or image type for the specified node pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Deprecated. The name of the node pool to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodeVersion + * 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 + * @param {string} request.imageType + * Required. The desired image type for the node pool. Please see + * https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for + * available image types. + * @param {string} request.name + * The name (project, location, cluster, node pool) of the node pool to + * update. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {string[]} request.locations + * The desired list of Google Compute Engine + * [zones](https://cloud.google.com/compute/docs/zones#available) in which the + * node pool's nodes should be located. Changing the locations for a node pool + * will result in nodes being either created or removed from the node pool, + * depending on whether locations are being added or removed. + * @param {google.container.v1.WorkloadMetadataConfig} request.workloadMetadataConfig + * The desired workload metadata config for the node pool. + * @param {google.container.v1.NodePool.UpgradeSettings} request.upgradeSettings + * Upgrade settings control disruption and speed of the upgrade. + * @param {google.container.v1.NetworkTags} request.tags + * The desired network tags to be applied to all nodes in the node pool. + * If this field is not present, the tags will not be changed. Otherwise, + * the existing network tags will be *replaced* with the provided tags. + * @param {google.container.v1.NodeTaints} request.taints + * The desired node taints to be applied to all nodes in the node pool. + * If this field is not present, the taints will not be changed. Otherwise, + * the existing node taints will be *replaced* with the provided taints. + * @param {google.container.v1.NodeLabels} request.labels + * The desired node labels to be applied to all nodes in the node pool. + * If this field is not present, the labels will not be changed. Otherwise, + * the existing node labels will be *replaced* with the provided labels. + * @param {google.container.v1.LinuxNodeConfig} request.linuxNodeConfig + * Parameters that can be configured on Linux nodes. + * @param {google.container.v1.NodeKubeletConfig} request.kubeletConfig + * Node kubelet configs. + * @param {google.container.v1.NodeNetworkConfig} request.nodeNetworkConfig + * Node network config. + * @param {google.container.v1.GcfsConfig} request.gcfsConfig + * GCFS config. + * @param {google.container.v1.ConfidentialNodes} request.confidentialNodes + * Confidential nodes config. + * All the nodes in the node pool will be Confidential VM once enabled. + * @param {google.container.v1.VirtualNIC} request.gvnic + * Enable or disable gvnic on the node pool. + * @param {string} request.etag + * The current etag of the node pool. + * If an etag is provided and does not match the current etag of the node + * pool, update will be blocked and an ABORTED error will be returned. + * @param {google.container.v1.FastSocket} request.fastSocket + * Enable or disable NCCL fast socket for the node pool. + * @param {google.container.v1.NodePoolLoggingConfig} request.loggingConfig + * Logging configuration. + * @param {google.container.v1.ResourceLabels} request.resourceLabels + * The resource labels for the node pool to use to annotate any related + * Google Compute Engine resources. + * @param {google.container.v1.WindowsNodeConfig} request.windowsNodeConfig + * Parameters that can be configured on Windows nodes. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.update_node_pool.js + * region_tag:container_v1_generated_ClusterManager_UpdateNodePool_async + */ + updateNodePool( + request?: protos.google.container.v1.IUpdateNodePoolRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateNodePoolRequest|undefined, {}|undefined + ]>; + updateNodePool( + request: protos.google.container.v1.IUpdateNodePoolRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateNodePoolRequest|null|undefined, + {}|null|undefined>): void; + updateNodePool( + request: protos.google.container.v1.IUpdateNodePoolRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateNodePoolRequest|null|undefined, + {}|null|undefined>): void; + updateNodePool( + request?: protos.google.container.v1.IUpdateNodePoolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateNodePoolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateNodePoolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateNodePoolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateNodePool(request, options, callback); + } +/** + * Sets the autoscaling settings for the specified node pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Deprecated. The name of the node pool to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {google.container.v1.NodePoolAutoscaling} request.autoscaling + * Required. Autoscaling configuration for the node pool. + * @param {string} request.name + * The name (project, location, cluster, node pool) of the node pool to set + * autoscaler settings. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.set_node_pool_autoscaling.js + * region_tag:container_v1_generated_ClusterManager_SetNodePoolAutoscaling_async + */ + setNodePoolAutoscaling( + request?: protos.google.container.v1.ISetNodePoolAutoscalingRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolAutoscalingRequest|undefined, {}|undefined + ]>; + setNodePoolAutoscaling( + request: protos.google.container.v1.ISetNodePoolAutoscalingRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolAutoscalingRequest|null|undefined, + {}|null|undefined>): void; + setNodePoolAutoscaling( + request: protos.google.container.v1.ISetNodePoolAutoscalingRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolAutoscalingRequest|null|undefined, + {}|null|undefined>): void; + setNodePoolAutoscaling( + request?: protos.google.container.v1.ISetNodePoolAutoscalingRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolAutoscalingRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolAutoscalingRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolAutoscalingRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setNodePoolAutoscaling(request, options, callback); + } +/** + * Sets the logging service for a specific cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string} request.loggingService + * Required. The logging service the cluster should use to write logs. + * Currently available options: + * + * * `logging.googleapis.com/kubernetes` - The Cloud Logging + * service with a Kubernetes-native resource model + * * `logging.googleapis.com` - The legacy Cloud Logging service (no longer + * available as of GKE 1.15). + * * `none` - no logs will be exported from the cluster. + * + * If left as an empty string,`logging.googleapis.com/kubernetes` will be + * used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to set logging. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.set_logging_service.js + * region_tag:container_v1_generated_ClusterManager_SetLoggingService_async + */ + setLoggingService( + request?: protos.google.container.v1.ISetLoggingServiceRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLoggingServiceRequest|undefined, {}|undefined + ]>; + setLoggingService( + request: protos.google.container.v1.ISetLoggingServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLoggingServiceRequest|null|undefined, + {}|null|undefined>): void; + setLoggingService( + request: protos.google.container.v1.ISetLoggingServiceRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLoggingServiceRequest|null|undefined, + {}|null|undefined>): void; + setLoggingService( + request?: protos.google.container.v1.ISetLoggingServiceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLoggingServiceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLoggingServiceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLoggingServiceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setLoggingService(request, options, callback); + } +/** + * Sets the monitoring service for a specific cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string} request.monitoringService + * Required. The monitoring service the cluster should use to write metrics. + * Currently available options: + * + * * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring + * service with a Kubernetes-native resource model + * * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no + * longer available as of GKE 1.15). + * * `none` - No metrics will be exported from the cluster. + * + * If left as an empty string,`monitoring.googleapis.com/kubernetes` will be + * used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to set monitoring. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.set_monitoring_service.js + * region_tag:container_v1_generated_ClusterManager_SetMonitoringService_async + */ + setMonitoringService( + request?: protos.google.container.v1.ISetMonitoringServiceRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMonitoringServiceRequest|undefined, {}|undefined + ]>; + setMonitoringService( + request: protos.google.container.v1.ISetMonitoringServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMonitoringServiceRequest|null|undefined, + {}|null|undefined>): void; + setMonitoringService( + request: protos.google.container.v1.ISetMonitoringServiceRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMonitoringServiceRequest|null|undefined, + {}|null|undefined>): void; + setMonitoringService( + request?: protos.google.container.v1.ISetMonitoringServiceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMonitoringServiceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMonitoringServiceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMonitoringServiceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setMonitoringService(request, options, callback); + } +/** + * Sets the addons for a specific cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {google.container.v1.AddonsConfig} request.addonsConfig + * Required. The desired configurations for the various addons available to + * run in the cluster. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to set addons. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.set_addons_config.js + * region_tag:container_v1_generated_ClusterManager_SetAddonsConfig_async + */ + setAddonsConfig( + request?: protos.google.container.v1.ISetAddonsConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetAddonsConfigRequest|undefined, {}|undefined + ]>; + setAddonsConfig( + request: protos.google.container.v1.ISetAddonsConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetAddonsConfigRequest|null|undefined, + {}|null|undefined>): void; + setAddonsConfig( + request: protos.google.container.v1.ISetAddonsConfigRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetAddonsConfigRequest|null|undefined, + {}|null|undefined>): void; + setAddonsConfig( + request?: protos.google.container.v1.ISetAddonsConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetAddonsConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetAddonsConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetAddonsConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setAddonsConfig(request, options, callback); + } +/** + * Sets the locations for a specific cluster. + * Deprecated. Use + * [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update) + * instead. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string[]} request.locations + * Required. The desired list of Google Compute Engine + * [zones](https://cloud.google.com/compute/docs/zones#available) 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. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to set locations. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.set_locations.js + * region_tag:container_v1_generated_ClusterManager_SetLocations_async + * @deprecated SetLocations is deprecated and may be removed in a future version. + */ + setLocations( + request?: protos.google.container.v1.ISetLocationsRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLocationsRequest|undefined, {}|undefined + ]>; + setLocations( + request: protos.google.container.v1.ISetLocationsRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLocationsRequest|null|undefined, + {}|null|undefined>): void; + setLocations( + request: protos.google.container.v1.ISetLocationsRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLocationsRequest|null|undefined, + {}|null|undefined>): void; + setLocations( + request?: protos.google.container.v1.ISetLocationsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLocationsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLocationsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLocationsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + this.warn('DEP$ClusterManager-$SetLocations','SetLocations is deprecated and may be removed in a future version.', 'DeprecationWarning'); + return this.innerApiCalls.setLocations(request, options, callback); + } +/** + * Updates the master for a specific cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string} request.masterVersion + * 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 + * @param {string} request.name + * The name (project, location, cluster) of the cluster to update. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.update_master.js + * region_tag:container_v1_generated_ClusterManager_UpdateMaster_async + */ + updateMaster( + request?: protos.google.container.v1.IUpdateMasterRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateMasterRequest|undefined, {}|undefined + ]>; + updateMaster( + request: protos.google.container.v1.IUpdateMasterRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateMasterRequest|null|undefined, + {}|null|undefined>): void; + updateMaster( + request: protos.google.container.v1.IUpdateMasterRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateMasterRequest|null|undefined, + {}|null|undefined>): void; + updateMaster( + request?: protos.google.container.v1.IUpdateMasterRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateMasterRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateMasterRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateMasterRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateMaster(request, options, callback); + } +/** + * Sets master auth materials. Currently supports changing the admin password + * or a specific cluster, either via password generation or explicitly setting + * the password. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {google.container.v1.SetMasterAuthRequest.Action} request.action + * Required. The exact form of action to be taken on the master auth. + * @param {google.container.v1.MasterAuth} request.update + * Required. A description of the update. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to set auth. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.set_master_auth.js + * region_tag:container_v1_generated_ClusterManager_SetMasterAuth_async + */ + setMasterAuth( + request?: protos.google.container.v1.ISetMasterAuthRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMasterAuthRequest|undefined, {}|undefined + ]>; + setMasterAuth( + request: protos.google.container.v1.ISetMasterAuthRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMasterAuthRequest|null|undefined, + {}|null|undefined>): void; + setMasterAuth( + request: protos.google.container.v1.ISetMasterAuthRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMasterAuthRequest|null|undefined, + {}|null|undefined>): void; + setMasterAuth( + request?: protos.google.container.v1.ISetMasterAuthRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMasterAuthRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMasterAuthRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMasterAuthRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setMasterAuth(request, options, callback); + } +/** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to delete. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to delete. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.delete_cluster.js + * region_tag:container_v1_generated_ClusterManager_DeleteCluster_async + */ + deleteCluster( + request?: protos.google.container.v1.IDeleteClusterRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IDeleteClusterRequest|undefined, {}|undefined + ]>; + deleteCluster( + request: protos.google.container.v1.IDeleteClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IDeleteClusterRequest|null|undefined, + {}|null|undefined>): void; + deleteCluster( + request: protos.google.container.v1.IDeleteClusterRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IDeleteClusterRequest|null|undefined, + {}|null|undefined>): void; + deleteCluster( + request?: protos.google.container.v1.IDeleteClusterRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IDeleteClusterRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IDeleteClusterRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IDeleteClusterRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteCluster(request, options, callback); + } +/** + * Lists all operations in a project in a specific zone or all zones. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the parent field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) to return + * operations for, or `-` for all zones. This field has been deprecated and + * replaced by the parent field. + * @param {string} request.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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.ListOperationsResponse | ListOperationsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.list_operations.js + * region_tag:container_v1_generated_ClusterManager_ListOperations_async + */ + listOperations( + request?: protos.google.container.v1.IListOperationsRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IListOperationsResponse, + protos.google.container.v1.IListOperationsRequest|undefined, {}|undefined + ]>; + listOperations( + request: protos.google.container.v1.IListOperationsRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IListOperationsResponse, + protos.google.container.v1.IListOperationsRequest|null|undefined, + {}|null|undefined>): void; + listOperations( + request: protos.google.container.v1.IListOperationsRequest, + callback: Callback< + protos.google.container.v1.IListOperationsResponse, + protos.google.container.v1.IListOperationsRequest|null|undefined, + {}|null|undefined>): void; + listOperations( + request?: protos.google.container.v1.IListOperationsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IListOperationsResponse, + protos.google.container.v1.IListOperationsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IListOperationsResponse, + protos.google.container.v1.IListOperationsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IListOperationsResponse, + protos.google.container.v1.IListOperationsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + }); + this.initialize(); + return this.innerApiCalls.listOperations(request, options, callback); + } +/** + * Gets the specified operation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.operationId + * Deprecated. The server-assigned `name` of the operation. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, operation id) of the operation to get. + * Specified in the format `projects/* /locations/* /operations/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.get_operation.js + * region_tag:container_v1_generated_ClusterManager_GetOperation_async + */ + getOperation( + request?: protos.google.container.v1.IGetOperationRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IGetOperationRequest|undefined, {}|undefined + ]>; + getOperation( + request: protos.google.container.v1.IGetOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IGetOperationRequest|null|undefined, + {}|null|undefined>): void; + getOperation( + request: protos.google.container.v1.IGetOperationRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IGetOperationRequest|null|undefined, + {}|null|undefined>): void; + getOperation( + request?: protos.google.container.v1.IGetOperationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IGetOperationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IGetOperationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IGetOperationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'operation_id': request.operationId ?? '', + }); + this.initialize(); + return this.innerApiCalls.getOperation(request, options, callback); + } +/** + * Cancels the specified operation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * operation resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.operationId + * Deprecated. The server-assigned `name` of the operation. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, operation id) of the operation to cancel. + * Specified in the format `projects/* /locations/* /operations/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.cancel_operation.js + * region_tag:container_v1_generated_ClusterManager_CancelOperation_async + */ + cancelOperation( + request?: protos.google.container.v1.ICancelOperationRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.container.v1.ICancelOperationRequest|undefined, {}|undefined + ]>; + cancelOperation( + request: protos.google.container.v1.ICancelOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1.ICancelOperationRequest|null|undefined, + {}|null|undefined>): void; + cancelOperation( + request: protos.google.container.v1.ICancelOperationRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1.ICancelOperationRequest|null|undefined, + {}|null|undefined>): void; + cancelOperation( + request?: protos.google.container.v1.ICancelOperationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1.ICancelOperationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1.ICancelOperationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.container.v1.ICancelOperationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'operation_id': request.operationId ?? '', + }); + this.initialize(); + return this.innerApiCalls.cancelOperation(request, options, callback); + } +/** + * Returns configuration info about the Google Kubernetes Engine service. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) to return + * operations for. This field has been deprecated and replaced by the name + * field. + * @param {string} request.name + * The name (project and location) of the server config to get, + * specified in the format `projects/* /locations/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.ServerConfig | ServerConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.get_server_config.js + * region_tag:container_v1_generated_ClusterManager_GetServerConfig_async + */ + getServerConfig( + request?: protos.google.container.v1.IGetServerConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IServerConfig, + protos.google.container.v1.IGetServerConfigRequest|undefined, {}|undefined + ]>; + getServerConfig( + request: protos.google.container.v1.IGetServerConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IServerConfig, + protos.google.container.v1.IGetServerConfigRequest|null|undefined, + {}|null|undefined>): void; + getServerConfig( + request: protos.google.container.v1.IGetServerConfigRequest, + callback: Callback< + protos.google.container.v1.IServerConfig, + protos.google.container.v1.IGetServerConfigRequest|null|undefined, + {}|null|undefined>): void; + getServerConfig( + request?: protos.google.container.v1.IGetServerConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IServerConfig, + protos.google.container.v1.IGetServerConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IServerConfig, + protos.google.container.v1.IGetServerConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IServerConfig, + protos.google.container.v1.IGetServerConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + }); + this.initialize(); + return this.innerApiCalls.getServerConfig(request, options, callback); + } +/** + * Gets the public component of the cluster signing keys in + * JSON Web Key format. + * This API is not yet intended for general use, and is not available for all + * clusters. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The cluster (project, location, cluster name) to get keys for. Specified in + * the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.GetJSONWebKeysResponse | GetJSONWebKeysResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.get_j_s_o_n_web_keys.js + * region_tag:container_v1_generated_ClusterManager_GetJSONWebKeys_async + */ + getJSONWebKeys( + request?: protos.google.container.v1.IGetJSONWebKeysRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IGetJSONWebKeysResponse, + protos.google.container.v1.IGetJSONWebKeysRequest|undefined, {}|undefined + ]>; + getJSONWebKeys( + request: protos.google.container.v1.IGetJSONWebKeysRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IGetJSONWebKeysResponse, + protos.google.container.v1.IGetJSONWebKeysRequest|null|undefined, + {}|null|undefined>): void; + getJSONWebKeys( + request: protos.google.container.v1.IGetJSONWebKeysRequest, + callback: Callback< + protos.google.container.v1.IGetJSONWebKeysResponse, + protos.google.container.v1.IGetJSONWebKeysRequest|null|undefined, + {}|null|undefined>): void; + getJSONWebKeys( + request?: protos.google.container.v1.IGetJSONWebKeysRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IGetJSONWebKeysResponse, + protos.google.container.v1.IGetJSONWebKeysRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IGetJSONWebKeysResponse, + protos.google.container.v1.IGetJSONWebKeysRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IGetJSONWebKeysResponse, + protos.google.container.v1.IGetJSONWebKeysRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.getJsonWebKeys(request, options, callback); + } +/** + * Lists the node pools for a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the parent field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the parent + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the parent field. + * @param {string} request.parent + * The parent (project, location, cluster name) where the node pools will be + * listed. Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.ListNodePoolsResponse | ListNodePoolsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.list_node_pools.js + * region_tag:container_v1_generated_ClusterManager_ListNodePools_async + */ + listNodePools( + request?: protos.google.container.v1.IListNodePoolsRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IListNodePoolsResponse, + protos.google.container.v1.IListNodePoolsRequest|undefined, {}|undefined + ]>; + listNodePools( + request: protos.google.container.v1.IListNodePoolsRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IListNodePoolsResponse, + protos.google.container.v1.IListNodePoolsRequest|null|undefined, + {}|null|undefined>): void; + listNodePools( + request: protos.google.container.v1.IListNodePoolsRequest, + callback: Callback< + protos.google.container.v1.IListNodePoolsResponse, + protos.google.container.v1.IListNodePoolsRequest|null|undefined, + {}|null|undefined>): void; + listNodePools( + request?: protos.google.container.v1.IListNodePoolsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IListNodePoolsResponse, + protos.google.container.v1.IListNodePoolsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IListNodePoolsResponse, + protos.google.container.v1.IListNodePoolsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IListNodePoolsResponse, + protos.google.container.v1.IListNodePoolsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.listNodePools(request, options, callback); + } +/** + * Retrieves the requested node pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Deprecated. The name of the node pool. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster, node pool id) of the node pool to + * get. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.NodePool | NodePool}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.get_node_pool.js + * region_tag:container_v1_generated_ClusterManager_GetNodePool_async + */ + getNodePool( + request?: protos.google.container.v1.IGetNodePoolRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.INodePool, + protos.google.container.v1.IGetNodePoolRequest|undefined, {}|undefined + ]>; + getNodePool( + request: protos.google.container.v1.IGetNodePoolRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.INodePool, + protos.google.container.v1.IGetNodePoolRequest|null|undefined, + {}|null|undefined>): void; + getNodePool( + request: protos.google.container.v1.IGetNodePoolRequest, + callback: Callback< + protos.google.container.v1.INodePool, + protos.google.container.v1.IGetNodePoolRequest|null|undefined, + {}|null|undefined>): void; + getNodePool( + request?: protos.google.container.v1.IGetNodePoolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.INodePool, + protos.google.container.v1.IGetNodePoolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.INodePool, + protos.google.container.v1.IGetNodePoolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.INodePool, + protos.google.container.v1.IGetNodePoolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.getNodePool(request, options, callback); + } +/** + * Creates a node pool for a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the parent field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the parent + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the parent field. + * @param {google.container.v1.NodePool} request.nodePool + * Required. The node pool to create. + * @param {string} request.parent + * The parent (project, location, cluster name) where the node pool will be + * created. Specified in the format + * `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.create_node_pool.js + * region_tag:container_v1_generated_ClusterManager_CreateNodePool_async + */ + createNodePool( + request?: protos.google.container.v1.ICreateNodePoolRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ICreateNodePoolRequest|undefined, {}|undefined + ]>; + createNodePool( + request: protos.google.container.v1.ICreateNodePoolRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ICreateNodePoolRequest|null|undefined, + {}|null|undefined>): void; + createNodePool( + request: protos.google.container.v1.ICreateNodePoolRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ICreateNodePoolRequest|null|undefined, + {}|null|undefined>): void; + createNodePool( + request?: protos.google.container.v1.ICreateNodePoolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ICreateNodePoolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ICreateNodePoolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ICreateNodePoolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.createNodePool(request, options, callback); + } +/** + * Deletes a node pool from a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Deprecated. The name of the node pool to delete. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster, node pool id) of the node pool to + * delete. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.delete_node_pool.js + * region_tag:container_v1_generated_ClusterManager_DeleteNodePool_async + */ + deleteNodePool( + request?: protos.google.container.v1.IDeleteNodePoolRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IDeleteNodePoolRequest|undefined, {}|undefined + ]>; + deleteNodePool( + request: protos.google.container.v1.IDeleteNodePoolRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IDeleteNodePoolRequest|null|undefined, + {}|null|undefined>): void; + deleteNodePool( + request: protos.google.container.v1.IDeleteNodePoolRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IDeleteNodePoolRequest|null|undefined, + {}|null|undefined>): void; + deleteNodePool( + request?: protos.google.container.v1.IDeleteNodePoolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IDeleteNodePoolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IDeleteNodePoolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IDeleteNodePoolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteNodePool(request, options, callback); + } +/** + * CompleteNodePoolUpgrade will signal an on-going node pool upgrade to + * complete. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The name (project, location, cluster, node pool id) of the node pool to + * complete upgrade. + * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js + * region_tag:container_v1_generated_ClusterManager_CompleteNodePoolUpgrade_async + */ + completeNodePoolUpgrade( + request?: protos.google.container.v1.ICompleteNodePoolUpgradeRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.container.v1.ICompleteNodePoolUpgradeRequest|undefined, {}|undefined + ]>; + completeNodePoolUpgrade( + request: protos.google.container.v1.ICompleteNodePoolUpgradeRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1.ICompleteNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>): void; + completeNodePoolUpgrade( + request: protos.google.container.v1.ICompleteNodePoolUpgradeRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1.ICompleteNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>): void; + completeNodePoolUpgrade( + request?: protos.google.container.v1.ICompleteNodePoolUpgradeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1.ICompleteNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1.ICompleteNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.container.v1.ICompleteNodePoolUpgradeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.completeNodePoolUpgrade(request, options, callback); + } +/** + * Rolls back a previously Aborted or Failed NodePool upgrade. + * This makes no changes if the last upgrade successfully completed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to rollback. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Deprecated. The name of the node pool to rollback. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster, node pool id) of the node poll to + * rollback upgrade. + * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {boolean} request.respectPdb + * Option for rollback to ignore the PodDisruptionBudget. + * Default value is false. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.rollback_node_pool_upgrade.js + * region_tag:container_v1_generated_ClusterManager_RollbackNodePoolUpgrade_async + */ + rollbackNodePoolUpgrade( + request?: protos.google.container.v1.IRollbackNodePoolUpgradeRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IRollbackNodePoolUpgradeRequest|undefined, {}|undefined + ]>; + rollbackNodePoolUpgrade( + request: protos.google.container.v1.IRollbackNodePoolUpgradeRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IRollbackNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>): void; + rollbackNodePoolUpgrade( + request: protos.google.container.v1.IRollbackNodePoolUpgradeRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IRollbackNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>): void; + rollbackNodePoolUpgrade( + request?: protos.google.container.v1.IRollbackNodePoolUpgradeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IRollbackNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IRollbackNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IRollbackNodePoolUpgradeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.rollbackNodePoolUpgrade(request, options, callback); + } +/** + * Sets the NodeManagement options for a node pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to update. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Deprecated. The name of the node pool to update. + * This field has been deprecated and replaced by the name field. + * @param {google.container.v1.NodeManagement} request.management + * Required. NodeManagement configuration for the node pool. + * @param {string} request.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/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.set_node_pool_management.js + * region_tag:container_v1_generated_ClusterManager_SetNodePoolManagement_async + */ + setNodePoolManagement( + request?: protos.google.container.v1.ISetNodePoolManagementRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolManagementRequest|undefined, {}|undefined + ]>; + setNodePoolManagement( + request: protos.google.container.v1.ISetNodePoolManagementRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolManagementRequest|null|undefined, + {}|null|undefined>): void; + setNodePoolManagement( + request: protos.google.container.v1.ISetNodePoolManagementRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolManagementRequest|null|undefined, + {}|null|undefined>): void; + setNodePoolManagement( + request?: protos.google.container.v1.ISetNodePoolManagementRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolManagementRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolManagementRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolManagementRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setNodePoolManagement(request, options, callback); + } +/** + * Sets labels on a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the name field. + * @param {number[]} request.resourceLabels + * Required. The labels to set for that cluster. + * @param {string} request.labelFingerprint + * 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. + * @param {string} request.name + * The name (project, location, cluster name) of the cluster to set labels. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.set_labels.js + * region_tag:container_v1_generated_ClusterManager_SetLabels_async + */ + setLabels( + request?: protos.google.container.v1.ISetLabelsRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLabelsRequest|undefined, {}|undefined + ]>; + setLabels( + request: protos.google.container.v1.ISetLabelsRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLabelsRequest|null|undefined, + {}|null|undefined>): void; + setLabels( + request: protos.google.container.v1.ISetLabelsRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLabelsRequest|null|undefined, + {}|null|undefined>): void; + setLabels( + request?: protos.google.container.v1.ISetLabelsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLabelsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLabelsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLabelsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setLabels(request, options, callback); + } +/** + * Enables or disables the ABAC authorization mechanism on a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to update. + * This field has been deprecated and replaced by the name field. + * @param {boolean} request.enabled + * Required. Whether ABAC authorization will be enabled in the cluster. + * @param {string} request.name + * The name (project, location, cluster name) of the cluster to set legacy + * abac. Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.set_legacy_abac.js + * region_tag:container_v1_generated_ClusterManager_SetLegacyAbac_async + */ + setLegacyAbac( + request?: protos.google.container.v1.ISetLegacyAbacRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLegacyAbacRequest|undefined, {}|undefined + ]>; + setLegacyAbac( + request: protos.google.container.v1.ISetLegacyAbacRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLegacyAbacRequest|null|undefined, + {}|null|undefined>): void; + setLegacyAbac( + request: protos.google.container.v1.ISetLegacyAbacRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLegacyAbacRequest|null|undefined, + {}|null|undefined>): void; + setLegacyAbac( + request?: protos.google.container.v1.ISetLegacyAbacRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLegacyAbacRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLegacyAbacRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLegacyAbacRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setLegacyAbac(request, options, callback); + } +/** + * Starts master IP rotation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster name) of the cluster to start IP + * rotation. Specified in the format `projects/* /locations/* /clusters/*`. + * @param {boolean} request.rotateCredentials + * Whether to rotate credentials during IP rotation. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.start_i_p_rotation.js + * region_tag:container_v1_generated_ClusterManager_StartIPRotation_async + */ + startIPRotation( + request?: protos.google.container.v1.IStartIPRotationRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IStartIPRotationRequest|undefined, {}|undefined + ]>; + startIPRotation( + request: protos.google.container.v1.IStartIPRotationRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IStartIPRotationRequest|null|undefined, + {}|null|undefined>): void; + startIPRotation( + request: protos.google.container.v1.IStartIPRotationRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IStartIPRotationRequest|null|undefined, + {}|null|undefined>): void; + startIPRotation( + request?: protos.google.container.v1.IStartIPRotationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IStartIPRotationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IStartIPRotationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IStartIPRotationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.startIpRotation(request, options, callback); + } +/** + * Completes master IP rotation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster name) of the cluster to complete IP + * rotation. Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.complete_i_p_rotation.js + * region_tag:container_v1_generated_ClusterManager_CompleteIPRotation_async + */ + completeIPRotation( + request?: protos.google.container.v1.ICompleteIPRotationRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ICompleteIPRotationRequest|undefined, {}|undefined + ]>; + completeIPRotation( + request: protos.google.container.v1.ICompleteIPRotationRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ICompleteIPRotationRequest|null|undefined, + {}|null|undefined>): void; + completeIPRotation( + request: protos.google.container.v1.ICompleteIPRotationRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ICompleteIPRotationRequest|null|undefined, + {}|null|undefined>): void; + completeIPRotation( + request?: protos.google.container.v1.ICompleteIPRotationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ICompleteIPRotationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ICompleteIPRotationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ICompleteIPRotationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.completeIpRotation(request, options, callback); + } +/** + * Sets the size for a specific node pool. The new size will be used for all + * replicas, including future replicas created by modifying + * {@link google.container.v1.NodePool.locations|NodePool.locations}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to update. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Deprecated. The name of the node pool to update. + * This field has been deprecated and replaced by the name field. + * @param {number} request.nodeCount + * Required. The desired node count for the pool. + * @param {string} request.name + * The name (project, location, cluster, node pool id) of the node pool to set + * size. + * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.set_node_pool_size.js + * region_tag:container_v1_generated_ClusterManager_SetNodePoolSize_async + */ + setNodePoolSize( + request?: protos.google.container.v1.ISetNodePoolSizeRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolSizeRequest|undefined, {}|undefined + ]>; + setNodePoolSize( + request: protos.google.container.v1.ISetNodePoolSizeRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolSizeRequest|null|undefined, + {}|null|undefined>): void; + setNodePoolSize( + request: protos.google.container.v1.ISetNodePoolSizeRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolSizeRequest|null|undefined, + {}|null|undefined>): void; + setNodePoolSize( + request?: protos.google.container.v1.ISetNodePoolSizeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolSizeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolSizeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolSizeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setNodePoolSize(request, options, callback); + } +/** + * Enables or disables Network Policy for a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the name field. + * @param {google.container.v1.NetworkPolicy} request.networkPolicy + * Required. Configuration options for the NetworkPolicy feature. + * @param {string} request.name + * The name (project, location, cluster name) of the cluster to set networking + * policy. Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.set_network_policy.js + * region_tag:container_v1_generated_ClusterManager_SetNetworkPolicy_async + */ + setNetworkPolicy( + request?: protos.google.container.v1.ISetNetworkPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNetworkPolicyRequest|undefined, {}|undefined + ]>; + setNetworkPolicy( + request: protos.google.container.v1.ISetNetworkPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNetworkPolicyRequest|null|undefined, + {}|null|undefined>): void; + setNetworkPolicy( + request: protos.google.container.v1.ISetNetworkPolicyRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNetworkPolicyRequest|null|undefined, + {}|null|undefined>): void; + setNetworkPolicy( + request?: protos.google.container.v1.ISetNetworkPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNetworkPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNetworkPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNetworkPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setNetworkPolicy(request, options, callback); + } +/** + * Sets the maintenance policy for a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * @param {string} request.zone + * Required. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. + * @param {string} request.clusterId + * Required. The name of the cluster to update. + * @param {google.container.v1.MaintenancePolicy} request.maintenancePolicy + * Required. The maintenance policy to be set for the cluster. An empty field + * clears the existing maintenance policy. + * @param {string} request.name + * The name (project, location, cluster name) of the cluster to set + * maintenance policy. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.set_maintenance_policy.js + * region_tag:container_v1_generated_ClusterManager_SetMaintenancePolicy_async + */ + setMaintenancePolicy( + request?: protos.google.container.v1.ISetMaintenancePolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMaintenancePolicyRequest|undefined, {}|undefined + ]>; + setMaintenancePolicy( + request: protos.google.container.v1.ISetMaintenancePolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMaintenancePolicyRequest|null|undefined, + {}|null|undefined>): void; + setMaintenancePolicy( + request: protos.google.container.v1.ISetMaintenancePolicyRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMaintenancePolicyRequest|null|undefined, + {}|null|undefined>): void; + setMaintenancePolicy( + request?: protos.google.container.v1.ISetMaintenancePolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMaintenancePolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMaintenancePolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMaintenancePolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setMaintenancePolicy(request, options, callback); + } +/** + * Checks the cluster compatibility with Autopilot mode, and returns a list of + * compatibility issues. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to retrieve. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.CheckAutopilotCompatibilityResponse | CheckAutopilotCompatibilityResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.check_autopilot_compatibility.js + * region_tag:container_v1_generated_ClusterManager_CheckAutopilotCompatibility_async + */ + checkAutopilotCompatibility( + request?: protos.google.container.v1.ICheckAutopilotCompatibilityRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.ICheckAutopilotCompatibilityResponse, + protos.google.container.v1.ICheckAutopilotCompatibilityRequest|undefined, {}|undefined + ]>; + checkAutopilotCompatibility( + request: protos.google.container.v1.ICheckAutopilotCompatibilityRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.ICheckAutopilotCompatibilityResponse, + protos.google.container.v1.ICheckAutopilotCompatibilityRequest|null|undefined, + {}|null|undefined>): void; + checkAutopilotCompatibility( + request: protos.google.container.v1.ICheckAutopilotCompatibilityRequest, + callback: Callback< + protos.google.container.v1.ICheckAutopilotCompatibilityResponse, + protos.google.container.v1.ICheckAutopilotCompatibilityRequest|null|undefined, + {}|null|undefined>): void; + checkAutopilotCompatibility( + request?: protos.google.container.v1.ICheckAutopilotCompatibilityRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.ICheckAutopilotCompatibilityResponse, + protos.google.container.v1.ICheckAutopilotCompatibilityRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.ICheckAutopilotCompatibilityResponse, + protos.google.container.v1.ICheckAutopilotCompatibilityRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.ICheckAutopilotCompatibilityResponse, + protos.google.container.v1.ICheckAutopilotCompatibilityRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.checkAutopilotCompatibility(request, options, callback); + } + + /** + * Lists subnetworks that are usable for creating clusters in a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The parent project where subnetworks are usable. + * Specified in the format `projects/*`. + * @param {string} request.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. + * @param {number} request.pageSize + * 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) + * @param {string} request.pageToken + * Specifies a page token to use. Set this to the nextPageToken returned by + * previous list requests to get the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.container.v1.UsableSubnetwork | UsableSubnetwork}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listUsableSubnetworksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listUsableSubnetworks( + request?: protos.google.container.v1.IListUsableSubnetworksRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IUsableSubnetwork[], + protos.google.container.v1.IListUsableSubnetworksRequest|null, + protos.google.container.v1.IListUsableSubnetworksResponse + ]>; + listUsableSubnetworks( + request: protos.google.container.v1.IListUsableSubnetworksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.container.v1.IListUsableSubnetworksRequest, + protos.google.container.v1.IListUsableSubnetworksResponse|null|undefined, + protos.google.container.v1.IUsableSubnetwork>): void; + listUsableSubnetworks( + request: protos.google.container.v1.IListUsableSubnetworksRequest, + callback: PaginationCallback< + protos.google.container.v1.IListUsableSubnetworksRequest, + protos.google.container.v1.IListUsableSubnetworksResponse|null|undefined, + protos.google.container.v1.IUsableSubnetwork>): void; + listUsableSubnetworks( + request?: protos.google.container.v1.IListUsableSubnetworksRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.container.v1.IListUsableSubnetworksRequest, + protos.google.container.v1.IListUsableSubnetworksResponse|null|undefined, + protos.google.container.v1.IUsableSubnetwork>, + callback?: PaginationCallback< + protos.google.container.v1.IListUsableSubnetworksRequest, + protos.google.container.v1.IListUsableSubnetworksResponse|null|undefined, + protos.google.container.v1.IUsableSubnetwork>): + Promise<[ + protos.google.container.v1.IUsableSubnetwork[], + protos.google.container.v1.IListUsableSubnetworksRequest|null, + protos.google.container.v1.IListUsableSubnetworksResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listUsableSubnetworks(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The parent project where subnetworks are usable. + * Specified in the format `projects/*`. + * @param {string} request.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. + * @param {number} request.pageSize + * 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) + * @param {string} request.pageToken + * Specifies a page token to use. Set this to the nextPageToken returned by + * previous list requests to get the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.container.v1.UsableSubnetwork | UsableSubnetwork} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listUsableSubnetworksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listUsableSubnetworksStream( + request?: protos.google.container.v1.IListUsableSubnetworksRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUsableSubnetworks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listUsableSubnetworks.createStream( + this.innerApiCalls.listUsableSubnetworks as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listUsableSubnetworks`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The parent project where subnetworks are usable. + * Specified in the format `projects/*`. + * @param {string} request.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. + * @param {number} request.pageSize + * 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) + * @param {string} request.pageToken + * Specifies a page token to use. Set this to the nextPageToken returned by + * previous list requests to get the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.container.v1.UsableSubnetwork | UsableSubnetwork}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.list_usable_subnetworks.js + * region_tag:container_v1_generated_ClusterManager_ListUsableSubnetworks_async + */ + listUsableSubnetworksAsync( + request?: protos.google.container.v1.IListUsableSubnetworksRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUsableSubnetworks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listUsableSubnetworks.asyncIterate( + this.innerApiCalls['listUsableSubnetworks'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.clusterManagerStub && !this._terminated) { + return this.clusterManagerStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-container/v1/src/v1/cluster_manager_client_config.json b/owl-bot-staging/google-container/v1/src/v1/cluster_manager_client_config.json new file mode 100644 index 00000000000..33fb266b6bd --- /dev/null +++ b/owl-bot-staging/google-container/v1/src/v1/cluster_manager_client_config.json @@ -0,0 +1,192 @@ +{ + "interfaces": { + "google.container.v1.ClusterManager": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListClusters": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetCluster": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateCluster": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCluster": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateNodePool": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetNodePoolAutoscaling": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLoggingService": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetMonitoringService": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetAddonsConfig": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLocations": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateMaster": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetMasterAuth": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCluster": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListOperations": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetOperation": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CancelOperation": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetServerConfig": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetJSONWebKeys": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListNodePools": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetNodePool": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateNodePool": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteNodePool": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CompleteNodePoolUpgrade": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RollbackNodePoolUpgrade": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetNodePoolManagement": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLabels": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLegacyAbac": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StartIPRotation": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CompleteIPRotation": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetNodePoolSize": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetNetworkPolicy": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetMaintenancePolicy": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListUsableSubnetworks": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CheckAutopilotCompatibility": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-container/v1/src/v1/cluster_manager_proto_list.json b/owl-bot-staging/google-container/v1/src/v1/cluster_manager_proto_list.json new file mode 100644 index 00000000000..aa69748e51b --- /dev/null +++ b/owl-bot-staging/google-container/v1/src/v1/cluster_manager_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/container/v1/cluster_service.proto" +] diff --git a/owl-bot-staging/google-container/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-container/v1/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..c08b06ded09 --- /dev/null +++ b/owl-bot-staging/google-container/v1/src/v1/gapic_metadata.json @@ -0,0 +1,367 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.container.v1", + "libraryPackage": "@google-cloud/container", + "services": { + "ClusterManager": { + "clients": { + "grpc": { + "libraryClient": "ClusterManagerClient", + "rpcs": { + "ListClusters": { + "methods": [ + "listClusters" + ] + }, + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "UpdateNodePool": { + "methods": [ + "updateNodePool" + ] + }, + "SetNodePoolAutoscaling": { + "methods": [ + "setNodePoolAutoscaling" + ] + }, + "SetLoggingService": { + "methods": [ + "setLoggingService" + ] + }, + "SetMonitoringService": { + "methods": [ + "setMonitoringService" + ] + }, + "SetAddonsConfig": { + "methods": [ + "setAddonsConfig" + ] + }, + "SetLocations": { + "methods": [ + "setLocations" + ] + }, + "UpdateMaster": { + "methods": [ + "updateMaster" + ] + }, + "SetMasterAuth": { + "methods": [ + "setMasterAuth" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "ListOperations": { + "methods": [ + "listOperations" + ] + }, + "GetOperation": { + "methods": [ + "getOperation" + ] + }, + "CancelOperation": { + "methods": [ + "cancelOperation" + ] + }, + "GetServerConfig": { + "methods": [ + "getServerConfig" + ] + }, + "GetJSONWebKeys": { + "methods": [ + "getJSONWebKeys" + ] + }, + "ListNodePools": { + "methods": [ + "listNodePools" + ] + }, + "GetNodePool": { + "methods": [ + "getNodePool" + ] + }, + "CreateNodePool": { + "methods": [ + "createNodePool" + ] + }, + "DeleteNodePool": { + "methods": [ + "deleteNodePool" + ] + }, + "CompleteNodePoolUpgrade": { + "methods": [ + "completeNodePoolUpgrade" + ] + }, + "RollbackNodePoolUpgrade": { + "methods": [ + "rollbackNodePoolUpgrade" + ] + }, + "SetNodePoolManagement": { + "methods": [ + "setNodePoolManagement" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "SetLegacyAbac": { + "methods": [ + "setLegacyAbac" + ] + }, + "StartIPRotation": { + "methods": [ + "startIPRotation" + ] + }, + "CompleteIPRotation": { + "methods": [ + "completeIPRotation" + ] + }, + "SetNodePoolSize": { + "methods": [ + "setNodePoolSize" + ] + }, + "SetNetworkPolicy": { + "methods": [ + "setNetworkPolicy" + ] + }, + "SetMaintenancePolicy": { + "methods": [ + "setMaintenancePolicy" + ] + }, + "CheckAutopilotCompatibility": { + "methods": [ + "checkAutopilotCompatibility" + ] + }, + "ListUsableSubnetworks": { + "methods": [ + "listUsableSubnetworks", + "listUsableSubnetworksStream", + "listUsableSubnetworksAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ClusterManagerClient", + "rpcs": { + "ListClusters": { + "methods": [ + "listClusters" + ] + }, + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "UpdateNodePool": { + "methods": [ + "updateNodePool" + ] + }, + "SetNodePoolAutoscaling": { + "methods": [ + "setNodePoolAutoscaling" + ] + }, + "SetLoggingService": { + "methods": [ + "setLoggingService" + ] + }, + "SetMonitoringService": { + "methods": [ + "setMonitoringService" + ] + }, + "SetAddonsConfig": { + "methods": [ + "setAddonsConfig" + ] + }, + "SetLocations": { + "methods": [ + "setLocations" + ] + }, + "UpdateMaster": { + "methods": [ + "updateMaster" + ] + }, + "SetMasterAuth": { + "methods": [ + "setMasterAuth" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "ListOperations": { + "methods": [ + "listOperations" + ] + }, + "GetOperation": { + "methods": [ + "getOperation" + ] + }, + "CancelOperation": { + "methods": [ + "cancelOperation" + ] + }, + "GetServerConfig": { + "methods": [ + "getServerConfig" + ] + }, + "GetJSONWebKeys": { + "methods": [ + "getJSONWebKeys" + ] + }, + "ListNodePools": { + "methods": [ + "listNodePools" + ] + }, + "GetNodePool": { + "methods": [ + "getNodePool" + ] + }, + "CreateNodePool": { + "methods": [ + "createNodePool" + ] + }, + "DeleteNodePool": { + "methods": [ + "deleteNodePool" + ] + }, + "CompleteNodePoolUpgrade": { + "methods": [ + "completeNodePoolUpgrade" + ] + }, + "RollbackNodePoolUpgrade": { + "methods": [ + "rollbackNodePoolUpgrade" + ] + }, + "SetNodePoolManagement": { + "methods": [ + "setNodePoolManagement" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "SetLegacyAbac": { + "methods": [ + "setLegacyAbac" + ] + }, + "StartIPRotation": { + "methods": [ + "startIPRotation" + ] + }, + "CompleteIPRotation": { + "methods": [ + "completeIPRotation" + ] + }, + "SetNodePoolSize": { + "methods": [ + "setNodePoolSize" + ] + }, + "SetNetworkPolicy": { + "methods": [ + "setNetworkPolicy" + ] + }, + "SetMaintenancePolicy": { + "methods": [ + "setMaintenancePolicy" + ] + }, + "CheckAutopilotCompatibility": { + "methods": [ + "checkAutopilotCompatibility" + ] + }, + "ListUsableSubnetworks": { + "methods": [ + "listUsableSubnetworks", + "listUsableSubnetworksStream", + "listUsableSubnetworksAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-container/v1/src/v1/index.ts b/owl-bot-staging/google-container/v1/src/v1/index.ts new file mode 100644 index 00000000000..b1b39233034 --- /dev/null +++ b/owl-bot-staging/google-container/v1/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {ClusterManagerClient} from './cluster_manager_client'; diff --git a/owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..1101d781caa --- /dev/null +++ b/owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const container = require('@google-cloud/container'); + +function main() { + const clusterManagerClient = new container.ClusterManagerClient(); +} + +main(); diff --git a/owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..6685b8649e6 --- /dev/null +++ b/owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {ClusterManagerClient} from '@google-cloud/container'; + +// check that the client class type name can be used +function doStuffWithClusterManagerClient(client: ClusterManagerClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const clusterManagerClient = new ClusterManagerClient(); + doStuffWithClusterManagerClient(clusterManagerClient); +} + +main(); diff --git a/owl-bot-staging/google-container/v1/system-test/install.ts b/owl-bot-staging/google-container/v1/system-test/install.ts new file mode 100644 index 00000000000..c8f81b25a86 --- /dev/null +++ b/owl-bot-staging/google-container/v1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-container/v1/test/gapic_cluster_manager_v1.ts b/owl-bot-staging/google-container/v1/test/gapic_cluster_manager_v1.ts new file mode 100644 index 00000000000..9632e377d3a --- /dev/null +++ b/owl-bot-staging/google-container/v1/test/gapic_cluster_manager_v1.ts @@ -0,0 +1,5130 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as clustermanagerModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.ClusterManagerClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = clustermanagerModule.v1.ClusterManagerClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = clustermanagerModule.v1.ClusterManagerClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = clustermanagerModule.v1.ClusterManagerClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new clustermanagerModule.v1.ClusterManagerClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.clusterManagerStub, undefined); + await client.initialize(); + assert(client.clusterManagerStub); + }); + + it('has close method for the initialized client', done => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.clusterManagerStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.clusterManagerStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('listClusters', () => { + it('invokes listClusters without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.ListClustersResponse() + ); + client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); + const [response] = await client.listClusters(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.ListClustersResponse() + ); + client.innerApiCalls.listClusters = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listClusters( + request, + (err?: Error|null, result?: protos.google.container.v1.IListClustersResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listClusters = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listClusters(request), expectedError); + const actualRequest = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['zone']); + request.zone = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listClusters(request), expectedError); + }); + }); + + describe('getCluster', () => { + it('invokes getCluster without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Cluster() + ); + client.innerApiCalls.getCluster = stubSimpleCall(expectedResponse); + const [response] = await client.getCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Cluster() + ); + client.innerApiCalls.getCluster = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCluster( + request, + (err?: Error|null, result?: protos.google.container.v1.ICluster|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCluster = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCluster(request), expectedError); + }); + }); + + describe('createCluster', () => { + it('invokes createCluster without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.createCluster = stubSimpleCall(expectedResponse); + const [response] = await client.createCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.createCluster = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCluster( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCluster = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['zone']); + request.zone = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createCluster(request), expectedError); + }); + }); + + describe('updateCluster', () => { + it('invokes updateCluster without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.UpdateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.updateCluster = stubSimpleCall(expectedResponse); + const [response] = await client.updateCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.UpdateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.updateCluster = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCluster( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.UpdateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCluster = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.UpdateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateCluster(request), expectedError); + }); + }); + + describe('updateNodePool', () => { + it('invokes updateNodePool without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.UpdateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.updateNodePool = stubSimpleCall(expectedResponse); + const [response] = await client.updateNodePool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateNodePool without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.UpdateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.updateNodePool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateNodePool( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateNodePool with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.UpdateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateNodePool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateNodePool(request), expectedError); + const actualRequest = (client.innerApiCalls.updateNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateNodePool with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.UpdateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateNodePool(request), expectedError); + }); + }); + + describe('setNodePoolAutoscaling', () => { + it('invokes setNodePoolAutoscaling without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNodePoolAutoscalingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCall(expectedResponse); + const [response] = await client.setNodePoolAutoscaling(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolAutoscaling without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNodePoolAutoscalingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setNodePoolAutoscaling( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolAutoscaling with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNodePoolAutoscalingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setNodePoolAutoscaling(request), expectedError); + const actualRequest = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolAutoscaling with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNodePoolAutoscalingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setNodePoolAutoscaling(request), expectedError); + }); + }); + + describe('setLoggingService', () => { + it('invokes setLoggingService without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLoggingServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setLoggingService = stubSimpleCall(expectedResponse); + const [response] = await client.setLoggingService(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLoggingService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLoggingService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLoggingService without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLoggingServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setLoggingService = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLoggingService( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLoggingService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLoggingService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLoggingService with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLoggingServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setLoggingService = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLoggingService(request), expectedError); + const actualRequest = (client.innerApiCalls.setLoggingService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLoggingService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLoggingService with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLoggingServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setLoggingService(request), expectedError); + }); + }); + + describe('setMonitoringService', () => { + it('invokes setMonitoringService without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetMonitoringServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setMonitoringService = stubSimpleCall(expectedResponse); + const [response] = await client.setMonitoringService(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMonitoringService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMonitoringService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMonitoringService without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetMonitoringServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setMonitoringService = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setMonitoringService( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMonitoringService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMonitoringService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMonitoringService with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetMonitoringServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setMonitoringService = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setMonitoringService(request), expectedError); + const actualRequest = (client.innerApiCalls.setMonitoringService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMonitoringService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMonitoringService with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetMonitoringServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setMonitoringService(request), expectedError); + }); + }); + + describe('setAddonsConfig', () => { + it('invokes setAddonsConfig without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetAddonsConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setAddonsConfig = stubSimpleCall(expectedResponse); + const [response] = await client.setAddonsConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setAddonsConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setAddonsConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setAddonsConfig without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetAddonsConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setAddonsConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setAddonsConfig( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setAddonsConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setAddonsConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setAddonsConfig with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetAddonsConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setAddonsConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setAddonsConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.setAddonsConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setAddonsConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setAddonsConfig with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetAddonsConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setAddonsConfig(request), expectedError); + }); + }); + + describe('setLocations', () => { + it('invokes setLocations without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLocationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setLocations = stubSimpleCall(expectedResponse); + const [response] = await client.setLocations(request); + assert(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLocations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLocations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLocations without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLocationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setLocations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLocations( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLocations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLocations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLocations with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLocationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setLocations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLocations(request), expectedError); + assert(stub.calledOnce); + const actualRequest = (client.innerApiCalls.setLocations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLocations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLocations with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLocationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setLocations(request), expectedError); + assert(stub.calledOnce); + }); + }); + + describe('updateMaster', () => { + it('invokes updateMaster without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.UpdateMasterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.updateMaster = stubSimpleCall(expectedResponse); + const [response] = await client.updateMaster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateMaster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMaster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMaster without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.UpdateMasterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.updateMaster = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateMaster( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateMaster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMaster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMaster with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.UpdateMasterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMaster = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateMaster(request), expectedError); + const actualRequest = (client.innerApiCalls.updateMaster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMaster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMaster with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.UpdateMasterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateMaster(request), expectedError); + }); + }); + + describe('setMasterAuth', () => { + it('invokes setMasterAuth without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetMasterAuthRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setMasterAuth = stubSimpleCall(expectedResponse); + const [response] = await client.setMasterAuth(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMasterAuth as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMasterAuth as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMasterAuth without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetMasterAuthRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setMasterAuth = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setMasterAuth( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMasterAuth as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMasterAuth as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMasterAuth with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetMasterAuthRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setMasterAuth = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setMasterAuth(request), expectedError); + const actualRequest = (client.innerApiCalls.setMasterAuth as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMasterAuth as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMasterAuth with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetMasterAuthRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setMasterAuth(request), expectedError); + }); + }); + + describe('deleteCluster', () => { + it('invokes deleteCluster without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.deleteCluster = stubSimpleCall(expectedResponse); + const [response] = await client.deleteCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.deleteCluster = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCluster( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCluster = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteCluster(request), expectedError); + }); + }); + + describe('listOperations', () => { + it('invokes listOperations without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.ListOperationsResponse() + ); + client.innerApiCalls.listOperations = stubSimpleCall(expectedResponse); + const [response] = await client.listOperations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOperations without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.ListOperationsResponse() + ); + client.innerApiCalls.listOperations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listOperations( + request, + (err?: Error|null, result?: protos.google.container.v1.IListOperationsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOperations with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listOperations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listOperations(request), expectedError); + const actualRequest = (client.innerApiCalls.listOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOperations with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['zone']); + request.zone = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listOperations(request), expectedError); + }); + }); + + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.getOperation = stubSimpleCall(expectedResponse); + const [response] = await client.getOperation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOperation without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.getOperation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getOperation( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOperation with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getOperation(request), expectedError); + const actualRequest = (client.innerApiCalls.getOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOperation with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getOperation(request), expectedError); + }); + }); + + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CancelOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelOperation = stubSimpleCall(expectedResponse); + const [response] = await client.cancelOperation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelOperation without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CancelOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelOperation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelOperation( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelOperation with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CancelOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelOperation(request), expectedError); + const actualRequest = (client.innerApiCalls.cancelOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelOperation with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CancelOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelOperation(request), expectedError); + }); + }); + + describe('getServerConfig', () => { + it('invokes getServerConfig without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetServerConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.ServerConfig() + ); + client.innerApiCalls.getServerConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getServerConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getServerConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getServerConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getServerConfig without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetServerConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.ServerConfig() + ); + client.innerApiCalls.getServerConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getServerConfig( + request, + (err?: Error|null, result?: protos.google.container.v1.IServerConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getServerConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getServerConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getServerConfig with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetServerConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getServerConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getServerConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.getServerConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getServerConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getServerConfig with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetServerConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['zone']); + request.zone = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getServerConfig(request), expectedError); + }); + }); + + describe('getJSONWebKeys', () => { + it('invokes getJSONWebKeys without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetJSONWebKeysRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetJSONWebKeysRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.GetJSONWebKeysResponse() + ); + client.innerApiCalls.getJsonWebKeys = stubSimpleCall(expectedResponse); + const [response] = await client.getJSONWebKeys(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJsonWebKeys as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJsonWebKeys as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJSONWebKeys without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetJSONWebKeysRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetJSONWebKeysRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.GetJSONWebKeysResponse() + ); + client.innerApiCalls.getJsonWebKeys = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getJSONWebKeys( + request, + (err?: Error|null, result?: protos.google.container.v1.IGetJSONWebKeysResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJsonWebKeys as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJsonWebKeys as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJSONWebKeys with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetJSONWebKeysRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetJSONWebKeysRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getJsonWebKeys = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getJSONWebKeys(request), expectedError); + const actualRequest = (client.innerApiCalls.getJsonWebKeys as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJsonWebKeys as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJSONWebKeys with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetJSONWebKeysRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetJSONWebKeysRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getJSONWebKeys(request), expectedError); + }); + }); + + describe('listNodePools', () => { + it('invokes listNodePools without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListNodePoolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.ListNodePoolsResponse() + ); + client.innerApiCalls.listNodePools = stubSimpleCall(expectedResponse); + const [response] = await client.listNodePools(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listNodePools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listNodePools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNodePools without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListNodePoolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.ListNodePoolsResponse() + ); + client.innerApiCalls.listNodePools = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listNodePools( + request, + (err?: Error|null, result?: protos.google.container.v1.IListNodePoolsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listNodePools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listNodePools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNodePools with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListNodePoolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listNodePools = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listNodePools(request), expectedError); + const actualRequest = (client.innerApiCalls.listNodePools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listNodePools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNodePools with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListNodePoolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listNodePools(request), expectedError); + }); + }); + + describe('getNodePool', () => { + it('invokes getNodePool without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.NodePool() + ); + client.innerApiCalls.getNodePool = stubSimpleCall(expectedResponse); + const [response] = await client.getNodePool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNodePool without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.NodePool() + ); + client.innerApiCalls.getNodePool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getNodePool( + request, + (err?: Error|null, result?: protos.google.container.v1.INodePool|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNodePool with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getNodePool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getNodePool(request), expectedError); + const actualRequest = (client.innerApiCalls.getNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNodePool with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getNodePool(request), expectedError); + }); + }); + + describe('createNodePool', () => { + it('invokes createNodePool without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CreateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.createNodePool = stubSimpleCall(expectedResponse); + const [response] = await client.createNodePool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNodePool without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CreateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.createNodePool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createNodePool( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNodePool with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CreateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createNodePool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createNodePool(request), expectedError); + const actualRequest = (client.innerApiCalls.createNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNodePool with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CreateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createNodePool(request), expectedError); + }); + }); + + describe('deleteNodePool', () => { + it('invokes deleteNodePool without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.DeleteNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.deleteNodePool = stubSimpleCall(expectedResponse); + const [response] = await client.deleteNodePool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNodePool without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.DeleteNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.deleteNodePool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteNodePool( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNodePool with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.DeleteNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteNodePool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteNodePool(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNodePool with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.DeleteNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteNodePool(request), expectedError); + }); + }); + + describe('completeNodePoolUpgrade', () => { + it('invokes completeNodePoolUpgrade without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CompleteNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CompleteNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.completeNodePoolUpgrade = stubSimpleCall(expectedResponse); + const [response] = await client.completeNodePoolUpgrade(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeNodePoolUpgrade without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CompleteNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CompleteNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.completeNodePoolUpgrade = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.completeNodePoolUpgrade( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeNodePoolUpgrade with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CompleteNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CompleteNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.completeNodePoolUpgrade = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.completeNodePoolUpgrade(request), expectedError); + const actualRequest = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeNodePoolUpgrade with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CompleteNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CompleteNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.completeNodePoolUpgrade(request), expectedError); + }); + }); + + describe('rollbackNodePoolUpgrade', () => { + it('invokes rollbackNodePoolUpgrade without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.RollbackNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCall(expectedResponse); + const [response] = await client.rollbackNodePoolUpgrade(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackNodePoolUpgrade without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.RollbackNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.rollbackNodePoolUpgrade( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackNodePoolUpgrade with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.RollbackNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.rollbackNodePoolUpgrade(request), expectedError); + const actualRequest = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackNodePoolUpgrade with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.RollbackNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.rollbackNodePoolUpgrade(request), expectedError); + }); + }); + + describe('setNodePoolManagement', () => { + it('invokes setNodePoolManagement without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNodePoolManagementRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setNodePoolManagement = stubSimpleCall(expectedResponse); + const [response] = await client.setNodePoolManagement(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNodePoolManagement as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolManagement as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolManagement without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNodePoolManagementRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setNodePoolManagement = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setNodePoolManagement( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNodePoolManagement as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolManagement as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolManagement with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNodePoolManagementRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setNodePoolManagement = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setNodePoolManagement(request), expectedError); + const actualRequest = (client.innerApiCalls.setNodePoolManagement as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolManagement as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolManagement with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNodePoolManagementRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setNodePoolManagement(request), expectedError); + }); + }); + + describe('setLabels', () => { + it('invokes setLabels without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLabelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); + const [response] = await client.setLabels(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLabels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLabels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLabels without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLabelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setLabels = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLabels( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLabels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLabels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLabels with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLabelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setLabels = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLabels(request), expectedError); + const actualRequest = (client.innerApiCalls.setLabels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLabels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLabels with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLabelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setLabels(request), expectedError); + }); + }); + + describe('setLegacyAbac', () => { + it('invokes setLegacyAbac without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLegacyAbacRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setLegacyAbac = stubSimpleCall(expectedResponse); + const [response] = await client.setLegacyAbac(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLegacyAbac as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLegacyAbac as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLegacyAbac without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLegacyAbacRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setLegacyAbac = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLegacyAbac( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLegacyAbac as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLegacyAbac as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLegacyAbac with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLegacyAbacRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setLegacyAbac = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLegacyAbac(request), expectedError); + const actualRequest = (client.innerApiCalls.setLegacyAbac as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLegacyAbac as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLegacyAbac with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLegacyAbacRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setLegacyAbac(request), expectedError); + }); + }); + + describe('startIPRotation', () => { + it('invokes startIPRotation without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.StartIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.startIpRotation = stubSimpleCall(expectedResponse); + const [response] = await client.startIPRotation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.startIpRotation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startIpRotation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startIPRotation without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.StartIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.startIpRotation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.startIPRotation( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.startIpRotation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startIpRotation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startIPRotation with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.StartIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startIpRotation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.startIPRotation(request), expectedError); + const actualRequest = (client.innerApiCalls.startIpRotation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startIpRotation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startIPRotation with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.StartIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.startIPRotation(request), expectedError); + }); + }); + + describe('completeIPRotation', () => { + it('invokes completeIPRotation without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CompleteIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.completeIpRotation = stubSimpleCall(expectedResponse); + const [response] = await client.completeIPRotation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.completeIpRotation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeIpRotation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeIPRotation without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CompleteIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.completeIpRotation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.completeIPRotation( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.completeIpRotation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeIpRotation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeIPRotation with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CompleteIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.completeIpRotation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.completeIPRotation(request), expectedError); + const actualRequest = (client.innerApiCalls.completeIpRotation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeIpRotation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeIPRotation with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CompleteIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.completeIPRotation(request), expectedError); + }); + }); + + describe('setNodePoolSize', () => { + it('invokes setNodePoolSize without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNodePoolSizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setNodePoolSize = stubSimpleCall(expectedResponse); + const [response] = await client.setNodePoolSize(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNodePoolSize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolSize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolSize without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNodePoolSizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setNodePoolSize = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setNodePoolSize( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNodePoolSize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolSize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolSize with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNodePoolSizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setNodePoolSize = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setNodePoolSize(request), expectedError); + const actualRequest = (client.innerApiCalls.setNodePoolSize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolSize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolSize with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNodePoolSizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setNodePoolSize(request), expectedError); + }); + }); + + describe('setNetworkPolicy', () => { + it('invokes setNetworkPolicy without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNetworkPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setNetworkPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setNetworkPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNetworkPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNetworkPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNetworkPolicy without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNetworkPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setNetworkPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setNetworkPolicy( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNetworkPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNetworkPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNetworkPolicy with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNetworkPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setNetworkPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setNetworkPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.setNetworkPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNetworkPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNetworkPolicy with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNetworkPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setNetworkPolicy(request), expectedError); + }); + }); + + describe('setMaintenancePolicy', () => { + it('invokes setMaintenancePolicy without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetMaintenancePolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setMaintenancePolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setMaintenancePolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMaintenancePolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMaintenancePolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMaintenancePolicy without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetMaintenancePolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setMaintenancePolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setMaintenancePolicy( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMaintenancePolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMaintenancePolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMaintenancePolicy with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetMaintenancePolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setMaintenancePolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setMaintenancePolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.setMaintenancePolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMaintenancePolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMaintenancePolicy with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetMaintenancePolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setMaintenancePolicy(request), expectedError); + }); + }); + + describe('checkAutopilotCompatibility', () => { + it('invokes checkAutopilotCompatibility without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CheckAutopilotCompatibilityRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CheckAutopilotCompatibilityRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.CheckAutopilotCompatibilityResponse() + ); + client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCall(expectedResponse); + const [response] = await client.checkAutopilotCompatibility(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAutopilotCompatibility without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CheckAutopilotCompatibilityRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CheckAutopilotCompatibilityRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.CheckAutopilotCompatibilityResponse() + ); + client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.checkAutopilotCompatibility( + request, + (err?: Error|null, result?: protos.google.container.v1.ICheckAutopilotCompatibilityResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAutopilotCompatibility with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CheckAutopilotCompatibilityRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CheckAutopilotCompatibilityRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkAutopilotCompatibility(request), expectedError); + const actualRequest = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAutopilotCompatibility with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CheckAutopilotCompatibilityRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CheckAutopilotCompatibilityRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.checkAutopilotCompatibility(request), expectedError); + }); + }); + + describe('listUsableSubnetworks', () => { + it('invokes listUsableSubnetworks without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), + ]; + client.innerApiCalls.listUsableSubnetworks = stubSimpleCall(expectedResponse); + const [response] = await client.listUsableSubnetworks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUsableSubnetworks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUsableSubnetworks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsableSubnetworks without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), + ]; + client.innerApiCalls.listUsableSubnetworks = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listUsableSubnetworks( + request, + (err?: Error|null, result?: protos.google.container.v1.IUsableSubnetwork[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUsableSubnetworks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUsableSubnetworks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsableSubnetworks with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listUsableSubnetworks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listUsableSubnetworks(request), expectedError); + const actualRequest = (client.innerApiCalls.listUsableSubnetworks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUsableSubnetworks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsableSubnetworksStream without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), + ]; + client.descriptors.page.listUsableSubnetworks.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listUsableSubnetworksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.container.v1.UsableSubnetwork[] = []; + stream.on('data', (response: protos.google.container.v1.UsableSubnetwork) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUsableSubnetworks, request)); + assert( + (client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listUsableSubnetworksStream with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listUsableSubnetworks.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listUsableSubnetworksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.container.v1.UsableSubnetwork[] = []; + stream.on('data', (response: protos.google.container.v1.UsableSubnetwork) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUsableSubnetworks, request)); + assert( + (client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUsableSubnetworks without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), + ]; + client.descriptors.page.listUsableSubnetworks.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.container.v1.IUsableSubnetwork[] = []; + const iterable = client.listUsableSubnetworksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUsableSubnetworks with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listUsableSubnetworks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listUsableSubnetworksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.container.v1.IUsableSubnetwork[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); +}); diff --git a/owl-bot-staging/google-container/v1/tsconfig.json b/owl-bot-staging/google-container/v1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-container/v1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/google-container/v1/webpack.config.js b/owl-bot-staging/google-container/v1/webpack.config.js new file mode 100644 index 00000000000..9032271af9d --- /dev/null +++ b/owl-bot-staging/google-container/v1/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 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. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'ClusterManager', + filename: './cluster-manager.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; diff --git a/owl-bot-staging/google-container/v1beta1/.eslintignore b/owl-bot-staging/google-container/v1beta1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-container/v1beta1/.eslintrc.json b/owl-bot-staging/google-container/v1beta1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-container/v1beta1/.gitignore b/owl-bot-staging/google-container/v1beta1/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-container/v1beta1/.jsdoc.js b/owl-bot-staging/google-container/v1beta1/.jsdoc.js new file mode 100644 index 00000000000..6dc18e81193 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2023 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/container', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-container/v1beta1/.mocharc.js b/owl-bot-staging/google-container/v1beta1/.mocharc.js new file mode 100644 index 00000000000..1a38f257db7 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-container/v1beta1/.prettierrc.js b/owl-bot-staging/google-container/v1beta1/.prettierrc.js new file mode 100644 index 00000000000..55639e70f9e --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-container/v1beta1/README.md b/owl-bot-staging/google-container/v1beta1/README.md new file mode 100644 index 00000000000..f32441d7e6b --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/README.md @@ -0,0 +1 @@ +Container: Nodejs Client diff --git a/owl-bot-staging/google-container/v1beta1/linkinator.config.json b/owl-bot-staging/google-container/v1beta1/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/owl-bot-staging/google-container/v1beta1/package.json b/owl-bot-staging/google-container/v1beta1/package.json new file mode 100644 index 00000000000..9795068794e --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/package.json @@ -0,0 +1,64 @@ +{ + "name": "@google-cloud/container", + "version": "0.1.0", + "description": "Container client for Node.js", + "repository": "googleapis/nodejs-container", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google container", + "container", + "cluster manager" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^3.5.7" + }, + "devDependencies": { + "@types/mocha": "^10.0.1", + "@types/node": "^18.11.18", + "@types/sinon": "^10.0.13", + "c8": "^7.12.0", + "gts": "^3.1.1", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.1", + "jsdoc-region-tag": "^2.0.1", + "linkinator": "^4.1.2", + "mocha": "^10.2.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^15.0.1", + "ts-loader": "^8.4.0", + "typescript": "^4.8.4", + "webpack": "^4.46.0", + "webpack-cli": "^4.10.0" + }, + "engines": { + "node": ">=v12" + } +} diff --git a/owl-bot-staging/google-container/v1beta1/protos/google/container/v1beta1/cluster_service.proto b/owl-bot-staging/google-container/v1beta1/protos/google/container/v1beta1/cluster_service.proto new file mode 100644 index 00000000000..d35034ce072 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/protos/google/container/v1beta1/cluster_service.proto @@ -0,0 +1,5617 @@ +// Copyright 2023 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. + +syntax = "proto3"; + +package google.container.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/rpc/code.proto"; +import "google/rpc/status.proto"; +import "google/type/date.proto"; + +option csharp_namespace = "Google.Cloud.Container.V1Beta1"; +option go_package = "cloud.google.com/go/container/apiv1beta1/containerpb;containerpb"; +option java_multiple_files = true; +option java_outer_classname = "ClusterServiceProto"; +option java_package = "com.google.container.v1beta1"; +option php_namespace = "Google\\Cloud\\Container\\V1beta1"; +option ruby_package = "Google::Cloud::Container::V1beta1"; +option (google.api.resource_definition) = { + type: "pubsub.googleapis.com/Topic" + pattern: "projects/{project}/topics/{topic}" +}; + +// Google Kubernetes Engine Cluster Manager v1beta1 +service ClusterManager { + option (google.api.default_host) = "container.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists all clusters owned by a project in either the specified zone or all + // zones. + rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/clusters" + additional_bindings { + get: "/v1beta1/projects/{project_id}/zones/{zone}/clusters" + } + }; + option (google.api.method_signature) = "project_id,zone"; + } + + // Gets the details for a specific cluster. + rpc GetCluster(GetClusterRequest) returns (Cluster) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/clusters/*}" + additional_bindings { + get: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id"; + } + + // 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](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). + // + // 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. + rpc CreateCluster(CreateClusterRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/clusters" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster"; + } + + // Updates the settings for a specific cluster. + rpc UpdateCluster(UpdateClusterRequest) returns (Operation) { + option (google.api.http) = { + put: "/v1beta1/{name=projects/*/locations/*/clusters/*}" + body: "*" + additional_bindings { + put: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id,update"; + } + + // Updates the version and/or image type of a specific node pool. + rpc UpdateNodePool(UpdateNodePoolRequest) returns (Operation) { + option (google.api.http) = { + put: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/update" + body: "*" + } + }; + } + + // Sets the autoscaling settings of a specific node pool. + rpc SetNodePoolAutoscaling(SetNodePoolAutoscalingRequest) + returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setAutoscaling" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/autoscaling" + body: "*" + } + }; + } + + // Sets the logging service for a specific cluster. + rpc SetLoggingService(SetLoggingServiceRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setLogging" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/logging" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,logging_service"; + } + + // Sets the monitoring service for a specific cluster. + rpc SetMonitoringService(SetMonitoringServiceRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setMonitoring" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/monitoring" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,monitoring_service"; + } + + // Sets the addons for a specific cluster. + rpc SetAddonsConfig(SetAddonsConfigRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setAddons" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/addons" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,addons_config"; + } + + // Sets the locations for a specific cluster. + // Deprecated. Use + // [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters/update) + // instead. + rpc SetLocations(SetLocationsRequest) returns (Operation) { + option deprecated = true; + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setLocations" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/locations" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,locations"; + } + + // Updates the master for a specific cluster. + rpc UpdateMaster(UpdateMasterRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:updateMaster" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/master" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,master_version"; + } + + // Sets master auth materials. Currently supports changing the admin password + // or a specific cluster, either via password generation or explicitly setting + // the password. + rpc SetMasterAuth(SetMasterAuthRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setMasterAuth" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setMasterAuth" + body: "*" + } + }; + } + + // 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. + rpc DeleteCluster(DeleteClusterRequest) returns (Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/clusters/*}" + additional_bindings { + delete: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id"; + } + + // Lists all operations in a project in the specified zone or all zones. + rpc ListOperations(ListOperationsRequest) returns (ListOperationsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/operations" + additional_bindings { + get: "/v1beta1/projects/{project_id}/zones/{zone}/operations" + } + }; + option (google.api.method_signature) = "project_id,zone"; + } + + // Gets the specified operation. + rpc GetOperation(GetOperationRequest) returns (Operation) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/operations/*}" + additional_bindings { + get: "/v1beta1/projects/{project_id}/zones/{zone}/operations/{operation_id}" + } + }; + option (google.api.method_signature) = "project_id,zone,operation_id"; + } + + // Cancels the specified operation. + rpc CancelOperation(CancelOperationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/operations/*}:cancel" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/operations/{operation_id}:cancel" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,zone,operation_id"; + } + + // Returns configuration info about the Google Kubernetes Engine service. + rpc GetServerConfig(GetServerConfigRequest) returns (ServerConfig) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*}/serverConfig" + additional_bindings { + get: "/v1beta1/projects/{project_id}/zones/{zone}/serverconfig" + } + }; + option (google.api.method_signature) = "project_id,zone"; + } + + // Gets the public component of the cluster signing keys in + // JSON Web Key format. + // This API is not yet intended for general use, and is not available for all + // clusters. + rpc GetJSONWebKeys(GetJSONWebKeysRequest) returns (GetJSONWebKeysResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/clusters/*}/jwks" + }; + } + + // Lists the node pools for a cluster. + rpc ListNodePools(ListNodePoolsRequest) returns (ListNodePoolsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/clusters/*}/nodePools" + additional_bindings { + get: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id"; + } + + // Retrieves the requested node pool. + rpc GetNodePool(GetNodePoolRequest) returns (NodePool) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}" + additional_bindings { + get: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,node_pool_id"; + } + + // Creates a node pool for a cluster. + rpc CreateNodePool(CreateNodePoolRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/clusters/*}/nodePools" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,node_pool"; + } + + // Deletes a node pool from a cluster. + rpc DeleteNodePool(DeleteNodePoolRequest) returns (Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}" + additional_bindings { + delete: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,node_pool_id"; + } + + // CompleteNodePoolUpgrade will signal an on-going node pool upgrade to + // complete. + rpc CompleteNodePoolUpgrade(CompleteNodePoolUpgradeRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:completeUpgrade" + body: "*" + }; + } + + // Rolls back a previously Aborted or Failed NodePool upgrade. + // This makes no changes if the last upgrade successfully completed. + rpc RollbackNodePoolUpgrade(RollbackNodePoolUpgradeRequest) + returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:rollback" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}:rollback" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,node_pool_id"; + } + + // Sets the NodeManagement options for a node pool. + rpc SetNodePoolManagement(SetNodePoolManagementRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setManagement" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/setManagement" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,node_pool_id,management"; + } + + // Sets labels on a cluster. + rpc SetLabels(SetLabelsRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setResourceLabels" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/resourceLabels" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,resource_labels,label_fingerprint"; + } + + // Enables or disables the ABAC authorization mechanism on a cluster. + rpc SetLegacyAbac(SetLegacyAbacRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setLegacyAbac" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/legacyAbac" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id,enabled"; + } + + // Starts master IP rotation. + rpc StartIPRotation(StartIPRotationRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:startIpRotation" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:startIpRotation" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id"; + } + + // Completes master IP rotation. + rpc CompleteIPRotation(CompleteIPRotationRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:completeIpRotation" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:completeIpRotation" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id"; + } + + // SetNodePoolSizeRequest sets the size of a node pool. The new size will be + // used for all replicas, including future replicas created by modifying + // [NodePool.locations][google.container.v1beta1.NodePool.locations]. + rpc SetNodePoolSize(SetNodePoolSizeRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setSize" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/setSize" + body: "*" + } + }; + } + + // Enables or disables Network Policy for a cluster. + rpc SetNetworkPolicy(SetNetworkPolicyRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setNetworkPolicy" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setNetworkPolicy" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,network_policy"; + } + + // Sets the maintenance policy for a cluster. + rpc SetMaintenancePolicy(SetMaintenancePolicyRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setMaintenancePolicy" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setMaintenancePolicy" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,maintenance_policy"; + } + + // Lists subnetworks that can be used for creating clusters in a project. + rpc ListUsableSubnetworks(ListUsableSubnetworksRequest) + returns (ListUsableSubnetworksResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*}/aggregated/usableSubnetworks" + }; + option (google.api.method_signature) = "parent"; + } + + // Checks the cluster compatibility with Autopilot mode, and returns a list of + // compatibility issues. + rpc CheckAutopilotCompatibility(CheckAutopilotCompatibilityRequest) + returns (CheckAutopilotCompatibilityResponse) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/clusters/*}:checkAutopilotCompatibility" + }; + } + + // Fetches locations that offer Google Kubernetes Engine. + rpc ListLocations(ListLocationsRequest) returns (ListLocationsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*}/locations" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Parameters that can be configured on Linux nodes. +message LinuxNodeConfig { + // Possible cgroup modes that can be used. + enum CgroupMode { + // CGROUP_MODE_UNSPECIFIED is when unspecified cgroup configuration is used. + // The default for the GKE node OS image will be used. + CGROUP_MODE_UNSPECIFIED = 0; + + // CGROUP_MODE_V1 specifies to use cgroupv1 for the cgroup configuration on + // the node image. + CGROUP_MODE_V1 = 1; + + // CGROUP_MODE_V2 specifies to use cgroupv2 for the cgroup configuration on + // the node image. + CGROUP_MODE_V2 = 2; + } + + // The Linux kernel parameters to be applied to the nodes and all pods running + // on the nodes. + // + // The following parameters are supported. + // + // net.core.busy_poll + // net.core.busy_read + // net.core.netdev_max_backlog + // net.core.rmem_max + // net.core.wmem_default + // net.core.wmem_max + // net.core.optmem_max + // net.core.somaxconn + // net.ipv4.tcp_rmem + // net.ipv4.tcp_wmem + // net.ipv4.tcp_tw_reuse + map sysctls = 1; + + // cgroup_mode specifies the cgroup mode to be used on the node. + CgroupMode cgroup_mode = 2; +} + +// Parameters that can be configured on Windows nodes. +// Windows Node Config that define the parameters that will be used to +// configure the Windows node pool settings +message WindowsNodeConfig { + // Possible OS version that can be used. + enum OSVersion { + // When OSVersion is not specified + OS_VERSION_UNSPECIFIED = 0; + + // LTSC2019 specifies to use LTSC2019 as the Windows Servercore Base Image + OS_VERSION_LTSC2019 = 1; + + // LTSC2022 specifies to use LTSC2022 as the Windows Servercore Base Image + OS_VERSION_LTSC2022 = 2; + } + + // OSVersion specifies the Windows node config to be used on the node + OSVersion os_version = 1; +} + +// Node kubelet configs. +message NodeKubeletConfig { + // Control the CPU management policy on the node. + // See + // https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/ + // + // The following values are allowed. + // * "none": the default, which represents the existing scheduling behavior. + // * "static": allows pods with certain resource characteristics to be granted + // increased CPU affinity and exclusivity on the node. + // The default value is 'none' if unspecified. + string cpu_manager_policy = 1; + + // Enable CPU CFS quota enforcement for containers that specify CPU limits. + // + // This option is enabled by default which makes kubelet use CFS quota + // (https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt) to + // enforce container CPU limits. Otherwise, CPU limits will not be enforced at + // all. + // + // Disable this option to mitigate CPU throttling problems while still having + // your pods to be in Guaranteed QoS class by specifying the CPU limits. + // + // The default value is 'true' if unspecified. + google.protobuf.BoolValue cpu_cfs_quota = 2; + + // Set the CPU CFS quota period value 'cpu.cfs_period_us'. + // + // The string must be a sequence of decimal numbers, each with optional + // fraction and a unit suffix, such as "300ms". + // Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". + // The value must be a positive duration. + string cpu_cfs_quota_period = 3; + + // Set the Pod PID limits. See + // https://kubernetes.io/docs/concepts/policy/pid-limiting/#pod-pid-limits + // + // Controls the maximum number of processes allowed to run in a pod. The value + // must be greater than or equal to 1024 and less than 4194304. + int64 pod_pids_limit = 4; + + // Enable or disable Kubelet read only port. + optional bool insecure_kubelet_readonly_port_enabled = 7; +} + +// Parameters that describe the nodes in a cluster. +// +// GKE Autopilot clusters do not +// recognize parameters in `NodeConfig`. Use +// [AutoprovisioningNodePoolDefaults][google.container.v1beta1.AutoprovisioningNodePoolDefaults] +// instead. +message NodeConfig { + // The name of a Google Compute Engine [machine + // type](https://cloud.google.com/compute/docs/machine-types). + // + // If unspecified, the default machine type is + // `e2-medium`. + string machine_type = 1; + + // 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. + int32 disk_size_gb = 2; + + // 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](https://cloud.google.com/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. + repeated string oauth_scopes = 3; + + // The Google Cloud Platform Service Account to be used by the node VMs. + // Specify the email address of the Service Account; otherwise, if no Service + // Account is specified, the "default" service account is used. + string service_account = 9; + + // 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-oslogin" + // - "gci-ensure-gke-docker" + // - "gci-metrics-enabled" + // - "gci-update-strategy" + // - "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" + // + // 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. + map metadata = 4; + + // The image type to use for this node. Note that for a given image type, + // the latest version of it will be used. Please see + // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for + // available image types. + string image_type = 5; + + // 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/ + map labels = 6; + + // 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. + int32 local_ssd_count = 7; + + // 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. + repeated string tags = 8; + + // 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. + bool preemptible = 10; + + // 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. + repeated AcceleratorConfig accelerators = 11; + + // Sandbox configuration for this node. + SandboxConfig sandbox_config = 17; + + // Setting this field will assign instances of this + // pool to run on the specified node group. This is useful for running + // workloads on [sole tenant + // nodes](https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes). + string node_group = 18; + + // The optional reservation affinity. Setting this field will apply + // the specified [Zonal Compute + // Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources) + // to this node pool. + ReservationAffinity reservation_affinity = 19; + + // Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or + // 'pd-balanced') + // + // If unspecified, the default disk type is 'pd-standard' + string disk_type = 12; + + // 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](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform). + string min_cpu_platform = 13; + + // The workload metadata configuration for this node. + WorkloadMetadataConfig workload_metadata_config = 14; + + // 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/ + repeated NodeTaint taints = 15; + + // + // The Customer Managed Encryption Key used to encrypt the boot disk attached + // to each node in the node pool. This should be of the form + // projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. + // For more information about protecting resources with Cloud KMS Keys please + // see: + // https://cloud.google.com/compute/docs/disks/customer-managed-encryption + string boot_disk_kms_key = 23; + + // Shielded Instance options. + ShieldedInstanceConfig shielded_instance_config = 20; + + // Parameters that can be configured on Linux nodes. + LinuxNodeConfig linux_node_config = 21; + + // Node kubelet configs. + NodeKubeletConfig kubelet_config = 22; + + // Parameters for the ephemeral storage filesystem. + // If unspecified, ephemeral storage is backed by the boot disk. + EphemeralStorageConfig ephemeral_storage_config = 24; + + // GCFS (Google Container File System) configs. + GcfsConfig gcfs_config = 25; + + // Advanced features for the Compute Engine VM. + AdvancedMachineFeatures advanced_machine_features = 26; + + // Enable or disable gvnic on the node pool. + VirtualNIC gvnic = 29; + + // Spot flag for enabling Spot VM, which is a rebrand of + // the existing preemptible flag. + bool spot = 32; + + // Confidential nodes config. + // All the nodes in the node pool will be Confidential VM once enabled. + ConfidentialNodes confidential_nodes = 35; + + // Enable or disable NCCL fast socket for the node pool. + optional FastSocket fast_socket = 36; + + // The resource labels for the node pool to use to annotate any related + // Google Compute Engine resources. + map resource_labels = 37; + + // Logging configuration. + NodePoolLoggingConfig logging_config = 38; + + // Parameters that can be configured on Windows nodes. + WindowsNodeConfig windows_node_config = 39; + + // Parameters for using raw-block Local NVMe SSDs. + LocalNvmeSsdBlockConfig local_nvme_ssd_block_config = 40; + + // Parameters for the node ephemeral storage using Local SSDs. + // If unspecified, ephemeral storage is backed by the boot disk. + // This field is functionally equivalent to the ephemeral_storage_config + EphemeralStorageLocalSsdConfig ephemeral_storage_local_ssd_config = 41; + + // Parameters for node pools to be backed by shared sole tenant node groups. + SoleTenantConfig sole_tenant_config = 42; +} + +// Specifies options for controlling advanced machine features. +message AdvancedMachineFeatures { + // The number of threads per physical core. To disable simultaneous + // multithreading (SMT) set this to 1. If unset, the maximum number of threads + // supported per core by the underlying processor is assumed. + optional int64 threads_per_core = 1; +} + +// Parameters for node pool-level network config. +message NodeNetworkConfig { + // Configuration of all network bandwidth tiers + message NetworkPerformanceConfig { + // Node network tier + enum Tier { + // Default value + TIER_UNSPECIFIED = 0; + + // Higher bandwidth, actual values based on VM size. + TIER_1 = 1; + } + + // Specifies the total network bandwidth tier for the NodePool. + optional Tier total_egress_bandwidth_tier = 1; + + // Specifies the network bandwidth tier for the NodePool for traffic to + // external/public IP addresses. + optional Tier external_ip_egress_bandwidth_tier = 2; + } + + // Input only. Whether to create a new range for pod IPs in this node pool. + // Defaults are provided for `pod_range` and `pod_ipv4_cidr_block` if they + // are not specified. + // + // If neither `create_pod_range` or `pod_range` are specified, the + // cluster-level default (`ip_allocation_policy.cluster_ipv4_cidr_block`) is + // used. + // + // Only applicable if `ip_allocation_policy.use_ip_aliases` is true. + // + // This field cannot be changed after the node pool has been created. + bool create_pod_range = 4 [(google.api.field_behavior) = INPUT_ONLY]; + + // The ID of the secondary range for pod IPs. + // If `create_pod_range` is true, this ID is used for the new range. + // If `create_pod_range` is false, uses an existing secondary range with this + // ID. + // + // Only applicable if `ip_allocation_policy.use_ip_aliases` is true. + // + // This field cannot be changed after the node pool has been created. + string pod_range = 5; + + // The IP address range for pod IPs in this node pool. + // + // Only applicable if `create_pod_range` 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](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `10.96.0.0/14`) to pick a specific range to use. + // + // Only applicable if `ip_allocation_policy.use_ip_aliases` is true. + // + // This field cannot be changed after the node pool has been created. + string pod_ipv4_cidr_block = 6; + + // Whether nodes have internal IP addresses only. + // If enable_private_nodes is not specified, then the value is derived from + // [cluster.privateClusterConfig.enablePrivateNodes][google.container.v1beta1.PrivateClusterConfig.enablePrivateNodes] + optional bool enable_private_nodes = 9; + + // Network bandwidth tier configuration. + optional NetworkPerformanceConfig network_performance_config = 11; + + // [PRIVATE FIELD] + // Pod CIDR size overprovisioning config for the nodepool. + // + // Pod CIDR size per node depends on max_pods_per_node. By default, the value + // of max_pods_per_node is rounded off to next power of 2 and we then double + // that to get the size of pod CIDR block per node. + // Example: max_pods_per_node of 30 would result in 64 IPs (/26). + // + // This config can disable the doubling of IPs (we still round off to next + // power of 2) + // Example: max_pods_per_node of 30 will result in 32 IPs (/27) when + // overprovisioning is disabled. + PodCIDROverprovisionConfig pod_cidr_overprovision_config = 13; + + // Output only. [Output only] The utilization of the IPv4 range for the pod. + // The ratio is Usage/[Total number of IPs in the secondary range], + // Usage=numNodes*numZones*podIPsPerNode. + double pod_ipv4_range_utilization = 16 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A set of Shielded Instance options. +message ShieldedInstanceConfig { + // 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. + bool enable_secure_boot = 1; + + // 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. + bool enable_integrity_monitoring = 2; +} + +// SandboxConfig contains configurations of the sandbox to use for the node. +message SandboxConfig { + // Possible types of sandboxes. + enum Type { + // Default value. This should not be used. + UNSPECIFIED = 0; + + // Run sandbox using gvisor. + GVISOR = 1; + } + + // Type of the sandbox to use for the node (e.g. 'gvisor') + string sandbox_type = 1 [deprecated = true]; + + // Type of the sandbox to use for the node. + Type type = 2; +} + +// EphemeralStorageConfig contains configuration for the ephemeral storage +// filesystem. +message EphemeralStorageConfig { + // Number of local SSDs to use to back ephemeral storage. Uses NVMe + // interfaces. Each local SSD is 375 GB in size. + // If zero, it means to disable using local SSDs as ephemeral storage. + int32 local_ssd_count = 1; +} + +// LocalNvmeSsdBlockConfig contains configuration for using raw-block local +// NVMe SSDs +message LocalNvmeSsdBlockConfig { + // The number of raw-block local NVMe SSD disks to be attached to the node. + // Each local SSD is 375 GB in size. If zero, it means no raw-block local NVMe + // 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. + int32 local_ssd_count = 1; +} + +// EphemeralStorageLocalSsdConfig contains configuration for the node ephemeral +// storage using Local SSDs. +message EphemeralStorageLocalSsdConfig { + // Number of local SSDs to use to back ephemeral storage. Uses NVMe + // interfaces. Each local SSD is 375 GB in size. + // If zero, it means to disable using local SSDs as ephemeral storage. + // 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. + int32 local_ssd_count = 1; +} + +// GcfsConfig contains configurations of Google Container File System. +message GcfsConfig { + // Whether to use GCFS. + bool enabled = 1; +} + +// [ReservationAffinity](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources) +// is the configuration of desired reservation which instances could take +// capacity from. +message ReservationAffinity { + // Indicates whether to consume capacity from a reservation or not. + enum Type { + // Default value. This should not be used. + UNSPECIFIED = 0; + + // Do not consume from any reserved capacity. + NO_RESERVATION = 1; + + // Consume any reservation available. + ANY_RESERVATION = 2; + + // Must consume from a specific reservation. Must specify key value fields + // for specifying the reservations. + SPECIFIC_RESERVATION = 3; + } + + // Corresponds to the type of reservation consumption. + Type consume_reservation_type = 1; + + // Corresponds to the label key of a reservation resource. To target a + // SPECIFIC_RESERVATION by name, specify + // "compute.googleapis.com/reservation-name" as the key and specify the name + // of your reservation as its value. + string key = 2; + + // Corresponds to the label value(s) of reservation resource(s). + repeated string values = 3; +} + +// SoleTenantConfig contains the NodeAffinities to specify what shared sole +// tenant node groups should back the node pool. +message SoleTenantConfig { + // Specifies the NodeAffinity key, values, and affinity operator according to + // [shared sole tenant node group + // affinities](https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes#node_affinity_and_anti-affinity). + message NodeAffinity { + // Operator allows user to specify affinity or anti-affinity for the + // given key values. + enum Operator { + // Invalid or unspecified affinity operator. + OPERATOR_UNSPECIFIED = 0; + + // Affinity operator. + IN = 1; + + // Anti-affinity operator. + NOT_IN = 2; + } + + // Key for NodeAffinity. + string key = 1; + + // Operator for NodeAffinity. + Operator operator = 2; + + // Values for NodeAffinity. + repeated string values = 3; + } + + // NodeAffinities used to match to a shared sole tenant node group. + repeated NodeAffinity node_affinities = 1; +} + +// Kubernetes taint is composed of three fields: key, value, and effect. Effect +// can only be one of three types: NoSchedule, PreferNoSchedule or NoExecute. +// +// See +// [here](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration) +// for more information, including usage and the valid values. +message NodeTaint { + // Possible values for Effect in taint. + enum Effect { + // Not set + EFFECT_UNSPECIFIED = 0; + + // NoSchedule + NO_SCHEDULE = 1; + + // PreferNoSchedule + PREFER_NO_SCHEDULE = 2; + + // NoExecute + NO_EXECUTE = 3; + } + + // Key for taint. + string key = 1; + + // Value for taint. + string value = 2; + + // Effect for taint. + Effect effect = 3; +} + +// Collection of Kubernetes [node +// taints](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration). +message NodeTaints { + // List of node taints. + repeated NodeTaint taints = 1; +} + +// Collection of node-level [Kubernetes +// labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels). +message NodeLabels { + // Map of node label keys and node label values. + map labels = 1; +} + +// Collection of [GCP +// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). +message ResourceLabels { + // Map of node label keys and node label values. + map labels = 1; +} + +// Collection of Compute Engine network tags that can be applied to a node's +// underlying VM instance. (See `tags` field in +// [`NodeConfig`](/kubernetes-engine/docs/reference/rest/v1/NodeConfig)). +message NetworkTags { + // List of network tags. + repeated string tags = 1; +} + +// The authentication information for accessing the master endpoint. +// Authentication can be done using HTTP basic auth or using client +// certificates. +message MasterAuth { + // 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). + // + // Warning: basic authentication is deprecated, and will be removed in GKE + // control plane versions 1.19 and newer. For a list of recommended + // authentication methods, see: + // https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication + string username = 1 [deprecated = true]; + + // 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. + // + // Warning: basic authentication is deprecated, and will be removed in GKE + // control plane versions 1.19 and newer. For a list of recommended + // authentication methods, see: + // https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication + string password = 2 [deprecated = true]; + + // Configuration for client certificate authentication on the cluster. For + // clusters before v1.12, if no configuration is specified, a client + // certificate is issued. + ClientCertificateConfig client_certificate_config = 3; + + string cluster_ca_certificate = 100; + + // [Output only] Base64-encoded public certificate used by clients to + // authenticate to the cluster endpoint. + string client_certificate = 101; + + // [Output only] Base64-encoded private key used by clients to authenticate + // to the cluster endpoint. + string client_key = 102; +} + +// Configuration for client certificates on the cluster. +message ClientCertificateConfig { + // Issue a client certificate. + bool issue_client_certificate = 1; +} + +// Configuration for the addons that can be automatically spun up in the +// cluster, enabling additional functionality. +message AddonsConfig { + // Configuration for the HTTP (L7) load balancing controller addon, which + // makes it easy to set up HTTP load balancers for services in a cluster. + HttpLoadBalancing http_load_balancing = 1; + + // 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. + HorizontalPodAutoscaling horizontal_pod_autoscaling = 2; + + // 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 + KubernetesDashboard kubernetes_dashboard = 3 [deprecated = true]; + + // 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. + NetworkPolicyConfig network_policy_config = 4; + + // Configuration for Istio, an open platform to connect, manage, and secure + // microservices. + IstioConfig istio_config = 5 [deprecated = true]; + + // Configuration for the Cloud Run addon. The `IstioConfig` addon must be + // enabled in order to enable Cloud Run addon. This option can only be enabled + // at cluster creation time. + CloudRunConfig cloud_run_config = 7; + + // Configuration for NodeLocalDNS, a dns cache running on cluster nodes + DnsCacheConfig dns_cache_config = 8; + + // Configuration for the ConfigConnector add-on, a Kubernetes + // extension to manage hosted GCP services through the Kubernetes API + ConfigConnectorConfig config_connector_config = 10; + + // Configuration for the Compute Engine Persistent Disk CSI driver. + GcePersistentDiskCsiDriverConfig gce_persistent_disk_csi_driver_config = 11; + + // Configuration for the KALM addon, which manages the lifecycle of k8s + // applications. + KalmConfig kalm_config = 12 [deprecated = true]; + + // Configuration for the GCP Filestore CSI driver. + GcpFilestoreCsiDriverConfig gcp_filestore_csi_driver_config = 14; + + // Configuration for the Backup for GKE agent addon. + GkeBackupAgentConfig gke_backup_agent_config = 16; + + // Configuration for the Cloud Storage Fuse CSI driver. + GcsFuseCsiDriverConfig gcs_fuse_csi_driver_config = 17; +} + +// 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. +message HttpLoadBalancing { + // 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. + bool disabled = 1; +} + +// 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. +message HorizontalPodAutoscaling { + // Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. + // When enabled, it ensures that metrics are collected into Stackdriver + // Monitoring. + bool disabled = 1; +} + +// Configuration for the Kubernetes Dashboard. +message KubernetesDashboard { + // Whether the Kubernetes Dashboard is enabled for this cluster. + bool disabled = 1; +} + +// 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. +message NetworkPolicyConfig { + // Whether NetworkPolicy is enabled for this cluster. + bool disabled = 1; +} + +// Configuration for NodeLocal DNSCache +message DnsCacheConfig { + // Whether NodeLocal DNSCache is enabled for this cluster. + bool enabled = 1; +} + +// Configuration options for the KALM addon. +message KalmConfig { + // Whether KALM is enabled for this cluster. + bool enabled = 1 [deprecated = true]; +} + +// Configuration for the Backup for GKE Agent. +message GkeBackupAgentConfig { + // Whether the Backup for GKE agent is enabled for this cluster. + bool enabled = 1; +} + +// Configuration options for the Config Connector add-on. +message ConfigConnectorConfig { + // Whether Cloud Connector is enabled for this cluster. + bool enabled = 1; +} + +// Configuration for the Compute Engine PD CSI driver. +message GcePersistentDiskCsiDriverConfig { + // Whether the Compute Engine PD CSI driver is enabled for this cluster. + bool enabled = 1; +} + +// Configuration for the GCP Filestore CSI driver. +message GcpFilestoreCsiDriverConfig { + // Whether the GCP Filestore CSI driver is enabled for this cluster. + bool enabled = 1; +} + +// Configuration for the Cloud Storage Fuse CSI driver. +message GcsFuseCsiDriverConfig { + // Whether the Cloud Storage Fuse CSI driver is enabled for this cluster. + bool enabled = 1; +} + +// Configuration for controlling master global access settings. +message PrivateClusterMasterGlobalAccessConfig { + // Whenever master is accessible globally or not. + bool enabled = 1; +} + +// Configuration options for private clusters. +message PrivateClusterConfig { + // 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. + bool enable_private_nodes = 1; + + // Whether the master's internal IP address is used as the cluster endpoint. + bool enable_private_endpoint = 2; + + // 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. + string master_ipv4_cidr_block = 3; + + // Output only. The internal IP address of this cluster's master endpoint. + string private_endpoint = 4; + + // Output only. The external IP address of this cluster's master endpoint. + string public_endpoint = 5; + + // Output only. The peering name in the customer VPC used by this cluster. + string peering_name = 7; + + // Controls master global access settings. + PrivateClusterMasterGlobalAccessConfig master_global_access_config = 8; + + // Subnet to provision the master's private endpoint during cluster creation. + // Specified in projects/*/regions/*/subnetworks/* format. + string private_endpoint_subnetwork = 10; +} + +// Configuration options for Istio addon. +message IstioConfig { + // Istio auth mode, https://istio.io/docs/concepts/security/mutual-tls.html + enum IstioAuthMode { + // auth not enabled + AUTH_NONE = 0; + + // auth mutual TLS enabled + AUTH_MUTUAL_TLS = 1; + } + + // Whether Istio is enabled for this cluster. + bool disabled = 1 [deprecated = true]; + + // The specified Istio auth mode, either none, or mutual TLS. + IstioAuthMode auth = 2 [deprecated = true]; +} + +// Configuration options for the Cloud Run feature. +message CloudRunConfig { + // Load balancer type of ingress service of Cloud Run. + enum LoadBalancerType { + // Load balancer type for Cloud Run is unspecified. + LOAD_BALANCER_TYPE_UNSPECIFIED = 0; + + // Install external load balancer for Cloud Run. + LOAD_BALANCER_TYPE_EXTERNAL = 1; + + // Install internal load balancer for Cloud Run. + LOAD_BALANCER_TYPE_INTERNAL = 2; + } + + // Whether Cloud Run addon is enabled for this cluster. + bool disabled = 1; + + // Which load balancer type is installed for Cloud Run. + LoadBalancerType load_balancer_type = 3; +} + +// 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. +message MasterAuthorizedNetworksConfig { + // CidrBlock contains an optional name and one CIDR block. + message CidrBlock { + // display_name is an optional field for users to identify CIDR blocks. + string display_name = 1; + + // cidr_block must be specified in CIDR notation. + string cidr_block = 2; + } + + // Whether or not master authorized networks is enabled. + bool enabled = 1; + + // cidr_blocks define up to 10 external networks that could access + // Kubernetes master through HTTPS. + repeated CidrBlock cidr_blocks = 2; + + // Whether master is accessbile via Google Compute Engine Public IP addresses. + optional bool gcp_public_cidrs_access_enabled = 3; +} + +// Configuration for the legacy Attribute Based Access Control authorization +// mode. +message LegacyAbac { + // 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. + bool enabled = 1; +} + +// Configuration options for the NetworkPolicy feature. +// https://kubernetes.io/docs/concepts/services-networking/networkpolicies/ +message NetworkPolicy { + // Allowed Network Policy providers. + enum Provider { + // Not set + PROVIDER_UNSPECIFIED = 0; + + // Tigera (Calico Felix). + CALICO = 1; + } + + // The selected network policy provider. + Provider provider = 1; + + // Whether network policy is enabled on the cluster. + bool enabled = 2; +} + +// [PRIVATE FIELD] +// Config for pod CIDR size overprovisioning. +message PodCIDROverprovisionConfig { + // Whether Pod CIDR overprovisioning is disabled. + // Note: Pod CIDR overprovisioning is enabled by default. + bool disable = 1; +} + +// Configuration for controlling how IPs are allocated in the cluster. +message IPAllocationPolicy { + // Possible values for IP stack type + enum StackType { + // By default, the clusters will be IPV4 only + STACK_TYPE_UNSPECIFIED = 0; + + // The value used if the cluster is a IPV4 only + IPV4 = 1; + + // The value used if the cluster is a dual stack cluster + IPV4_IPV6 = 2; + } + + // IPv6 access type + enum IPv6AccessType { + // Default value, will be defaulted as type external. + IPV6_ACCESS_TYPE_UNSPECIFIED = 0; + + // Access type internal (all v6 addresses are internal IPs) + INTERNAL = 1; + + // Access type external (all v6 addresses are external IPs) + EXTERNAL = 2; + } + + // Whether alias IPs will be used for pod IPs in the cluster. + // This is used in conjunction with use_routes. It cannot + // be true if use_routes is true. If both use_ip_aliases and use_routes are + // false, then the server picks the default IP allocation mode + bool use_ip_aliases = 1; + + // Whether a new subnetwork will be created automatically for the cluster. + // + // This field is only applicable when `use_ip_aliases` is true. + bool create_subnetwork = 2; + + // 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. + string subnetwork_name = 3; + + // This field is deprecated, use cluster_ipv4_cidr_block. + string cluster_ipv4_cidr = 4 [deprecated = true]; + + // This field is deprecated, use node_ipv4_cidr_block. + string node_ipv4_cidr = 5 [deprecated = true]; + + // This field is deprecated, use services_ipv4_cidr_block. + string services_ipv4_cidr = 6 [deprecated = true]; + + // 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 and + // create_subnetwork is false. + string cluster_secondary_range_name = 7; + + // 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 and + // create_subnetwork is false. + string services_secondary_range_name = 8; + + // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // 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. + string cluster_ipv4_cidr_block = 9; + + // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // 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. + string node_ipv4_cidr_block = 10; + + // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // 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. + string services_ipv4_cidr_block = 11; + + // If true, allow allocation of cluster CIDR ranges that overlap with certain + // kinds of network routes. By default we do not allow cluster CIDR ranges to + // intersect with any user declared routes. With allow_route_overlap == true, + // we allow overlapping with CIDR ranges that are larger than the cluster CIDR + // range. + // + // If this field is set to true, then cluster and services CIDRs must be + // fully-specified (e.g. `10.96.0.0/14`, but not `/14`), which means: + // 1) When `use_ip_aliases` is true, `cluster_ipv4_cidr_block` and + // `services_ipv4_cidr_block` must be fully-specified. + // 2) When `use_ip_aliases` is false, `cluster.cluster_ipv4_cidr` muse be + // fully-specified. + bool allow_route_overlap = 12; + + // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // 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. + // This field is deprecated, use cluster.tpu_config.ipv4_cidr_block instead. + string tpu_ipv4_cidr_block = 13; + + // Whether routes will be used for pod IPs in the cluster. + // This is used in conjunction with use_ip_aliases. It cannot be true if + // use_ip_aliases is true. If both use_ip_aliases and use_routes are false, + // then the server picks the default IP allocation mode + bool use_routes = 15; + + // IP stack type + StackType stack_type = 16; + + // The ipv6 access type (internal or external) when create_subnetwork is true + IPv6AccessType ipv6_access_type = 17; + + // [PRIVATE FIELD] + // Pod CIDR size overprovisioning config for the cluster. + // + // Pod CIDR size per node depends on max_pods_per_node. By default, the value + // of max_pods_per_node is doubled and then rounded off to next power of 2 to + // get the size of pod CIDR block per node. + // Example: max_pods_per_node of 30 would result in 64 IPs (/26). + // + // This config can disable the doubling of IPs (we still round off to next + // power of 2) + // Example: max_pods_per_node of 30 will result in 32 IPs (/27) when + // overprovisioning is disabled. + PodCIDROverprovisionConfig pod_cidr_overprovision_config = 21; + + // Output only. [Output only] The subnet's IPv6 CIDR block used by nodes and + // pods. + string subnet_ipv6_cidr_block = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output only] The services IPv6 CIDR block for the cluster. + string services_ipv6_cidr_block = 23 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output only] The additional pod ranges that are added to the + // cluster. These pod ranges can be used by new node pools to allocate pod IPs + // automatically. Once the range is removed it will not show up in + // IPAllocationPolicy. + AdditionalPodRangesConfig additional_pod_ranges_config = 24 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output only] The utilization of the cluster default IPv4 + // range for the pod. The ratio is Usage/[Total number of IPs in the secondary + // range], Usage=numNodes*numZones*podIPsPerNode. + double default_pod_ipv4_range_utilization = 25 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Configuration for Binary Authorization. +message BinaryAuthorization { + // Binary Authorization mode of operation. + enum EvaluationMode { + // Default value + EVALUATION_MODE_UNSPECIFIED = 0; + + // Disable BinaryAuthorization + DISABLED = 1; + + // Enforce Kubernetes admission requests with BinaryAuthorization using the + // project's singleton policy. This is equivalent to setting the + // enabled boolean to true. + PROJECT_SINGLETON_POLICY_ENFORCE = 2; + } + + // This field is deprecated. Leave this unset and instead configure + // BinaryAuthorization using evaluation_mode. If evaluation_mode is set to + // anything other than EVALUATION_MODE_UNSPECIFIED, this field is ignored. + bool enabled = 1 [deprecated = true]; + + // Mode of operation for binauthz policy evaluation. If unspecified, defaults + // to DISABLED. + EvaluationMode evaluation_mode = 2; +} + +// Configuration for the PodSecurityPolicy feature. +message PodSecurityPolicyConfig { + // Enable the PodSecurityPolicy controller for this cluster. If enabled, pods + // must be valid under a PodSecurityPolicy to be created. + bool enabled = 1; +} + +// Configuration for returning group information from authenticators. +message AuthenticatorGroupsConfig { + // Whether this cluster should return group membership lookups + // during authentication using a group of security groups. + bool enabled = 1; + + // The name of the security group-of-groups to be used. Only relevant + // if enabled = true. + string security_group = 2; +} + +// Telemetry integration for the cluster. +message ClusterTelemetry { + // Type of the integration. + enum Type { + // Not set. + UNSPECIFIED = 0; + + // Monitoring integration is disabled. + DISABLED = 1; + + // Monitoring integration is enabled. + ENABLED = 2; + + // Only system components are monitored and logged. + SYSTEM_ONLY = 3; + } + + // Type of the integration. + Type type = 1; +} + +// A Google Kubernetes Engine cluster. +message Cluster { + // The current status of the cluster. + enum Status { + // Not set. + STATUS_UNSPECIFIED = 0; + + // The PROVISIONING state indicates the cluster is being created. + PROVISIONING = 1; + + // The RUNNING state indicates the cluster has been created and is fully + // usable. + RUNNING = 2; + + // 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. + RECONCILING = 3; + + // The STOPPING state indicates the cluster is being deleted. + STOPPING = 4; + + // The ERROR state indicates the cluster may be unusable. Details + // can be found in the `statusMessage` field. + ERROR = 5; + + // The DEGRADED state indicates the cluster requires user action to restore + // full functionality. Details can be found in the `statusMessage` field. + DEGRADED = 6; + } + + // 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. + string name = 1; + + // An optional description of this cluster. + string description = 2; + + // The number of nodes to create in this cluster. You must ensure that your + // 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 + // "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. + int32 initial_node_count = 3 [deprecated = true]; + + // 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. + NodeConfig node_config = 4 [deprecated = true]; + + // 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. + MasterAuth master_auth = 5; + + // The logging service the cluster should use to write logs. + // Currently available options: + // + // * `logging.googleapis.com/kubernetes` - The Cloud Logging + // service with a Kubernetes-native resource model + // * `logging.googleapis.com` - The legacy Cloud Logging service (no longer + // available as of GKE 1.15). + // * `none` - no logs will be exported from the cluster. + // + // If left as an empty string,`logging.googleapis.com/kubernetes` will be + // used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. + string logging_service = 6; + + // The monitoring service the cluster should use to write metrics. + // Currently available options: + // + // * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring + // service with a Kubernetes-native resource model + // * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no + // longer available as of GKE 1.15). + // * `none` - No metrics will be exported from the cluster. + // + // If left as an empty string,`monitoring.googleapis.com/kubernetes` will be + // used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. + string monitoring_service = 7; + + // The name of the Google Compute Engine + // [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) + // to which the cluster is connected. If left unspecified, the `default` + // network will be used. On output this shows the network ID instead of the + // name. + string network = 8; + + // The IP address range of the container pods in this cluster, in + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // 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`. + string cluster_ipv4_cidr = 9; + + // Configurations for the various addons available to run in the cluster. + AddonsConfig addons_config = 10; + + // The name of the Google Compute Engine + // [subnetwork](https://cloud.google.com/compute/docs/subnetworks) to which + // the cluster is connected. On output this shows the subnetwork ID instead of + // the name. + string subnetwork = 11; + + // The node pools associated with this cluster. + // This field should not be set if "node_config" or "initial_node_count" are + // specified. + repeated NodePool node_pools = 12; + + // The list of Google Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster's nodes should be located. + // + // This field provides a default value if + // [NodePool.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools#NodePool.FIELDS.locations) + // are not specified during node pool creation. + // + // Warning: changing cluster locations will update the + // [NodePool.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools#NodePool.FIELDS.locations) + // of all node pools and will result in nodes being added and/or removed. + repeated string locations = 13; + + // Kubernetes alpha features are enabled on this cluster. This includes alpha + // API groups (e.g. v1beta1) 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. + bool enable_kubernetes_alpha = 14; + + // Kubernetes open source beta apis enabled on the cluster. Only beta apis. + K8sBetaAPIConfig enable_k8s_beta_apis = 143; + + // The resource labels for the cluster to use to annotate any related + // Google Compute Engine resources. + map resource_labels = 15; + + // The fingerprint of the set of labels for this cluster. + string label_fingerprint = 16; + + // Configuration for the legacy ABAC authorization mode. + LegacyAbac legacy_abac = 18; + + // Configuration options for the NetworkPolicy feature. + NetworkPolicy network_policy = 19; + + // Configuration for cluster IP allocation. + IPAllocationPolicy ip_allocation_policy = 20; + + // The configuration options for master authorized networks feature. + MasterAuthorizedNetworksConfig master_authorized_networks_config = 22; + + // Configure the maintenance policy for this cluster. + MaintenancePolicy maintenance_policy = 23; + + // Configuration for Binary Authorization. + BinaryAuthorization binary_authorization = 24; + + // Configuration for the PodSecurityPolicy feature. + PodSecurityPolicyConfig pod_security_policy_config = 25; + + // Cluster-level autoscaling configuration. + ClusterAutoscaling autoscaling = 26; + + // Configuration for cluster networking. + NetworkConfig network_config = 27; + + // If this is a private cluster setup. Private clusters are clusters that, by + // default have no external IP addresses on the nodes and where nodes and the + // master communicate over private IP addresses. + // This field is deprecated, use private_cluster_config.enable_private_nodes + // instead. + bool private_cluster = 28 [deprecated = true]; + + // The IP prefix in CIDR notation to use for the hosted master network. + // This prefix will be used for assigning private IP addresses to the + // master or set of masters, as well as the ILB VIP. + // This field is deprecated, use + // private_cluster_config.master_ipv4_cidr_block instead. + string master_ipv4_cidr_block = 29 [deprecated = true]; + + // 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. + MaxPodsConstraint default_max_pods_constraint = 30; + + // Configuration for exporting resource usages. Resource usage export is + // disabled when this config unspecified. + ResourceUsageExportConfig resource_usage_export_config = 33; + + // Configuration controlling RBAC group membership information. + AuthenticatorGroupsConfig authenticator_groups_config = 34; + + // Configuration for private cluster. + PrivateClusterConfig private_cluster_config = 37; + + // Cluster-level Vertical Pod Autoscaling configuration. + VerticalPodAutoscaling vertical_pod_autoscaling = 39; + + // Shielded Nodes configuration. + ShieldedNodes shielded_nodes = 40; + + // Release channel configuration. If left unspecified on cluster creation and + // a version is specified, the cluster is enrolled in the most mature release + // channel where the version is available (first checking STABLE, then + // REGULAR, and finally RAPID). Otherwise, if no release channel + // configuration and no version is specified, the cluster is enrolled in the + // REGULAR channel with its default version. + ReleaseChannel release_channel = 41; + + // Configuration for the use of Kubernetes Service Accounts in GCP IAM + // policies. + WorkloadIdentityConfig workload_identity_config = 43; + + // Configuration for issuance of mTLS keys and certificates to Kubernetes + // pods. + WorkloadCertificates workload_certificates = 52; + + // Configuration for issuance of mTLS keys and certificates to Kubernetes + // pods. + MeshCertificates mesh_certificates = 67; + + // Configuration for direct-path (via ALTS) with workload identity. + WorkloadALTSConfig workload_alts_config = 53; + + // Configuration for the fine-grained cost management feature. + CostManagementConfig cost_management_config = 45; + + // Telemetry integration for the cluster. + ClusterTelemetry cluster_telemetry = 46; + + // Configuration for Cloud TPU support; + TpuConfig tpu_config = 47; + + // Notification configuration of the cluster. + NotificationConfig notification_config = 49; + + // Configuration of Confidential Nodes. + // All the nodes in the cluster will be Confidential VM once enabled. + ConfidentialNodes confidential_nodes = 50; + + // Configuration for Identity Service component. + IdentityServiceConfig identity_service_config = 54; + + // [Output only] Server-defined URL for the resource. + string self_link = 100; + + // [Output only] The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field is deprecated, use location instead. + string zone = 101 [deprecated = true]; + + // [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. + string endpoint = 102; + + // 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 + string initial_cluster_version = 103; + + // [Output only] The current software version of the master endpoint. + string current_master_version = 104; + + // [Output only] Deprecated, use + // [NodePool.version](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters.nodePools) + // 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. + string current_node_version = 105 [deprecated = true]; + + // [Output only] The time the cluster was created, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + string create_time = 106; + + // [Output only] The current status of this cluster. + Status status = 107; + + // [Output only] Deprecated. Use conditions instead. + // Additional information about the current status of this + // cluster, if available. + string status_message = 108 [deprecated = true]; + + // [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. + int32 node_ipv4_cidr_size = 109; + + // [Output only] The IP address range of the Kubernetes services in + // this cluster, in + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `1.2.3.4/29`). Service addresses are + // typically put in the last `/16` from the container CIDR. + string services_ipv4_cidr = 110; + + // Deprecated. Use node_pools.instance_group_urls. + repeated string instance_group_urls = 111 [deprecated = true]; + + // [Output only] The number of nodes currently in the cluster. Deprecated. + // Call Kubernetes API directly to retrieve node information. + int32 current_node_count = 112 [deprecated = true]; + + // [Output only] The time the cluster will be automatically + // deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + string expire_time = 113; + + // [Output only] The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) + // or + // [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) + // in which the cluster resides. + string location = 114; + + // Enable the ability to use Cloud TPUs in this cluster. + // This field is deprecated, use tpu_config.enabled instead. + bool enable_tpu = 115; + + // [Output only] The IP address range of the Cloud TPUs in this cluster, in + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `1.2.3.4/29`). + string tpu_ipv4_cidr_block = 116; + + // Configuration of etcd encryption. + DatabaseEncryption database_encryption = 38; + + // Which conditions caused the current cluster state. + repeated StatusCondition conditions = 118; + + // Configuration for master components. + Master master = 124; + + // Autopilot configuration for the cluster. + Autopilot autopilot = 128; + + // Output only. Unique id for the cluster. + string id = 129 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Default NodePool settings for the entire cluster. These settings are + // overridden if specified on the specific NodePool object. + optional NodePoolDefaults node_pool_defaults = 131; + + // Logging configuration for the cluster. + LoggingConfig logging_config = 132; + + // Monitoring configuration for the cluster. + MonitoringConfig monitoring_config = 133; + + // Node pool configs that apply to all auto-provisioned node pools + // in autopilot clusters and node auto-provisioning enabled clusters. + NodePoolAutoConfig node_pool_auto_config = 136; + + // Enable/Disable Protect API features for the cluster. + optional ProtectConfig protect_config = 137; + + // This checksum is computed by the server based on the value of cluster + // fields, and may be sent on update requests to ensure the client has an + // up-to-date value before proceeding. + string etag = 139; + + // Fleet information for the cluster. + Fleet fleet = 140; + + // Enable/Disable Security Posture API features for the cluster. + SecurityPostureConfig security_posture_config = 145; +} + +// Kubernetes open source beta apis enabled on the cluster. +message K8sBetaAPIConfig { + // api name, e.g. storage.k8s.io/v1beta1/csistoragecapacities. + repeated string enabled_apis = 1; +} + +// WorkloadConfig defines the flags to enable or disable the +// workload configurations for the cluster. +message WorkloadConfig { + // Mode defines how to audit the workload configs. + enum Mode { + // Default value meaning that no mode has been specified. + MODE_UNSPECIFIED = 0; + + // This disables Workload Configuration auditing on the cluster, + // meaning that nothing is surfaced. + DISABLED = 1; + + // Applies the default set of policy auditing to a cluster's workloads. + BASIC = 4; + + // Surfaces configurations that are not in line with the + // Pod Security Standard Baseline policy. + BASELINE = 2 [deprecated = true]; + + // Surfaces configurations that are not in line with the + // Pod Security Standard Restricted policy. + RESTRICTED = 3 [deprecated = true]; + } + + // Sets which mode of auditing should be used for the cluster's workloads. + optional Mode audit_mode = 1; +} + +// ProtectConfig defines the flags needed to enable/disable features for the +// Protect API. +message ProtectConfig { + // WorkloadVulnerabilityMode defines mode to perform vulnerability scanning. + enum WorkloadVulnerabilityMode { + // Default value not specified. + WORKLOAD_VULNERABILITY_MODE_UNSPECIFIED = 0; + + // Disables Workload Vulnerability Scanning feature on the cluster. + DISABLED = 1; + + // Applies basic vulnerability scanning settings for cluster workloads. + BASIC = 2; + } + + // WorkloadConfig defines which actions are enabled for a cluster's workload + // configurations. + optional WorkloadConfig workload_config = 1; + + // Sets which mode to use for Protect workload vulnerability scanning feature. + optional WorkloadVulnerabilityMode workload_vulnerability_mode = 2; +} + +// SecurityPostureConfig defines the flags needed to enable/disable features for +// the Security Posture API. +message SecurityPostureConfig { + // Mode defines enablement mode for GKE Security posture features. + enum Mode { + // Default value not specified. + MODE_UNSPECIFIED = 0; + + // Disables Security Posture features on the cluster. + DISABLED = 1; + + // Applies Security Posture features on the cluster. + BASIC = 2; + } + + // VulnerabilityMode defines enablement mode for vulnerability scanning. + enum VulnerabilityMode { + // Default value not specified. + VULNERABILITY_MODE_UNSPECIFIED = 0; + + // Disables vulnerability scanning on the cluster. + VULNERABILITY_DISABLED = 1; + + // Applies basic vulnerability scanning on the cluster. + VULNERABILITY_BASIC = 2; + } + + // Sets which mode to use for Security Posture features. + optional Mode mode = 1; + + // Sets which mode to use for vulnerability scanning. + optional VulnerabilityMode vulnerability_mode = 2; +} + +// Subset of Nodepool message that has defaults. +message NodePoolDefaults { + // Subset of NodeConfig message that has defaults. + NodeConfigDefaults node_config_defaults = 1; +} + +// Subset of NodeConfig message that has defaults. +message NodeConfigDefaults { + // GCFS (Google Container File System, also known as Riptide) options. + GcfsConfig gcfs_config = 1; + + // Logging configuration for node pools. + NodePoolLoggingConfig logging_config = 3; +} + +// node pool configs that apply to all auto-provisioned node pools +// in autopilot clusters and node auto-provisioning enabled clusters +message NodePoolAutoConfig { + // 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 creation. Each tag within the list + // must comply with RFC1035. + NetworkTags network_tags = 1; +} + +// 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. +message ClusterUpdate { + // 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 + string desired_node_version = 4; + + // The monitoring service the cluster should use to write metrics. + // Currently available options: + // + // * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring + // service with a Kubernetes-native resource model + // * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no + // longer available as of GKE 1.15). + // * `none` - No metrics will be exported from the cluster. + // + // If left as an empty string,`monitoring.googleapis.com/kubernetes` will be + // used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. + string desired_monitoring_service = 5; + + // Configurations for the various addons available to run in the cluster. + AddonsConfig desired_addons_config = 6; + + // The node pool to be upgraded. This field is mandatory if + // "desired_node_version", "desired_image_family", + // "desired_node_pool_autoscaling", or "desired_workload_metadata_config" + // is specified and there is more than one node pool on the cluster. + string desired_node_pool_id = 7; + + // The desired image type for the node pool. + // NOTE: Set the "desired_node_pool" field as well. + string desired_image_type = 8; + + // 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. + NodePoolAutoscaling desired_node_pool_autoscaling = 9; + + // The desired list of Google Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster's nodes should be located. + // + // This list must always include the cluster's primary zone. + // + // Warning: changing cluster locations will update the locations of all node + // pools and will result in nodes being added and/or removed. + repeated string desired_locations = 10; + + // The desired configuration options for master authorized networks feature. + MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12; + + // The desired configuration options for the PodSecurityPolicy feature. + PodSecurityPolicyConfig desired_pod_security_policy_config = 14; + + // Cluster-level autoscaling configuration. + ClusterAutoscaling desired_cluster_autoscaling = 15; + + // The desired configuration options for the Binary Authorization feature. + BinaryAuthorization desired_binary_authorization = 16; + + // The logging service the cluster should use to write logs. + // Currently available options: + // + // * `logging.googleapis.com/kubernetes` - The Cloud Logging + // service with a Kubernetes-native resource model + // * `logging.googleapis.com` - The legacy Cloud Logging service (no longer + // available as of GKE 1.15). + // * `none` - no logs will be exported from the cluster. + // + // If left as an empty string,`logging.googleapis.com/kubernetes` will be + // used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. + string desired_logging_service = 19; + + // The desired configuration for exporting resource usage. + ResourceUsageExportConfig desired_resource_usage_export_config = 21; + + // Cluster-level Vertical Pod Autoscaling configuration. + VerticalPodAutoscaling desired_vertical_pod_autoscaling = 22; + + // The desired private cluster configuration. + PrivateClusterConfig desired_private_cluster_config = 25; + + // The desired config of Intra-node visibility. + IntraNodeVisibilityConfig desired_intra_node_visibility_config = 26; + + // The desired status of whether to disable default sNAT for this cluster. + DefaultSnatStatus desired_default_snat_status = 28; + + // The desired telemetry integration for the cluster. + ClusterTelemetry desired_cluster_telemetry = 30; + + // The desired release channel configuration. + ReleaseChannel desired_release_channel = 31; + + // The desired Cloud TPU configuration. + TpuConfig desired_tpu_config = 38; + + // The desired L4 Internal Load Balancer Subsetting configuration. + ILBSubsettingConfig desired_l4ilb_subsetting_config = 39; + + // The desired datapath provider for the cluster. + DatapathProvider desired_datapath_provider = 50; + + // The desired state of IPv6 connectivity to Google Services. + PrivateIPv6GoogleAccess desired_private_ipv6_google_access = 51; + + // The desired notification configuration. + NotificationConfig desired_notification_config = 55; + + // The Kubernetes version to change the master to. The only valid value is the + // latest supported version. + // + // 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 + string desired_master_version = 100; + + // The desired GCFS config for the cluster. + GcfsConfig desired_gcfs_config = 109; + + // Configuration of etcd encryption. + DatabaseEncryption desired_database_encryption = 46; + + // Configuration for Workload Identity. + WorkloadIdentityConfig desired_workload_identity_config = 47; + + // Configuration for issuance of mTLS keys and certificates to Kubernetes + // pods. + WorkloadCertificates desired_workload_certificates = 61; + + // Configuration for issuance of mTLS keys and certificates to Kubernetes + // pods. + MeshCertificates desired_mesh_certificates = 67; + + // Configuration for direct-path (via ALTS) with workload identity. + WorkloadALTSConfig desired_workload_alts_config = 62; + + // Configuration for Shielded Nodes. + ShieldedNodes desired_shielded_nodes = 48; + + // The desired configuration for the fine-grained cost management feature. + CostManagementConfig desired_cost_management_config = 49; + + // Configuration for master components. + Master desired_master = 52; + + // DNSConfig contains clusterDNS config for this cluster. + DNSConfig desired_dns_config = 53; + + // ServiceExternalIPsConfig specifies the config for the use of Services with + // ExternalIPs field. + ServiceExternalIPsConfig desired_service_external_ips_config = 60; + + // AuthenticatorGroupsConfig specifies the config for the cluster security + // groups settings. + AuthenticatorGroupsConfig desired_authenticator_groups_config = 63; + + // The desired logging configuration. + LoggingConfig desired_logging_config = 64; + + // The desired monitoring configuration. + MonitoringConfig desired_monitoring_config = 65; + + // The desired Identity Service component configuration. + IdentityServiceConfig desired_identity_service_config = 66; + + // Enable/Disable private endpoint for the cluster's master. + optional bool desired_enable_private_endpoint = 71; + + // The desired network tags that apply to all auto-provisioned node pools + // in autopilot clusters and node auto-provisioning enabled clusters. + NetworkTags desired_node_pool_auto_config_network_tags = 110; + + // Enable/Disable Protect API features for the cluster. + optional ProtectConfig desired_protect_config = 112; + + // The desired config of Gateway API on this cluster. + GatewayAPIConfig desired_gateway_api_config = 114; + + // The current etag of the cluster. + // If an etag is provided and does not match the current etag of the cluster, + // update will be blocked and an ABORTED error will be returned. + string etag = 115; + + // The desired node pool logging configuration defaults for the cluster. + NodePoolLoggingConfig desired_node_pool_logging_config = 116; + + // The desired fleet configuration for the cluster. + Fleet desired_fleet = 117; + + // The desired stack type of the cluster. + // If a stack type is provided and does not match the current stack type of + // the cluster, update will attempt to change the stack type to the new type. + StackType desired_stack_type = 119; + + // The additional pod ranges to be added to the cluster. These pod ranges + // can be used by node pools to allocate pod IPs. + AdditionalPodRangesConfig additional_pod_ranges_config = 120; + + // The additional pod ranges that are to be removed from the cluster. + // The pod ranges specified here must have been specified earlier in the + // 'additional_pod_ranges_config' argument. + AdditionalPodRangesConfig removed_additional_pod_ranges_config = 121; + + // Kubernetes open source beta apis enabled on the cluster. Only beta apis + K8sBetaAPIConfig enable_k8s_beta_apis = 122; + + // Enable/Disable Security Posture API features for the cluster. + SecurityPostureConfig desired_security_posture_config = 124; + + // The desired network performance config. + NetworkConfig.ClusterNetworkPerformanceConfig + desired_network_performance_config = 125; + + // Enable/Disable FQDN Network Policy for the cluster. + optional bool desired_enable_fqdn_network_policy = 126; + + // The desired workload policy configuration for the autopilot cluster. + WorkloadPolicyConfig desired_autopilot_workload_policy_config = 128; + + // Beta APIs enabled for cluster. + K8sBetaAPIConfig desired_k8s_beta_apis = 131; +} + +// AdditionalPodRangesConfig is the configuration for additional pod secondary +// ranges supporting the ClusterUpdate message. +message AdditionalPodRangesConfig { + // Name for pod secondary ipv4 range which has the actual range defined ahead. + repeated string pod_range_names = 1; + + // Output only. [Output only] Information for additional pod range. + repeated RangeInfo pod_range_info = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// RangeInfo contains the range name and the range utilization by this cluster. +message RangeInfo { + // Output only. [Output only] Name of a range. + string range_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output only] The utilization of the range. + double utilization = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// This operation resource represents operations that may have happened or are +// happening on the cluster. All fields are output only. +message Operation { + // Current status of the operation. + enum Status { + // Not set. + STATUS_UNSPECIFIED = 0; + + // The operation has been created. + PENDING = 1; + + // The operation is currently running. + RUNNING = 2; + + // The operation is done, either cancelled or completed. + DONE = 3; + + // The operation is aborting. + ABORTING = 4; + } + + // Operation type categorizes the operation. + enum Type { + // Not set. + TYPE_UNSPECIFIED = 0; + + // The cluster is being created. The cluster should be assumed to be + // unusable until the operation finishes. + // + // In the event of the operation failing, the cluster will enter the [ERROR + // state][Cluster.Status.ERROR] and eventually be deleted. + CREATE_CLUSTER = 1; + + // The cluster is being deleted. The cluster should be assumed to be + // unusable as soon as this operation starts. + // + // In the event of the operation failing, the cluster will enter the [ERROR + // state][Cluster.Status.ERROR] and the deletion will be automatically + // retried until completed. + DELETE_CLUSTER = 2; + + // The [cluster + // version][google.container.v1beta1.ClusterUpdate.desired_master_version] + // is being updated. Note that this includes "upgrades" to the same version, + // which are simply a recreation. This also includes + // [auto-upgrades](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades#upgrading_automatically). + // For more details, see [documentation on cluster + // upgrades](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades#cluster_upgrades). + UPGRADE_MASTER = 3; + + // A node pool is being updated. Despite calling this an "upgrade", this + // includes most forms of updates to node pools. This also includes + // [auto-upgrades](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-upgrades). + // + // This operation sets the + // [progress][google.container.v1beta1.Operation.progress] field and may be + // [canceled][google.container.v1beta1.ClusterManager.CancelOperation]. + // + // The upgrade strategy depends on [node pool + // configuration](https://cloud.google.com/kubernetes-engine/docs/concepts/node-pool-upgrade-strategies). + // The nodes are generally still usable during this operation. + UPGRADE_NODES = 4; + + // A problem has been detected with the control plane and is being repaired. + // This operation type is initiated by GKE. For more details, see + // [documentation on + // repairs](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#repairs). + REPAIR_CLUSTER = 5; + + // The cluster is being updated. This is a broad category of operations and + // includes operations that only change metadata as well as those that must + // recreate the entire cluster. If the control plane must be recreated, this + // will cause temporary downtime for zonal clusters. + // + // Some features require recreating the nodes as well. Those will be + // recreated as separate operations and the update may not be completely + // functional until the node pools recreations finish. Node recreations will + // generally follow [maintenance + // policies](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions). + // + // Some GKE-initiated operations use this type. This includes certain types + // of auto-upgrades and incident mitigations. + UPDATE_CLUSTER = 6; + + // A node pool is being created. The node pool should be assumed to be + // unusable until this operation finishes. In the event of an error, the + // node pool may be partially created. + // + // If enabled, [node + // autoprovisioning](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-provisioning) + // may have automatically initiated such operations. + CREATE_NODE_POOL = 7; + + // The node pool is being deleted. The node pool should be assumed to be + // unusable as soon as this operation starts. + DELETE_NODE_POOL = 8; + + // The node pool's + // [manamagent][google.container.v1beta1.NodePool.management] field is being + // updated. These operations only update metadata and may be concurrent with + // most other operations. + SET_NODE_POOL_MANAGEMENT = 9; + + // A problem has been detected with nodes and [they are being + // repaired](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-repair). + // This operation type is initiated by GKE, typically automatically. This + // operation may be concurrent with other operations and there may be + // multiple repairs occurring on the same node pool. + AUTO_REPAIR_NODES = 10; + + // Unused. Automatic node upgrade uses + // [UPGRADE_NODES][google.container.v1beta1.Operation.Type.UPGRADE_NODES]. + AUTO_UPGRADE_NODES = 11 [deprecated = true]; + + // Unused. Updating labels uses + // [UPDATE_CLUSTER][google.container.v1beta1.Operation.Type.UPDATE_CLUSTER]. + SET_LABELS = 12 [deprecated = true]; + + // Unused. Updating master auth uses + // [UPDATE_CLUSTER][google.container.v1beta1.Operation.Type.UPDATE_CLUSTER]. + SET_MASTER_AUTH = 13 [deprecated = true]; + + // The node pool is being resized. With the exception of resizing to or from + // size zero, the node pool is generally usable during this operation. + SET_NODE_POOL_SIZE = 14; + + // Unused. Updating network policy uses + // [UPDATE_CLUSTER][google.container.v1beta1.Operation.Type.UPDATE_CLUSTER]. + SET_NETWORK_POLICY = 15 [deprecated = true]; + + // Unused. Updating maintenance policy uses + // [UPDATE_CLUSTER][google.container.v1beta1.Operation.Type.UPDATE_CLUSTER]. + SET_MAINTENANCE_POLICY = 16 [deprecated = true]; + + // The control plane is being resized. This operation type is initiated by + // GKE. These operations are often performed preemptively to ensure that the + // control plane has sufficient resources and is not typically an indication + // of issues. For more details, see + // [documentation on + // resizes](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#repairs). + RESIZE_CLUSTER = 18; + } + + // The server-assigned ID for the operation. + string name = 1; + + // The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // operation is taking place. This field is deprecated, use location instead. + string zone = 2 [deprecated = true]; + + // The operation type. + Type operation_type = 3; + + // The current status of the operation. + Status status = 4; + + // Detailed operation progress, if available. + string detail = 8; + + // Output only. If an error has occurred, a textual description of the error. + // Deprecated. Use field error instead. + string status_message = 5 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Server-defined URI for the operation. Example: + // `https://container.googleapis.com/v1alpha1/projects/123/locations/us-central1/operations/operation-123`. + string self_link = 6; + + // Server-defined URI for the target of the operation. The format of this is a + // URI to the resource being modified (such as a cluster, node pool, or node). + // For node pool repairs, there may be multiple nodes being repaired, but only + // one will be the target. + // + // Examples: + // + // - + // ## + // `https://container.googleapis.com/v1/projects/123/locations/us-central1/clusters/my-cluster` + // + // ## + // `https://container.googleapis.com/v1/projects/123/zones/us-central1-c/clusters/my-cluster/nodePools/my-np` + // + // `https://container.googleapis.com/v1/projects/123/zones/us-central1-c/clusters/my-cluster/nodePools/my-np/node/my-node` + string target_link = 7; + + // [Output only] The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) + // or + // [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) + // in which the cluster resides. + string location = 9; + + // [Output only] The time the operation started, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + string start_time = 10; + + // [Output only] The time the operation completed, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + string end_time = 11; + + // Output only. [Output only] Progress information for an operation. + OperationProgress progress = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Which conditions caused the current cluster state. + // Deprecated. Use field error instead. + repeated StatusCondition cluster_conditions = 13 [deprecated = true]; + + // Which conditions caused the current node pool state. + // Deprecated. Use field error instead. + repeated StatusCondition nodepool_conditions = 14 [deprecated = true]; + + // The error result of the operation in case of failure. + google.rpc.Status error = 15; +} + +// Information about operation (or operation stage) progress. +message OperationProgress { + // Progress metric is (string, int|float|string) pair. + message Metric { + // Required. Metric name, e.g., "nodes total", "percent done". + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Strictly one of the values is required. + oneof value { + // For metrics with integer value. + int64 int_value = 2; + + // For metrics with floating point value. + double double_value = 3; + + // For metrics with custom values (ratios, visual progress, etc.). + string string_value = 4; + } + } + + // A non-parameterized string describing an operation stage. + // Unset for single-stage operations. + string name = 1; + + // Status of an operation stage. + // Unset for single-stage operations. + Operation.Status status = 2; + + // Progress metric bundle, for example: + // metrics: [{name: "nodes done", int_value: 15}, + // {name: "nodes total", int_value: 32}] + // or + // metrics: [{name: "progress", double_value: 0.56}, + // {name: "progress scale", double_value: 1.0}] + repeated Metric metrics = 3; + + // Substages of an operation or a stage. + repeated OperationProgress stages = 4; +} + +// CreateClusterRequest creates a cluster. +message CreateClusterRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the parent field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the parent + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. A [cluster + // resource](https://cloud.google.com/container-engine/reference/rest/v1beta1/projects.locations.clusters) + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // The parent (project and location) where the cluster will be created. + // Specified in the format `projects/*/locations/*`. + string parent = 5; +} + +// GetClusterRequest gets the settings of a cluster. +message GetClusterRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to retrieve. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to retrieve. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 5; +} + +// UpdateClusterRequest updates the settings of a cluster. +message UpdateClusterRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. A description of the update. + ClusterUpdate update = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to update. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 5; +} + +// SetNodePoolVersionRequest updates the version of a node pool. +message UpdateNodePoolRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the node pool to upgrade. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // 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 + string node_version = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. The desired image type for the node pool. Please see + // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for + // available image types. + string image_type = 6 [(google.api.field_behavior) = REQUIRED]; + + // The desired list of Google Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) in which the + // node pool's nodes should be located. Changing the locations for a node pool + // will result in nodes being either created or removed from the node pool, + // depending on whether locations are being added or removed. + repeated string locations = 13; + + // The desired workload metadata config for the node pool. + WorkloadMetadataConfig workload_metadata_config = 14; + + // The name (project, location, cluster, node pool) of the node pool to + // update. Specified in the format + // `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 8; + + // Upgrade settings control disruption and speed of the upgrade. + NodePool.UpgradeSettings upgrade_settings = 15; + + // The desired network tags to be applied to all nodes in the node pool. + // If this field is not present, the tags will not be changed. Otherwise, + // the existing network tags will be *replaced* with the provided tags. + NetworkTags tags = 16; + + // The desired node taints to be applied to all nodes in the node pool. + // If this field is not present, the taints will not be changed. Otherwise, + // the existing node taints will be *replaced* with the provided taints. + NodeTaints taints = 17; + + // The desired node labels to be applied to all nodes in the node pool. + // If this field is not present, the labels will not be changed. Otherwise, + // the existing node labels will be *replaced* with the provided labels. + NodeLabels labels = 18; + + // Parameters that can be configured on Linux nodes. + LinuxNodeConfig linux_node_config = 19; + + // Node kubelet configs. + NodeKubeletConfig kubelet_config = 20; + + // Node network config. + NodeNetworkConfig node_network_config = 21; + + // GCFS config. + GcfsConfig gcfs_config = 22; + + // Confidential nodes config. + // All the nodes in the node pool will be Confidential VM once enabled. + ConfidentialNodes confidential_nodes = 23; + + // Enable or disable gvnic on the node pool. + VirtualNIC gvnic = 29; + + // The current etag of the node pool. + // If an etag is provided and does not match the current etag of the node + // pool, update will be blocked and an ABORTED error will be returned. + string etag = 30; + + // Enable or disable NCCL fast socket for the node pool. + FastSocket fast_socket = 31; + + // Logging configuration. + NodePoolLoggingConfig logging_config = 32; + + // The resource labels for the node pool to use to annotate any related + // Google Compute Engine resources. + ResourceLabels resource_labels = 33; + + // Parameters that can be configured on Windows nodes. + WindowsNodeConfig windows_node_config = 34; +} + +// SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool. +message SetNodePoolAutoscalingRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the node pool to upgrade. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Autoscaling configuration for the node pool. + NodePoolAutoscaling autoscaling = 5 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster, node pool) of the node pool to set + // autoscaler settings. Specified in the format + // `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 6; +} + +// SetLoggingServiceRequest sets the logging service of a cluster. +message SetLoggingServiceRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. The logging service the cluster should use to write logs. + // Currently available options: + // + // * `logging.googleapis.com/kubernetes` - The Cloud Logging + // service with a Kubernetes-native resource model + // * `logging.googleapis.com` - The legacy Cloud Logging service (no longer + // available as of GKE 1.15). + // * `none` - no logs will be exported from the cluster. + // + // If left as an empty string,`logging.googleapis.com/kubernetes` will be + // used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. + string logging_service = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to set logging. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 5; +} + +// SetMonitoringServiceRequest sets the monitoring service of a cluster. +message SetMonitoringServiceRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. The monitoring service the cluster should use to write metrics. + // Currently available options: + // + // * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring + // service with a Kubernetes-native resource model + // * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no + // longer available as of GKE 1.15). + // * `none` - No metrics will be exported from the cluster. + // + // If left as an empty string,`monitoring.googleapis.com/kubernetes` will be + // used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. + string monitoring_service = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to set monitoring. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 6; +} + +// SetAddonsRequest sets the addons associated with the cluster. +message SetAddonsConfigRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. The desired configurations for the various addons available to + // run in the cluster. + AddonsConfig addons_config = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to set addons. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 6; +} + +// SetLocationsRequest sets the locations of the cluster. +message SetLocationsRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. The desired list of Google Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) 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. + repeated string locations = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to set locations. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 6; +} + +// UpdateMasterRequest updates the master of the cluster. +message UpdateMasterRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // 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 + string master_version = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to update. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 7; +} + +// SetMasterAuthRequest updates the admin password of a cluster. +message SetMasterAuthRequest { + // Operation type: what type update to perform. + enum Action { + // Operation is unknown and will error out. + UNKNOWN = 0; + + // Set the password to a user generated value. + SET_PASSWORD = 1; + + // Generate a new password and set it to that. + GENERATE_PASSWORD = 2; + + // 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. + SET_USERNAME = 3; + } + + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. The exact form of action to be taken on the master auth. + Action action = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. A description of the update. + MasterAuth update = 5 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to set auth. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 7; +} + +// DeleteClusterRequest deletes a cluster. +message DeleteClusterRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to delete. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to delete. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 4; +} + +// ListClustersRequest lists clusters. +message ListClustersRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the parent field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides, or "-" for all zones. This field has been deprecated and + // replaced by the parent field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The parent (project and location) where the clusters will be listed. + // Specified in the format `projects/*/locations/*`. + // Location "-" matches all zones and all regions. + string parent = 4; +} + +// ListClustersResponse is the result of ListClustersRequest. +message ListClustersResponse { + // A list of clusters in the project in the specified zone, or + // across all ones. + repeated Cluster clusters = 1; + + // If any zones are listed here, the list of clusters returned + // may be missing those zones. + repeated string missing_zones = 2; +} + +// GetOperationRequest gets a single operation. +message GetOperationRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The server-assigned `name` of the operation. + // This field has been deprecated and replaced by the name field. + string operation_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The name (project, location, operation id) of the operation to get. + // Specified in the format `projects/*/locations/*/operations/*`. + string name = 5; +} + +// ListOperationsRequest lists operations. +message ListOperationsRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the parent field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) to return + // operations for, or `-` for all zones. This field has been deprecated and + // replaced by the parent field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The parent (project and location) where the operations will be listed. + // Specified in the format `projects/*/locations/*`. + // Location "-" matches all zones and all regions. + string parent = 4; +} + +// CancelOperationRequest cancels a single operation. +message CancelOperationRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // operation resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The server-assigned `name` of the operation. + // This field has been deprecated and replaced by the name field. + string operation_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The name (project, location, operation id) of the operation to cancel. + // Specified in the format `projects/*/locations/*/operations/*`. + string name = 4; +} + +// ListOperationsResponse is the result of ListOperationsRequest. +message ListOperationsResponse { + // A list of operations in the project in the specified zone. + repeated Operation operations = 1; + + // If any zones are listed here, the list of operations returned + // may be missing the operations from those zones. + repeated string missing_zones = 2; +} + +// Gets the current Kubernetes Engine service configuration. +message GetServerConfigRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) to return + // operations for. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The name (project and location) of the server config to get, + // specified in the format `projects/*/locations/*`. + string name = 4; +} + +// Kubernetes Engine service configuration. +message ServerConfig { + // ReleaseChannelConfig exposes configuration for a release channel. + message ReleaseChannelConfig { + // Deprecated. + message AvailableVersion { + option deprecated = true; + + // Kubernetes version. + string version = 1; + + // Reason for availability. + string reason = 2; + } + + // The release channel this configuration applies to. + ReleaseChannel.Channel channel = 1; + + // The default version for newly created clusters on the channel. + string default_version = 2; + + // Deprecated. + // This field has been deprecated and replaced with the valid_versions + // field. + repeated AvailableVersion available_versions = 3 [deprecated = true]; + + // List of valid versions for the channel. + repeated string valid_versions = 4; + } + + // Version of Kubernetes the service deploys by default. + string default_cluster_version = 1; + + // List of valid node upgrade target versions, in descending order. + repeated string valid_node_versions = 3; + + // Default image type. + string default_image_type = 4; + + // List of valid image types. + repeated string valid_image_types = 5; + + // List of valid master versions, in descending order. + repeated string valid_master_versions = 6; + + // List of release channel configurations. + repeated ReleaseChannelConfig channels = 9; + + // Maps of Kubernetes version and supported Windows server versions. + map windows_version_maps = 10; +} + +// Best effort provisioning. +message BestEffortProvisioning { + // When this is enabled, cluster/node pool creations will ignore non-fatal + // errors like stockout to best provision as many nodes as possible right now + // and eventually bring up all target number of nodes + bool enabled = 1; + + // Minimum number of nodes to be provisioned to be considered as succeeded, + // and the rest of nodes will be provisioned gradually and eventually when + // stockout issue has been resolved. + int32 min_provision_nodes = 2; +} + +// Windows server versions. +message WindowsVersions { + // Windows server version. + message WindowsVersion { + // Windows server image type + string image_type = 1; + + // Windows server build number + string os_version = 2; + + // Mainstream support end date + google.type.Date support_end_date = 3; + } + + // List of Windows server versions. + repeated WindowsVersion windows_versions = 1; +} + +// CreateNodePoolRequest creates a node pool for a cluster. +message CreateNodePoolRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the parent field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the parent + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the parent field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. The node pool to create. + NodePool node_pool = 4 [(google.api.field_behavior) = REQUIRED]; + + // The parent (project, location, cluster name) where the node pool will be + // created. Specified in the format + // `projects/*/locations/*/clusters/*`. + string parent = 6; +} + +// DeleteNodePoolRequest deletes a node pool for a cluster. +message DeleteNodePoolRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the node pool to delete. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster, node pool id) of the node pool to + // delete. Specified in the format + // `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 6; +} + +// ListNodePoolsRequest lists the node pool(s) for a cluster. +message ListNodePoolsRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the parent field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the parent + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the parent field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The parent (project, location, cluster name) where the node pools will be + // listed. Specified in the format `projects/*/locations/*/clusters/*`. + string parent = 5; +} + +// GetNodePoolRequest retrieves a node pool for a cluster. +message GetNodePoolRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the node pool. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster, node pool id) of the node pool to + // get. Specified in the format + // `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 6; +} + +// Settings for blue-green upgrade. +message BlueGreenSettings { + // Standard rollout policy is the default policy for blue-green. + message StandardRolloutPolicy { + // Blue pool size to drain in a batch. + oneof update_batch_size { + // Percentage of the blue pool nodes to drain in a batch. + // The range of this field should be (0.0, 1.0]. + float batch_percentage = 1; + + // Number of blue nodes to drain in a batch. + int32 batch_node_count = 2; + } + + // Soak time after each batch gets drained. Default to zero. + optional google.protobuf.Duration batch_soak_duration = 3; + } + + // The rollout policy controls the general rollout progress of blue-green. + oneof rollout_policy { + // Standard policy for the blue-green upgrade. + StandardRolloutPolicy standard_rollout_policy = 1; + } + + // Time needed after draining entire blue pool. After this period, blue pool + // will be cleaned up. + optional google.protobuf.Duration node_pool_soak_duration = 2; +} + +// 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. +// These upgrade settings control the level of parallelism and the level of +// disruption caused by an upgrade. +// +// maxUnavailable controls the number of nodes that can be simultaneously +// unavailable. +// +// maxSurge controls the number of additional nodes that can be added to the +// node pool temporarily for the time of the upgrade to increase the number of +// available nodes. +// +// (maxUnavailable + maxSurge) determines the level of parallelism (how many +// nodes are being upgraded at the same time). +// +// Note: upgrades inevitably introduce some disruption since workloads need to +// be moved from old nodes to new, upgraded ones. Even if maxUnavailable=0, +// this holds true. (Disruption stays within the limits of +// PodDisruptionBudget, if it is configured.) +// +// Consider a hypothetical node pool with 5 nodes having maxSurge=2, +// maxUnavailable=1. This means the upgrade process upgrades 3 nodes +// simultaneously. It creates 2 additional (upgraded) nodes, then it brings +// down 3 old (not yet upgraded) nodes at the same time. This ensures that +// there are always at least 4 nodes available. +message NodePool { + // These upgrade settings configure the upgrade strategy for the node pool. + // Use strategy to switch between the strategies applied to the node pool. + // + // If the strategy is SURGE, use max_surge and max_unavailable to control + // the level of parallelism and the level of disruption caused by upgrade. + // 1. maxSurge controls the number of additional nodes that can be added to + // the node pool temporarily for the time of the upgrade to increase the + // number of available nodes. + // 2. maxUnavailable controls the number of nodes that can be simultaneously + // unavailable. + // 3. (maxUnavailable + maxSurge) determines the level of parallelism (how + // many nodes are being upgraded at the same time). + // + // If the strategy is BLUE_GREEN, use blue_green_settings to configure the + // blue-green upgrade related settings. + // 1. standard_rollout_policy is the default policy. The policy is used to + // control the way blue pool gets drained. The draining is executed in the + // batch mode. The batch size could be specified as either percentage of the + // node pool size or the number of nodes. batch_soak_duration is the soak + // time after each batch gets drained. + // 2. node_pool_soak_duration is the soak time after all blue nodes are + // drained. After this period, the blue pool nodes will be deleted. + message UpgradeSettings { + // The maximum number of nodes that can be created beyond the current size + // of the node pool during the upgrade process. + int32 max_surge = 1; + + // The maximum number of nodes that can be simultaneously unavailable during + // the upgrade process. A node is considered available if its status is + // Ready. + int32 max_unavailable = 2; + + // Update strategy of the node pool. + optional NodePoolUpdateStrategy strategy = 3; + + // Settings for blue-green upgrade strategy. + optional BlueGreenSettings blue_green_settings = 4; + } + + // UpdateInfo contains resource (instance groups, etc), status and other + // intermediate information relevant to a node pool upgrade. + message UpdateInfo { + // Information relevant to blue-green upgrade. + message BlueGreenInfo { + // Phase represents the different stages blue-green upgrade is running in. + enum Phase { + // Unspecified phase. + PHASE_UNSPECIFIED = 0; + + // blue-green upgrade has been initiated. + UPDATE_STARTED = 1; + + // Start creating green pool nodes. + CREATING_GREEN_POOL = 2; + + // Start cordoning blue pool nodes. + CORDONING_BLUE_POOL = 3; + + // Start draining blue pool nodes. + DRAINING_BLUE_POOL = 4; + + // Start soaking time after draining entire blue pool. + NODE_POOL_SOAKING = 5; + + // Start deleting blue nodes. + DELETING_BLUE_POOL = 6; + + // Rollback has been initiated. + ROLLBACK_STARTED = 7; + } + + // Current blue-green upgrade phase. + Phase phase = 1; + + // The resource URLs of the [managed instance groups] + // (/compute/docs/instance-groups/creating-groups-of-managed-instances) + // associated with blue pool. + repeated string blue_instance_group_urls = 2; + + // The resource URLs of the [managed instance groups] + // (/compute/docs/instance-groups/creating-groups-of-managed-instances) + // associated with green pool. + repeated string green_instance_group_urls = 3; + + // Time to start deleting blue pool to complete blue-green upgrade, + // in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + string blue_pool_deletion_start_time = 4; + + // Version of green pool. + string green_pool_version = 5; + } + + // Information of a blue-green upgrade. + BlueGreenInfo blue_green_info = 1; + } + + // The current status of the node pool instance. + enum Status { + // Not set. + STATUS_UNSPECIFIED = 0; + + // The PROVISIONING state indicates the node pool is being created. + PROVISIONING = 1; + + // The RUNNING state indicates the node pool has been created + // and is fully usable. + RUNNING = 2; + + // 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. + RUNNING_WITH_ERROR = 3; + + // 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. + RECONCILING = 4; + + // The STOPPING state indicates the node pool is being deleted. + STOPPING = 5; + + // The ERROR state indicates the node pool may be unusable. Details + // can be found in the `statusMessage` field. + ERROR = 6; + } + + // PlacementPolicy defines the placement policy used by the node pool. + message PlacementPolicy { + // Type defines the type of placement policy. + enum Type { + // TYPE_UNSPECIFIED specifies no requirements on nodes + // placement. + TYPE_UNSPECIFIED = 0; + + // COMPACT specifies node placement in the same availability domain to + // ensure low communication latency. + COMPACT = 1; + } + + // The type of placement. + Type type = 1; + + // TPU placement topology for pod slice node pool. + // https://cloud.google.com/tpu/docs/types-topologies#tpu_topologies + string tpu_topology = 2; + } + + // The name of the node pool. + string name = 1; + + // The node configuration of the pool. + NodeConfig config = 2; + + // The initial node count for the pool. You must ensure that your + // 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; + + // The list of Google Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) in which the + // NodePool's nodes should be located. + // + // If this value is unspecified during node pool creation, the + // [Cluster.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters#Cluster.FIELDS.locations) + // value will be used, instead. + // + // Warning: changing node pool locations will result in nodes being added + // and/or removed. + repeated string locations = 13; + + // Networking configuration for this NodePool. If specified, it overrides the + // cluster-level defaults. + NodeNetworkConfig network_config = 14; + + // [Output only] Server-defined URL for the resource. + string self_link = 100; + + // The version of Kubernetes running on this NodePool's nodes. If unspecified, + // it defaults as described + // [here](https://cloud.google.com/kubernetes-engine/versioning#specifying_node_version). + string version = 101; + + // [Output only] The resource URLs of the [managed instance + // groups](https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-managed-instances) + // associated with this node pool. + // During the node pool blue-green upgrade operation, the URLs contain both + // blue and green resources. + repeated string instance_group_urls = 102; + + // [Output only] The status of the nodes in this pool instance. + Status status = 103; + + // [Output only] Deprecated. Use conditions instead. + // Additional information about the current status of this + // node pool instance, if available. + string status_message = 104 [deprecated = true]; + + // Autoscaler configuration for this NodePool. Autoscaler is enabled + // only if a valid configuration is present. + NodePoolAutoscaling autoscaling = 4; + + // NodeManagement configuration for this NodePool. + NodeManagement management = 5; + + // The constraint on the maximum number of pods that can be run + // simultaneously on a node in the node pool. + MaxPodsConstraint max_pods_constraint = 6; + + // Which conditions caused the current node pool state. + repeated StatusCondition conditions = 105; + + // [Output only] The pod CIDR block size per node in this node pool. + int32 pod_ipv4_cidr_size = 7; + + // Upgrade settings control disruption and speed of the upgrade. + UpgradeSettings upgrade_settings = 107; + + // Specifies the node placement policy. + PlacementPolicy placement_policy = 108; + + // Output only. [Output only] Update info contains relevant information during + // a node pool update. + UpdateInfo update_info = 109 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // This checksum is computed by the server based on the value of node pool + // fields, and may be sent on update requests to ensure the client has an + // up-to-date value before proceeding. + string etag = 110; + + // Enable best effort provisioning for nodes + BestEffortProvisioning best_effort_provisioning = 113; +} + +// NodeManagement defines the set of node management services turned on for the +// node pool. +message NodeManagement { + // Whether the nodes will be automatically upgraded. + bool auto_upgrade = 1; + + // Whether the nodes will be automatically repaired. + bool auto_repair = 2; + + // Specifies the Auto Upgrade knobs for the node pool. + AutoUpgradeOptions upgrade_options = 10; +} + +// AutoUpgradeOptions defines the set of options for the user to control how +// the Auto Upgrades will proceed. +message AutoUpgradeOptions { + // [Output only] This field is set when upgrades are about to commence + // with the approximate start time for the upgrades, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + string auto_upgrade_start_time = 1; + + // [Output only] This field is set when upgrades are about to commence + // with the description of the upgrade. + string description = 2; +} + +// MaintenancePolicy defines the maintenance policy to be used for the cluster. +message MaintenancePolicy { + // Specifies the maintenance window in which maintenance may be performed. + MaintenanceWindow window = 1; + + // 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. + string resource_version = 3; +} + +// MaintenanceWindow defines the maintenance window to be used for the cluster. +message MaintenanceWindow { + // Unimplemented, reserved for future use. + // HourlyMaintenanceWindow hourly_maintenance_window = 1; + oneof policy { + // DailyMaintenanceWindow specifies a daily maintenance operation window. + DailyMaintenanceWindow daily_maintenance_window = 2; + + // 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. + RecurringTimeWindow recurring_window = 3; + } + + // Exceptions to maintenance window. Non-emergency maintenance should not + // occur in these windows. + map maintenance_exclusions = 4; +} + +// Represents an arbitrary window of time. +message TimeWindow { + oneof options { + // MaintenanceExclusionOptions provides maintenance exclusion related + // options. + MaintenanceExclusionOptions maintenance_exclusion_options = 3; + } + + // The time that the window first starts. + google.protobuf.Timestamp start_time = 1; + + // The time that the window ends. The end time should take place after the + // start time. + google.protobuf.Timestamp end_time = 2; +} + +// Represents the Maintenance exclusion option. +message MaintenanceExclusionOptions { + // Scope of exclusion. + enum Scope { + // NO_UPGRADES excludes all upgrades, including patch upgrades and minor + // upgrades across control planes and nodes. This is the default exclusion + // behavior. + NO_UPGRADES = 0; + + // NO_MINOR_UPGRADES excludes all minor upgrades for the cluster, only + // patches are allowed. + NO_MINOR_UPGRADES = 1; + + // NO_MINOR_OR_NODE_UPGRADES excludes all minor upgrades for the cluster, + // and also exclude all node pool upgrades. Only control + // plane patches are allowed. + NO_MINOR_OR_NODE_UPGRADES = 2; + } + + // Scope specifies the upgrade scope which upgrades are blocked by the + // exclusion. + Scope scope = 1; +} + +// Represents an arbitrary window of time that recurs. +message RecurringTimeWindow { + // The window of the first recurrence. + TimeWindow window = 1; + + // 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. + string recurrence = 2; +} + +// Time window specified for daily maintenance operations. +message DailyMaintenanceWindow { + // Time within the maintenance window to start the maintenance operations. + // It must be in format "HH:MM", where HH : [00-23] and MM : [00-59] GMT. + string start_time = 2; + + // [Output only] Duration of the time window, automatically chosen to be + // smallest possible in the given scenario. + string duration = 3; +} + +// SetNodePoolManagementRequest sets the node management properties of a node +// pool. +message SetNodePoolManagementRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to update. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the node pool to update. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. NodeManagement configuration for the node pool. + NodeManagement management = 5 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster, node pool id) of the node pool to set + // management properties. Specified in the format + // `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 7; +} + +// SetNodePoolSizeRequest sets the size of a node pool. +message SetNodePoolSizeRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to update. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the node pool to update. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. The desired node count for the pool. + int32 node_count = 5 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster, node pool id) of the node pool to set + // size. + // Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 7; +} + +// CompleteNodePoolUpgradeRequest sets the name of target node pool to complete +// upgrade. +message CompleteNodePoolUpgradeRequest { + // The name (project, location, cluster, node pool id) of the node pool to + // complete upgrade. + // Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 1; +} + +// RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed +// NodePool upgrade. This will be an no-op if the last upgrade successfully +// completed. +message RollbackNodePoolUpgradeRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to rollback. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the node pool to rollback. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster, node pool id) of the node poll to + // rollback upgrade. + // Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 6; + + // Option for rollback to ignore the PodDisruptionBudget. + // Default value is false. + bool respect_pdb = 7; +} + +// ListNodePoolsResponse is the result of ListNodePoolsRequest. +message ListNodePoolsResponse { + // A list of node pools for a cluster. + repeated NodePool node_pools = 1; +} + +// 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. +message ClusterAutoscaling { + // Defines possible options for autoscaling_profile field. + enum AutoscalingProfile { + // No change to autoscaling configuration. + PROFILE_UNSPECIFIED = 0; + + // Prioritize optimizing utilization of resources. + OPTIMIZE_UTILIZATION = 1; + + // Use default (balanced) autoscaling configuration. + BALANCED = 2; + } + + // Enables automatic node pool creation and deletion. + bool enable_node_autoprovisioning = 1; + + // Contains global constraints regarding minimum and maximum + // amount of resources in the cluster. + repeated ResourceLimit resource_limits = 2; + + // Defines autoscaling behaviour. + AutoscalingProfile autoscaling_profile = 3; + + // AutoprovisioningNodePoolDefaults contains defaults for a node pool + // created by NAP. + AutoprovisioningNodePoolDefaults autoprovisioning_node_pool_defaults = 4; + + // The list of Google Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) in which the + // NodePool's nodes can be created by NAP. + repeated string autoprovisioning_locations = 5; +} + +// AutoprovisioningNodePoolDefaults contains defaults for a node pool created +// by NAP. +message AutoprovisioningNodePoolDefaults { + // 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](https://cloud.google.com/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. + repeated string oauth_scopes = 1; + + // The Google Cloud Platform Service Account to be used by the node VMs. + // Specify the email address of the Service Account; otherwise, if no Service + // Account is specified, the "default" service account is used. + string service_account = 2; + + // Upgrade settings control disruption and speed of the upgrade. + NodePool.UpgradeSettings upgrade_settings = 3; + + // NodeManagement configuration for this NodePool. + NodeManagement management = 4; + + // Deprecated. Minimum CPU platform to be used for NAP created node pools. + // 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](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform). + // This field is deprecated, min_cpu_platform should be specified using + // `cloud.google.com/requested-min-cpu-platform` label selector on the pod. + // To unset the min cpu platform field pass "automatic" + // as field value. + string min_cpu_platform = 5 [deprecated = true]; + + // 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. + int32 disk_size_gb = 6; + + // Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or + // 'pd-balanced') + // + // If unspecified, the default disk type is 'pd-standard' + string disk_type = 7; + + // Shielded Instance options. + ShieldedInstanceConfig shielded_instance_config = 8; + + // + // The Customer Managed Encryption Key used to encrypt the boot disk attached + // to each node in the node pool. This should be of the form + // projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. + // For more information about protecting resources with Cloud KMS Keys please + // see: + // https://cloud.google.com/compute/docs/disks/customer-managed-encryption + string boot_disk_kms_key = 9; + + // The image type to use for NAP created node. Please see + // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for + // available image types. + string image_type = 10; + + // Enable or disable Kubelet read only port. + optional bool insecure_kubelet_readonly_port_enabled = 13; +} + +// Contains information about amount of some resource in the cluster. +// For memory, value should be in GB. +message ResourceLimit { + // Resource name "cpu", "memory" or gpu-specific string. + string resource_type = 1; + + // Minimum amount of the resource in the cluster. + int64 minimum = 2; + + // Maximum amount of the resource in the cluster. + int64 maximum = 3; +} + +// NodePoolAutoscaling contains information required by cluster autoscaler to +// adjust the size of the node pool to the current cluster usage. +message NodePoolAutoscaling { + // Location policy specifies how zones are picked when scaling up the + // nodepool. + enum LocationPolicy { + // Not set. + LOCATION_POLICY_UNSPECIFIED = 0; + + // BALANCED is a best effort policy that aims to balance the sizes of + // different zones. + BALANCED = 1; + + // ANY policy picks zones that have the highest capacity available. + ANY = 2; + } + + // Is autoscaling enabled for this node pool. + bool enabled = 1; + + // Minimum number of nodes for one location in the NodePool. Must be >= 1 and + // <= max_node_count. + int32 min_node_count = 2; + + // Maximum number of nodes for one location in the NodePool. Must be >= + // min_node_count. There has to be enough quota to scale up the cluster. + int32 max_node_count = 3; + + // Can this node pool be deleted automatically. + bool autoprovisioned = 4; + + // Location policy used when scaling up a nodepool. + LocationPolicy location_policy = 5; + + // Minimum number of nodes in the node pool. Must be greater than 1 less than + // total_max_node_count. + // The total_*_node_count fields are mutually exclusive with the *_node_count + // fields. + int32 total_min_node_count = 6; + + // Maximum number of nodes in the node pool. Must be greater than + // total_min_node_count. There has to be enough quota to scale up the cluster. + // The total_*_node_count fields are mutually exclusive with the *_node_count + // fields. + int32 total_max_node_count = 7; +} + +// 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 +message SetLabelsRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. The labels to set for that cluster. + map resource_labels = 4 + [(google.api.field_behavior) = REQUIRED]; + + // 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. + string label_fingerprint = 5 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster name) of the cluster to set labels. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 7; +} + +// SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for +// a cluster. +message SetLegacyAbacRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to update. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Whether ABAC authorization will be enabled in the cluster. + bool enabled = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster name) of the cluster to set legacy + // abac. Specified in the format `projects/*/locations/*/clusters/*`. + string name = 6; +} + +// StartIPRotationRequest creates a new IP for the cluster and then performs +// a node upgrade on each node pool to point to the new IP. +message StartIPRotationRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster name) of the cluster to start IP + // rotation. Specified in the format `projects/*/locations/*/clusters/*`. + string name = 6; + + // Whether to rotate credentials during IP rotation. + bool rotate_credentials = 7; +} + +// CompleteIPRotationRequest moves the cluster master back into single-IP mode. +message CompleteIPRotationRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster name) of the cluster to complete IP + // rotation. Specified in the format `projects/*/locations/*/clusters/*`. + string name = 7; +} + +// AcceleratorConfig represents a Hardware Accelerator request. +message AcceleratorConfig { + // The number of the accelerator cards exposed to an instance. + int64 accelerator_count = 1; + + // The accelerator type resource name. List of supported accelerators + // [here](https://cloud.google.com/compute/docs/gpus) + string accelerator_type = 2; + + // Size of partitions to create on the GPU. Valid values are described in the + // NVIDIA [mig user + // guide](https://docs.nvidia.com/datacenter/tesla/mig-user-guide/#partitioning). + string gpu_partition_size = 3; + + // The number of time-shared GPU resources to expose for each physical GPU. + int64 max_time_shared_clients_per_gpu = 4 [deprecated = true]; + + // The configuration for GPU sharing options. + optional GPUSharingConfig gpu_sharing_config = 5; + + // The configuration for auto installation of GPU driver. + optional GPUDriverInstallationConfig gpu_driver_installation_config = 6; +} + +// GPUSharingConfig represents the GPU sharing configuration for Hardware +// Accelerators. +message GPUSharingConfig { + // The type of GPU sharing strategy currently provided. + enum GPUSharingStrategy { + // Default value. + GPU_SHARING_STRATEGY_UNSPECIFIED = 0; + + // GPUs are time-shared between containers. + TIME_SHARING = 1; + } + + // The max number of containers that can share a physical GPU. + int64 max_shared_clients_per_gpu = 1; + + // The type of GPU sharing strategy to enable on the GPU node. + optional GPUSharingStrategy gpu_sharing_strategy = 2; +} + +// GPUDriverInstallationConfig specifies the version of GPU driver to be auto +// installed. +message GPUDriverInstallationConfig { + // The GPU driver version to install. + enum GPUDriverVersion { + // Default value is to not install any GPU driver. + GPU_DRIVER_VERSION_UNSPECIFIED = 0; + + // Disable GPU driver auto installation and needs manual installation + INSTALLATION_DISABLED = 1; + + // "Default" GPU driver in COS and Ubuntu. + DEFAULT = 2; + + // "Latest" GPU driver in COS. + LATEST = 3; + } + + // Mode for how the GPU driver is installed. + optional GPUDriverVersion gpu_driver_version = 1; +} + +// ManagedPrometheusConfig defines the configuration for +// Google Cloud Managed Service for Prometheus. +message ManagedPrometheusConfig { + // Enable Managed Collection. + bool enabled = 1; +} + +// WorkloadMetadataConfig defines the metadata configuration to expose to +// workloads on the node pool. +message WorkloadMetadataConfig { + // NodeMetadata is the configuration for if and how to expose the node + // metadata to the workload running on the node. + enum NodeMetadata { + // Not set. + UNSPECIFIED = 0; + + // Prevent workloads not in hostNetwork from accessing certain VM metadata, + // specifically kube-env, which contains Kubelet credentials, and the + // instance identity token. + // + // Metadata concealment is a temporary security solution available while the + // bootstrapping process for cluster nodes is being redesigned with + // significant security improvements. This feature is scheduled to be + // deprecated in the future and later removed. + SECURE = 1; + + // Expose all VM metadata to pods. + EXPOSE = 2; + + // Run the GKE Metadata Server on this node. The GKE Metadata Server exposes + // a metadata API to workloads that is compatible with the V1 Compute + // Metadata APIs exposed by the Compute Engine and App Engine Metadata + // Servers. This feature can only be enabled if Workload Identity is enabled + // at the cluster level. + GKE_METADATA_SERVER = 3; + } + + // Mode is the configuration for how to expose metadata to workloads running + // on the node. + enum Mode { + // Not set. + MODE_UNSPECIFIED = 0; + + // Expose all Compute Engine metadata to pods. + GCE_METADATA = 1; + + // Run the GKE Metadata Server on this node. The GKE Metadata Server exposes + // a metadata API to workloads that is compatible with the V1 Compute + // Metadata APIs exposed by the Compute Engine and App Engine Metadata + // Servers. This feature can only be enabled if Workload Identity is enabled + // at the cluster level. + GKE_METADATA = 2; + } + + // NodeMetadata is the configuration for how to expose metadata to the + // workloads running on the node. + NodeMetadata node_metadata = 1 [deprecated = true]; + + // Mode is the configuration for how to expose metadata to workloads running + // on the node pool. + Mode mode = 2; +} + +// SetNetworkPolicyRequest enables/disables network policy for a cluster. +message SetNetworkPolicyRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Configuration options for the NetworkPolicy feature. + NetworkPolicy network_policy = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster name) of the cluster to set networking + // policy. Specified in the format `projects/*/locations/*/clusters/*`. + string name = 6; +} + +// SetMaintenancePolicyRequest sets the maintenance policy for a cluster. +message SetMaintenancePolicyRequest { + // Required. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. + string zone = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the cluster to update. + string cluster_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The maintenance policy to be set for the cluster. An empty field + // clears the existing maintenance policy. + MaintenancePolicy maintenance_policy = 4 + [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster name) of the cluster to set + // maintenance policy. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 5; +} + +// ListLocationsRequest is used to request the locations that offer GKE. +message ListLocationsRequest { + // Required. Contains the name of the resource requested. + // Specified in the format `projects/*`. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// ListLocationsResponse returns the list of all GKE locations and their +// recommendation state. +message ListLocationsResponse { + // A full list of GKE locations. + repeated Location locations = 1; + + // Only return ListLocationsResponse that occur after the page_token. This + // value should be populated from the ListLocationsResponse.next_page_token if + // that response token was set (which happens when listing more Locations than + // fit in a single ListLocationsResponse). + string next_page_token = 2; +} + +// Location returns the location name, and if the location is recommended +// for GKE cluster scheduling. +message Location { + // LocationType is the type of GKE location, regional or zonal. + enum LocationType { + // LOCATION_TYPE_UNSPECIFIED means the location type was not determined. + LOCATION_TYPE_UNSPECIFIED = 0; + + // A GKE Location where Zonal clusters can be created. + ZONE = 1; + + // A GKE Location where Regional clusters can be created. + REGION = 2; + } + + // Contains the type of location this Location is for. + // Regional or Zonal. + LocationType type = 1; + + // Contains the name of the resource requested. + // Specified in the format `projects/*/locations/*`. + string name = 2; + + // Whether the location is recommended for GKE cluster scheduling. + bool recommended = 3; +} + +// StatusCondition describes why a cluster or a node pool has a certain status +// (e.g., ERROR or DEGRADED). +message StatusCondition { + // Code for each condition + enum Code { + option deprecated = true; + + // UNKNOWN indicates a generic condition. + UNKNOWN = 0; + + // GCE_STOCKOUT indicates that Google Compute Engine resources are + // temporarily unavailable. + GCE_STOCKOUT = 1; + + // GKE_SERVICE_ACCOUNT_DELETED indicates that the user deleted their robot + // service account. + GKE_SERVICE_ACCOUNT_DELETED = 2; + + // Google Compute Engine quota was exceeded. + GCE_QUOTA_EXCEEDED = 3; + + // Cluster state was manually changed by an SRE due to a system logic error. + SET_BY_OPERATOR = 4; + + // Unable to perform an encrypt operation against the CloudKMS key used for + // etcd level encryption. + CLOUD_KMS_KEY_ERROR = 7; + + // Cluster CA is expiring soon. + // More codes TBA + CA_EXPIRING = 9; + } + + // Machine-friendly representation of the condition + // Deprecated. Use canonical_code instead. + Code code = 1 [deprecated = true]; + + // Human-friendly representation of the condition + string message = 2; + + // Canonical code of the condition. + google.rpc.Code canonical_code = 3; +} + +// NetworkConfig reports the relative names of network & subnetwork. +message NetworkConfig { + // Configuration of all network bandwidth tiers + message ClusterNetworkPerformanceConfig { + // Node network tier + enum Tier { + // Default value + TIER_UNSPECIFIED = 0; + + // Higher bandwidth, actual values based on VM size. + TIER_1 = 1; + } + + // Specifies the total network bandwidth tier for the NodePool. + optional Tier total_egress_bandwidth_tier = 1; + } + + // Output only. The relative name of the Google Compute Engine + // [network][google.container.v1beta1.NetworkConfig.network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) + // to which the cluster is connected. Example: + // projects/my-project/global/networks/my-network + string network = 1; + + // Output only. The relative name of the Google Compute Engine + // [subnetwork](https://cloud.google.com/compute/docs/vpc) to which the + // cluster is connected. Example: + // projects/my-project/regions/us-central1/subnetworks/my-subnet + string subnetwork = 2; + + // Whether Intra-node visibility is enabled for this cluster. + // This makes same node pod to pod traffic visible for VPC network. + bool enable_intra_node_visibility = 5; + + // Whether the cluster disables default in-node sNAT rules. In-node sNAT rules + // will be disabled when default_snat_status is disabled. When disabled is set + // to false, default IP masquerade rules will be applied to the nodes to + // prevent sNAT on cluster internal traffic. + DefaultSnatStatus default_snat_status = 7; + + // Whether L4ILB Subsetting is enabled for this cluster. + bool enable_l4ilb_subsetting = 10; + + // The desired datapath provider for this cluster. By default, uses the + // IPTables-based kube-proxy implementation. + DatapathProvider datapath_provider = 11; + + // The desired state of IPv6 connectivity to Google Services. + // By default, no private IPv6 access to or from Google Services (all access + // will be via IPv4) + PrivateIPv6GoogleAccess private_ipv6_google_access = 12; + + // DNSConfig contains clusterDNS config for this cluster. + DNSConfig dns_config = 13; + + // ServiceExternalIPsConfig specifies if services with externalIPs field are + // blocked or not. + ServiceExternalIPsConfig service_external_ips_config = 15; + + // GatewayAPIConfig contains the desired config of Gateway API on this + // cluster. + GatewayAPIConfig gateway_api_config = 16; + + // Network bandwidth tier configuration. + ClusterNetworkPerformanceConfig network_performance_config = 18; + + // Whether FQDN Network Policy is enabled on this cluster. + optional bool enable_fqdn_network_policy = 19; +} + +// GatewayAPIConfig contains the desired config of Gateway API on this cluster. +message GatewayAPIConfig { + // Channel describes if/how Gateway API should be installed and implemented in + // a cluster. + enum Channel { + // Default value. + CHANNEL_UNSPECIFIED = 0; + + // Gateway API support is disabled + CHANNEL_DISABLED = 1; + + // Gateway API support is enabled, experimental CRDs are installed + CHANNEL_EXPERIMENTAL = 3; + + // Gateway API support is enabled, standard CRDs are installed + CHANNEL_STANDARD = 4; + } + + // The Gateway API release channel to use for Gateway API. + Channel channel = 1; +} + +// Config to block services with externalIPs field. +message ServiceExternalIPsConfig { + // Whether Services with ExternalIPs field are allowed or not. + bool enabled = 1; +} + +// ListUsableSubnetworksRequest requests the list of usable subnetworks. +// available to a user for creating clusters. +message ListUsableSubnetworksRequest { + // Required. The parent project where subnetworks are usable. + // Specified in the format `projects/*`. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // 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. + string filter = 2; + + // 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) + int32 page_size = 3; + + // Specifies a page token to use. Set this to the nextPageToken returned by + // previous list requests to get the next page of results. + string page_token = 4; +} + +// ListUsableSubnetworksResponse is the response of +// ListUsableSubnetworksRequest. +message ListUsableSubnetworksResponse { + // A list of usable subnetworks in the specified network project. + repeated UsableSubnetwork subnetworks = 1; + + // 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. + string next_page_token = 2; +} + +// Secondary IP range of a usable subnetwork. +message UsableSubnetworkSecondaryRange { + // Status shows the current usage of a secondary IP range. + enum Status { + // UNKNOWN is the zero value of the Status enum. It's not a valid status. + UNKNOWN = 0; + + // UNUSED denotes that this range is unclaimed by any cluster. + UNUSED = 1; + + // IN_USE_SERVICE denotes that this range is claimed by a cluster for + // services. It cannot be used for other clusters. + IN_USE_SERVICE = 2; + + // 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_SHAREABLE_POD = 3; + + // IN_USE_MANAGED_POD denotes this range was created by GKE and is claimed + // for pods. It cannot be used for other clusters. + IN_USE_MANAGED_POD = 4; + } + + // The name associated with this subnetwork secondary range, used when adding + // an alias IP range to a VM instance. + string range_name = 1; + + // The range of IP addresses belonging to this subnetwork secondary range. + string ip_cidr_range = 2; + + // This field is to determine the status of the secondary range programmably. + Status status = 3; +} + +// UsableSubnetwork resource returns the subnetwork name, its associated network +// and the primary CIDR range. +message UsableSubnetwork { + // Subnetwork Name. + // Example: projects/my-project/regions/us-central1/subnetworks/my-subnet + string subnetwork = 1; + + // Network Name. + // Example: projects/my-project/global/networks/my-network + string network = 2; + + // The range of internal addresses that are owned by this subnetwork. + string ip_cidr_range = 3; + + // Secondary IP ranges. + repeated UsableSubnetworkSecondaryRange secondary_ip_ranges = 4; + + // 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. + string status_message = 5; +} + +// VerticalPodAutoscaling contains global, per-cluster information +// required by Vertical Pod Autoscaler to automatically adjust +// the resources of pods controlled by it. +message VerticalPodAutoscaling { + // Enables vertical pod autoscaling. + bool enabled = 1; +} + +// DefaultSnatStatus contains the desired state of whether default sNAT should +// be disabled on the cluster. +message DefaultSnatStatus { + // Disables cluster default sNAT rules. + bool disabled = 1; +} + +// IntraNodeVisibilityConfig contains the desired config of the intra-node +// visibility on this cluster. +message IntraNodeVisibilityConfig { + // Enables intra node visibility for this cluster. + bool enabled = 1; +} + +// ILBSubsettingConfig contains the desired config of L4 Internal LoadBalancer +// subsetting on this cluster. +message ILBSubsettingConfig { + // Enables l4 ILB subsetting for this cluster + bool enabled = 1; +} + +// DNSConfig contains the desired set of options for configuring clusterDNS. +message DNSConfig { + // Provider lists the various in-cluster DNS providers. + enum Provider { + // Default value + PROVIDER_UNSPECIFIED = 0; + + // Use GKE default DNS provider(kube-dns) for DNS resolution. + PLATFORM_DEFAULT = 1; + + // Use CloudDNS for DNS resolution. + CLOUD_DNS = 2; + + // Use KubeDNS for DNS resolution. + KUBE_DNS = 3; + } + + // DNSScope lists the various scopes of access to cluster DNS records. + enum DNSScope { + // Default value, will be inferred as cluster scope. + DNS_SCOPE_UNSPECIFIED = 0; + + // DNS records are accessible from within the cluster. + CLUSTER_SCOPE = 1; + + // DNS records are accessible from within the VPC. + VPC_SCOPE = 2; + } + + // cluster_dns indicates which in-cluster DNS provider should be used. + Provider cluster_dns = 1; + + // cluster_dns_scope indicates the scope of access to cluster DNS records. + DNSScope cluster_dns_scope = 2; + + // cluster_dns_domain is the suffix used for all cluster service records. + string cluster_dns_domain = 3; +} + +// Constraints applied to pods. +message MaxPodsConstraint { + // Constraint enforced on the max num of pods per node. + int64 max_pods_per_node = 1; +} + +// Configuration for the use of Kubernetes Service Accounts in GCP IAM +// policies. +message WorkloadIdentityConfig { + // IAM Identity Namespace to attach all Kubernetes Service Accounts to. + string identity_namespace = 1 [deprecated = true]; + + // The workload pool to attach all Kubernetes service accounts to. + string workload_pool = 2; + + // identity provider is the third party identity provider. + string identity_provider = 3; +} + +// Configuration for direct-path (via ALTS) with workload identity. +message WorkloadALTSConfig { + // enable_alts controls whether the alts handshaker should be enabled or not + // for direct-path. + // + // Requires Workload Identity + // ([workload_pool][google.container.v1beta1.WorkloadIdentityConfig.workload_pool] + // must be non-empty). + google.protobuf.BoolValue enable_alts = 1; +} + +// Configuration for issuance of mTLS keys and certificates to Kubernetes pods. +message WorkloadCertificates { + // enable_certificates controls issuance of workload mTLS certificates. + // + // If set, the GKE Workload Identity Certificates controller and node agent + // will be deployed in the cluster, which can then be configured by creating a + // WorkloadCertificateConfig Custom Resource. + // + // Requires Workload Identity + // ([workload_pool][google.container.v1beta1.WorkloadIdentityConfig.workload_pool] + // must be non-empty). + google.protobuf.BoolValue enable_certificates = 1; +} + +// Configuration for issuance of mTLS keys and certificates to Kubernetes pods. +message MeshCertificates { + // enable_certificates controls issuance of workload mTLS certificates. + // + // If set, the GKE Workload Identity Certificates controller and node agent + // will be deployed in the cluster, which can then be configured by creating a + // WorkloadCertificateConfig Custom Resource. + // + // Requires Workload Identity + // ([workload_pool][google.container.v1alpha1.WorkloadIdentityConfig.workload_pool] + // must be non-empty). + google.protobuf.BoolValue enable_certificates = 1; +} + +// Configuration of etcd encryption. +message DatabaseEncryption { + // State of etcd encryption. + enum State { + // Should never be set + UNKNOWN = 0; + + // Secrets in etcd are encrypted. + ENCRYPTED = 1; + + // Secrets in etcd are stored in plain text (at etcd level) - this is + // unrelated to Compute Engine level full disk encryption. + DECRYPTED = 2; + } + + // 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 + string key_name = 1; + + // The desired state of etcd encryption. + State state = 2; +} + +// Configuration for exporting cluster resource usages. +message ResourceUsageExportConfig { + // Parameters for using BigQuery as the destination of resource usage export. + message BigQueryDestination { + // The ID of a BigQuery Dataset. + string dataset_id = 1; + } + + // Parameters for controlling consumption metering. + message ConsumptionMeteringConfig { + // Whether to enable consumption metering for this cluster. If enabled, a + // second BigQuery table will be created to hold resource consumption + // records. + bool enabled = 1; + } + + // Configuration to use BigQuery as usage export destination. + BigQueryDestination bigquery_destination = 1; + + // Whether to enable network egress metering for this cluster. If enabled, a + // daemonset will be created in the cluster to meter network egress traffic. + bool enable_network_egress_metering = 2; + + // Configuration to enable resource consumption metering. + ConsumptionMeteringConfig consumption_metering_config = 3; +} + +// Configuration of Shielded Nodes feature. +message ShieldedNodes { + // Whether Shielded Nodes features are enabled on all nodes in this cluster. + bool enabled = 1; +} + +// Configuration of gVNIC feature. +message VirtualNIC { + // Whether gVNIC features are enabled in the node pool. + bool enabled = 1; +} + +// Configuration of Fast Socket feature. +message FastSocket { + // Whether Fast Socket features are enabled in the node pool. + bool enabled = 1; +} + +// GetOpenIDConfigRequest gets the OIDC discovery document for the +// cluster. See the OpenID Connect Discovery 1.0 specification for details. +message GetOpenIDConfigRequest { + // The cluster (project, location, cluster name) to get the discovery document + // for. Specified in the format `projects/*/locations/*/clusters/*`. + string parent = 1; +} + +// GetOpenIDConfigResponse is an OIDC discovery document for the cluster. +// See the OpenID Connect Discovery 1.0 specification for details. +message GetOpenIDConfigResponse { + // OIDC Issuer. + string issuer = 1; + + // JSON Web Key uri. + string jwks_uri = 2; + + // Supported response types. + repeated string response_types_supported = 3; + + // Supported subject types. + repeated string subject_types_supported = 4; + + // supported ID Token signing Algorithms. + repeated string id_token_signing_alg_values_supported = 5; + + // Supported claims. + repeated string claims_supported = 6; + + // Supported grant types. + repeated string grant_types = 7; +} + +// GetJSONWebKeysRequest gets the public component of the keys used by the +// cluster to sign token requests. This will be the jwks_uri for the discover +// document returned by getOpenIDConfig. See the OpenID Connect +// Discovery 1.0 specification for details. +message GetJSONWebKeysRequest { + // The cluster (project, location, cluster name) to get keys for. Specified in + // the format `projects/*/locations/*/clusters/*`. + string parent = 1; +} + +// Jwk is a JSON Web Key as specified in RFC 7517 +message Jwk { + // Key Type. + string kty = 1; + + // Algorithm. + string alg = 2; + + // Permitted uses for the public keys. + string use = 3; + + // Key ID. + string kid = 4; + + // Used for RSA keys. + string n = 5; + + // Used for RSA keys. + string e = 6; + + // Used for ECDSA keys. + string x = 7; + + // Used for ECDSA keys. + string y = 8; + + // Used for ECDSA keys. + string crv = 9; +} + +// GetJSONWebKeysResponse is a valid JSON Web Key Set as specififed in rfc 7517 +message GetJSONWebKeysResponse { + // The public component of the keys used by the cluster to sign token + // requests. + repeated Jwk keys = 1; +} + +// CheckAutopilotCompatibilityRequest requests getting the blockers for the +// given operation in the cluster. +message CheckAutopilotCompatibilityRequest { + // The name (project, location, cluster) of the cluster to retrieve. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 1; +} + +// AutopilotCompatibilityIssue contains information about a specific +// compatibility issue with Autopilot mode. +message AutopilotCompatibilityIssue { + // The type of the reported issue. + enum IssueType { + // Default value, should not be used. + UNSPECIFIED = 0; + + // Indicates that the issue is a known incompatibility between the + // cluster and Autopilot mode. + INCOMPATIBILITY = 1; + + // Indicates the issue is an incompatibility if customers take no further + // action to resolve. + ADDITIONAL_CONFIG_REQUIRED = 2; + + // Indicates the issue is not an incompatibility, but depending on the + // workloads business logic, there is a potential that they won't work on + // Autopilot. + PASSED_WITH_OPTIONAL_CONFIG = 3; + } + + // The last time when this issue was observed. + google.protobuf.Timestamp last_observation = 1; + + // The constraint type of the issue. + string constraint_type = 2; + + // The incompatibility type of this issue. + IssueType incompatibility_type = 3; + + // The name of the resources which are subject to this issue. + repeated string subjects = 4; + + // A URL to a public documnetation, which addresses resolving this issue. + string documentation_url = 5; + + // The description of the issue. + string description = 6; +} + +// CheckAutopilotCompatibilityResponse has a list of compatibility issues. +message CheckAutopilotCompatibilityResponse { + // The list of issues for the given operation. + repeated AutopilotCompatibilityIssue issues = 1; + + // The summary of the autopilot compatibility response. + string summary = 2; +} + +// ReleaseChannel indicates which release channel a cluster is +// subscribed to. Release channels are arranged in order of risk. +// +// When a cluster is subscribed to a release channel, Google maintains +// both the master version and the node version. Node auto-upgrade +// defaults to true and cannot be disabled. +message ReleaseChannel { + // Possible values for 'channel'. + enum Channel { + // No channel specified. + UNSPECIFIED = 0; + + // RAPID channel is offered on an early access basis for customers who want + // to test new releases. + // + // WARNING: Versions available in the RAPID Channel may be subject to + // unresolved issues with no known workaround and are not subject to any + // SLAs. + RAPID = 1; + + // Clusters subscribed to REGULAR receive versions that are considered GA + // quality. REGULAR is intended for production users who want to take + // advantage of new features. + REGULAR = 2; + + // Clusters subscribed to STABLE receive versions that are known to be + // stable and reliable in production. + STABLE = 3; + } + + // channel specifies which release channel the cluster is subscribed to. + Channel channel = 1; +} + +// Configuration for fine-grained cost management feature. +message CostManagementConfig { + // Whether the feature is enabled or not. + bool enabled = 1; +} + +// Configuration for Cloud TPU. +message TpuConfig { + // Whether Cloud TPU integration is enabled or not. + bool enabled = 1; + + // Whether to use service networking for Cloud TPU or not. + bool use_service_networking = 2; + + // IPv4 CIDR block reserved for Cloud TPU in the VPC. + string ipv4_cidr_block = 3; +} + +// PrivateIPv6GoogleAccess controls whether and how the pods can communicate +// with Google Services through gRPC over IPv6. +enum PrivateIPv6GoogleAccess { + // Default value. Same as DISABLED + PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0; + + // No private access to or from Google Services + PRIVATE_IPV6_GOOGLE_ACCESS_DISABLED = 1; + + // Enables private IPv6 access to Google Services from GKE + PRIVATE_IPV6_GOOGLE_ACCESS_TO_GOOGLE = 2; + + // Enables private IPv6 access to and from Google Services + PRIVATE_IPV6_GOOGLE_ACCESS_BIDIRECTIONAL = 3; +} + +// Master is the configuration for components on master. +message Master {} + +// Autopilot is the configuration for Autopilot settings on the cluster. +message Autopilot { + // Enable Autopilot + bool enabled = 1; + + // Workload policy configuration for Autopilot. + WorkloadPolicyConfig workload_policy_config = 2; +} + +// WorkloadPolicyConfig is the configuration of workload policy for autopilot +// clusters. +message WorkloadPolicyConfig { + // If true, workloads can use NET_ADMIN capability. + optional bool allow_net_admin = 1; +} + +// NotificationConfig is the configuration of notifications. +message NotificationConfig { + // Types of notifications currently supported. Can be used to filter what + // notifications are sent. + enum EventType { + // Not set, will be ignored. + EVENT_TYPE_UNSPECIFIED = 0; + + // Corresponds with UpgradeAvailableEvent. + UPGRADE_AVAILABLE_EVENT = 1; + + // Corresponds with UpgradeEvent. + UPGRADE_EVENT = 2; + + // Corresponds with SecurityBulletinEvent. + SECURITY_BULLETIN_EVENT = 3; + } + + // Pub/Sub specific notification config. + message PubSub { + // Enable notifications for Pub/Sub. + bool enabled = 1; + + // The desired Pub/Sub topic to which notifications will be + // sent by GKE. Format is `projects/{project}/topics/{topic}`. + string topic = 2 [ + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; + + // Allows filtering to one or more specific event types. If no filter is + // specified, or if a filter is specified with no event types, all event + // types will be sent + Filter filter = 3; + } + + // Allows filtering to one or more specific event types. If event types are + // present, those and only those event types will be transmitted to the + // cluster. Other types will be skipped. If no filter is specified, or no + // event types are present, all event types will be sent + message Filter { + // Event types to allowlist. + repeated EventType event_type = 1; + } + + // Notification config for Pub/Sub. + PubSub pubsub = 1; +} + +// ConfidentialNodes is configuration for the confidential nodes feature, which +// makes nodes run on confidential VMs. +message ConfidentialNodes { + // Whether Confidential Nodes feature is enabled. + bool enabled = 1; +} + +// UpgradeResourceType is the resource type that is upgrading. It is used +// in upgrade notifications. +enum UpgradeResourceType { + // Default value. This shouldn't be used. + UPGRADE_RESOURCE_TYPE_UNSPECIFIED = 0; + + // Master / control plane + MASTER = 1; + + // Node pool + NODE_POOL = 2; +} + +// UpgradeEvent is a notification sent to customers by the cluster server when +// a resource is upgrading. +message UpgradeEvent { + // The resource type that is upgrading. + UpgradeResourceType resource_type = 1; + + // The operation associated with this upgrade. + string operation = 2; + + // The time when the operation was started. + google.protobuf.Timestamp operation_start_time = 3; + + // The current version before the upgrade. + string current_version = 4; + + // The target version for the upgrade. + string target_version = 5; + + // Optional relative path to the resource. For example in node pool upgrades, + // the relative path of the node pool. + string resource = 6; +} + +// UpgradeAvailableEvent is a notification sent to customers when a new +// available version is released. +message UpgradeAvailableEvent { + // The release version available for upgrade. + string version = 1; + + // The resource type of the release version. + UpgradeResourceType resource_type = 2; + + // The release channel of the version. If empty, it means a non-channel + // release. + ReleaseChannel release_channel = 3; + + // Optional relative path to the resource. For example, the relative path of + // the node pool. + string resource = 4; + + // Windows node versions info. + WindowsVersions windows_versions = 5; +} + +// SecurityBulletinEvent is a notification sent to customers when a security +// bulletin has been posted that they are vulnerable to. +message SecurityBulletinEvent { + // The resource type (node/control plane) that has the vulnerability. Multiple + // notifications (1 notification per resource type) will be sent for a + // vulnerability that affects > 1 resource type. + string resource_type_affected = 1; + + // The ID of the bulletin corresponding to the vulnerability. + string bulletin_id = 2; + + // The CVEs associated with this bulletin. + repeated string cve_ids = 3; + + // The severity of this bulletin as it relates to GKE. + string severity = 4; + + // The URI link to the bulletin on the website for more information. + string bulletin_uri = 5; + + // A brief description of the bulletin. See the bulletin pointed to by the + // bulletin_uri field for an expanded description. + string brief_description = 6; + + // The GKE minor versions affected by this vulnerability. + repeated string affected_supported_minors = 7; + + // The GKE versions where this vulnerability is patched. + repeated string patched_versions = 8; + + // This represents a version selected from the patched_versions field that + // the cluster receiving this notification should most likely want to upgrade + // to based on its current version. Note that if this notification is being + // received by a given cluster, it means that this version is currently + // available as an upgrade target in that cluster's location. + string suggested_upgrade_target = 9; + + // If this field is specified, it means there are manual steps that the user + // must take to make their clusters safe. + bool manual_steps_required = 10; +} + +// IdentityServiceConfig is configuration for Identity Service which allows +// customers to use external identity providers with the K8S API +message IdentityServiceConfig { + // Whether to enable the Identity Service component + bool enabled = 1; +} + +// Strategy used for node pool update. +enum NodePoolUpdateStrategy { + // Default value if unset. GKE internally defaults the update strategy to + // SURGE for unspecified strategies. + NODE_POOL_UPDATE_STRATEGY_UNSPECIFIED = 0; + + // blue-green upgrade. + BLUE_GREEN = 2; + + // SURGE is the traditional way of upgrading a node pool. + // max_surge and max_unavailable determines the level of upgrade parallelism. + SURGE = 3; +} + +// LoggingConfig is cluster logging configuration. +message LoggingConfig { + // Logging components configuration + LoggingComponentConfig component_config = 1; +} + +// LoggingComponentConfig is cluster logging component configuration. +message LoggingComponentConfig { + // GKE components exposing logs + enum Component { + // Default value. This shouldn't be used. + COMPONENT_UNSPECIFIED = 0; + + // system components + SYSTEM_COMPONENTS = 1; + + // workloads + WORKLOADS = 2; + + // kube-apiserver + APISERVER = 3; + + // kube-scheduler + SCHEDULER = 4; + + // kube-controller-manager + CONTROLLER_MANAGER = 5; + } + + // Select components to collect logs. An empty set would disable all logging. + repeated Component enable_components = 1; +} + +// MonitoringConfig is cluster monitoring configuration. +message MonitoringConfig { + // Monitoring components configuration + MonitoringComponentConfig component_config = 1; + + // Enable Google Cloud Managed Service for Prometheus + // in the cluster. + ManagedPrometheusConfig managed_prometheus_config = 2; + + // Configuration of Advanced Datapath Observability features. + AdvancedDatapathObservabilityConfig advanced_datapath_observability_config = + 3; +} + +// AdvancedDatapathObservabilityConfig specifies configuration of observability +// features of advanced datapath. +message AdvancedDatapathObservabilityConfig { + // Supported Relay modes + enum RelayMode { + // Default value. This shouldn't be used. + RELAY_MODE_UNSPECIFIED = 0; + + // disabled + DISABLED = 1; + + // exposed via internal load balancer + INTERNAL_VPC_LB = 3; + + // exposed via external load balancer + EXTERNAL_LB = 4; + } + + // Expose flow metrics on nodes + bool enable_metrics = 1; + + // Method used to make Relay available + RelayMode relay_mode = 2; +} + +// NodePoolLoggingConfig specifies logging configuration for nodepools. +message NodePoolLoggingConfig { + // Logging variant configuration. + LoggingVariantConfig variant_config = 1; +} + +// LoggingVariantConfig specifies the behaviour of the logging component. +message LoggingVariantConfig { + // Logging component variants. + enum Variant { + // Default value. This shouldn't be used. + VARIANT_UNSPECIFIED = 0; + + // default logging variant. + DEFAULT = 1; + + // maximum logging throughput variant. + MAX_THROUGHPUT = 2; + } + + // Logging variant deployed on nodes. + Variant variant = 1; +} + +// MonitoringComponentConfig is cluster monitoring component configuration. +message MonitoringComponentConfig { + // GKE components exposing metrics + enum Component { + // Default value. This shouldn't be used. + COMPONENT_UNSPECIFIED = 0; + + // system components + SYSTEM_COMPONENTS = 1; + + // Deprecated: Use Google Cloud Managed Service for Prometheus. + WORKLOADS = 2 [deprecated = true]; + + // kube-apiserver + APISERVER = 3; + + // kube-scheduler + SCHEDULER = 4; + + // kube-controller-manager + CONTROLLER_MANAGER = 5; + } + + // Select components to collect metrics. An empty set would disable all + // monitoring. + repeated Component enable_components = 1; +} + +// The datapath provider selects the implementation of the Kubernetes networking +// model for service resolution and network policy enforcement. +enum DatapathProvider { + // Default value. + DATAPATH_PROVIDER_UNSPECIFIED = 0; + + // Use the IPTables implementation based on kube-proxy. + LEGACY_DATAPATH = 1; + + // Use the eBPF based GKE Dataplane V2 with additional features. See the [GKE + // Dataplane V2 + // documentation](https://cloud.google.com/kubernetes-engine/docs/how-to/dataplane-v2) + // for more. + ADVANCED_DATAPATH = 2; +} + +// Fleet is the fleet configuration for the cluster. +message Fleet { + // The Fleet host project(project ID or project number) where this cluster + // will be registered to. This field cannot be changed after the cluster has + // been registered. + string project = 1; + + // [Output only] The full resource name of the registered fleet membership of + // the cluster, in the format + // `//gkehub.googleapis.com/projects/*/locations/*/memberships/*`. + string membership = 2; + + // [Output only] Whether the cluster has been registered through the fleet + // API. + bool pre_registered = 3; +} + +// Possible values for IP stack type +enum StackType { + // By default, the clusters will be IPV4 only + STACK_TYPE_UNSPECIFIED = 0; + + // The value used if the cluster is a IPV4 only + IPV4 = 1; + + // The value used if the cluster is a dual stack cluster + IPV4_IPV6 = 2; +} diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.cancel_operation.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.cancel_operation.js new file mode 100644 index 00000000000..939c8c4aaca --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.cancel_operation.js @@ -0,0 +1,64 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, operationId) { + // [START container_v1beta1_generated_ClusterManager_CancelOperation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, operation id) of the operation to cancel. + * Specified in the format `projects/* /locations/* /operations/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCancelOperation() { + // Construct request + const request = { + projectId, + zone, + operationId, + }; + + // Run request + const response = await containerClient.cancelOperation(request); + console.log(response); + } + + callCancelOperation(); + // [END container_v1beta1_generated_ClusterManager_CancelOperation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js new file mode 100644 index 00000000000..4511c66ce17 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js @@ -0,0 +1,61 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1beta1_generated_ClusterManager_CheckAutopilotCompatibility_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster) of the cluster to retrieve. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCheckAutopilotCompatibility() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.checkAutopilotCompatibility(request); + console.log(response); + } + + callCheckAutopilotCompatibility(); + // [END container_v1beta1_generated_ClusterManager_CheckAutopilotCompatibility_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_i_p_rotation.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_i_p_rotation.js new file mode 100644 index 00000000000..57cb300a08f --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_i_p_rotation.js @@ -0,0 +1,64 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId) { + // [START container_v1beta1_generated_ClusterManager_CompleteIPRotation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster name) of the cluster to complete IP + * rotation. Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCompleteIPRotation() { + // Construct request + const request = { + projectId, + zone, + clusterId, + }; + + // Run request + const response = await containerClient.completeIPRotation(request); + console.log(response); + } + + callCompleteIPRotation(); + // [END container_v1beta1_generated_ClusterManager_CompleteIPRotation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_node_pool_upgrade.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_node_pool_upgrade.js new file mode 100644 index 00000000000..152c6971b1b --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_node_pool_upgrade.js @@ -0,0 +1,62 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1beta1_generated_ClusterManager_CompleteNodePoolUpgrade_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster, node pool id) of the node pool to + * complete upgrade. + * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCompleteNodePoolUpgrade() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.completeNodePoolUpgrade(request); + console.log(response); + } + + callCompleteNodePoolUpgrade(); + // [END container_v1beta1_generated_ClusterManager_CompleteNodePoolUpgrade_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_cluster.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_cluster.js new file mode 100644 index 00000000000..4414e1ca9d3 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_cluster.js @@ -0,0 +1,69 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, cluster) { + // [START container_v1beta1_generated_ClusterManager_CreateCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A cluster + * resource (https://cloud.google.com/container-engine/reference/rest/v1beta1/projects.locations.clusters) + */ + // const cluster = {} + /** + * The parent (project and location) where the cluster will be created. + * Specified in the format `projects/* /locations/*`. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCreateCluster() { + // Construct request + const request = { + projectId, + zone, + cluster, + }; + + // Run request + const response = await containerClient.createCluster(request); + console.log(response); + } + + callCreateCluster(); + // [END container_v1beta1_generated_ClusterManager_CreateCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_node_pool.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_node_pool.js new file mode 100644 index 00000000000..9d53c6be79e --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_node_pool.js @@ -0,0 +1,70 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, nodePool) { + // [START container_v1beta1_generated_ClusterManager_CreateNodePool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The node pool to create. + */ + // const nodePool = {} + /** + * The parent (project, location, cluster name) where the node pool will be + * created. Specified in the format + * `projects/* /locations/* /clusters/*`. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCreateNodePool() { + // Construct request + const request = { + projectId, + zone, + clusterId, + nodePool, + }; + + // Run request + const response = await containerClient.createNodePool(request); + console.log(response); + } + + callCreateNodePool(); + // [END container_v1beta1_generated_ClusterManager_CreateNodePool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_cluster.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_cluster.js new file mode 100644 index 00000000000..d387c456166 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_cluster.js @@ -0,0 +1,64 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId) { + // [START container_v1beta1_generated_ClusterManager_DeleteCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster) of the cluster to delete. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callDeleteCluster() { + // Construct request + const request = { + projectId, + zone, + clusterId, + }; + + // Run request + const response = await containerClient.deleteCluster(request); + console.log(response); + } + + callDeleteCluster(); + // [END container_v1beta1_generated_ClusterManager_DeleteCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_node_pool.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_node_pool.js new file mode 100644 index 00000000000..d406bb8686c --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_node_pool.js @@ -0,0 +1,66 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, nodePoolId) { + // [START container_v1beta1_generated_ClusterManager_DeleteNodePool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster, node pool id) of the node pool to + * delete. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callDeleteNodePool() { + // Construct request + const request = { + projectId, + zone, + clusterId, + nodePoolId, + }; + + // Run request + const response = await containerClient.deleteNodePool(request); + console.log(response); + } + + callDeleteNodePool(); + // [END container_v1beta1_generated_ClusterManager_DeleteNodePool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_cluster.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_cluster.js new file mode 100644 index 00000000000..0e388e69226 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_cluster.js @@ -0,0 +1,64 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId) { + // [START container_v1beta1_generated_ClusterManager_GetCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster) of the cluster to retrieve. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callGetCluster() { + // Construct request + const request = { + projectId, + zone, + clusterId, + }; + + // Run request + const response = await containerClient.getCluster(request); + console.log(response); + } + + callGetCluster(); + // [END container_v1beta1_generated_ClusterManager_GetCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_j_s_o_n_web_keys.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_j_s_o_n_web_keys.js new file mode 100644 index 00000000000..f48cfa5316d --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_j_s_o_n_web_keys.js @@ -0,0 +1,61 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1beta1_generated_ClusterManager_GetJSONWebKeys_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The cluster (project, location, cluster name) to get keys for. Specified in + * the format `projects/* /locations/* /clusters/*`. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callGetJSONWebKeys() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.getJSONWebKeys(request); + console.log(response); + } + + callGetJSONWebKeys(); + // [END container_v1beta1_generated_ClusterManager_GetJSONWebKeys_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_node_pool.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_node_pool.js new file mode 100644 index 00000000000..21f384189f6 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_node_pool.js @@ -0,0 +1,66 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, nodePoolId) { + // [START container_v1beta1_generated_ClusterManager_GetNodePool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster, node pool id) of the node pool to + * get. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callGetNodePool() { + // Construct request + const request = { + projectId, + zone, + clusterId, + nodePoolId, + }; + + // Run request + const response = await containerClient.getNodePool(request); + console.log(response); + } + + callGetNodePool(); + // [END container_v1beta1_generated_ClusterManager_GetNodePool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_operation.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_operation.js new file mode 100644 index 00000000000..f693d6982e6 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_operation.js @@ -0,0 +1,64 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, operationId) { + // [START container_v1beta1_generated_ClusterManager_GetOperation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, operation id) of the operation to get. + * Specified in the format `projects/* /locations/* /operations/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callGetOperation() { + // Construct request + const request = { + projectId, + zone, + operationId, + }; + + // Run request + const response = await containerClient.getOperation(request); + console.log(response); + } + + callGetOperation(); + // [END container_v1beta1_generated_ClusterManager_GetOperation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_server_config.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_server_config.js new file mode 100644 index 00000000000..147c03feb39 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_server_config.js @@ -0,0 +1,63 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone) { + // [START container_v1beta1_generated_ClusterManager_GetServerConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project and location) of the server config to get, + * specified in the format `projects/* /locations/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callGetServerConfig() { + // Construct request + const request = { + projectId, + zone, + }; + + // Run request + const response = await containerClient.getServerConfig(request); + console.log(response); + } + + callGetServerConfig(); + // [END container_v1beta1_generated_ClusterManager_GetServerConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_clusters.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_clusters.js new file mode 100644 index 00000000000..3a468a6e586 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_clusters.js @@ -0,0 +1,64 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone) { + // [START container_v1beta1_generated_ClusterManager_ListClusters_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The parent (project and location) where the clusters will be listed. + * Specified in the format `projects/* /locations/*`. + * Location "-" matches all zones and all regions. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callListClusters() { + // Construct request + const request = { + projectId, + zone, + }; + + // Run request + const response = await containerClient.listClusters(request); + console.log(response); + } + + callListClusters(); + // [END container_v1beta1_generated_ClusterManager_ListClusters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_locations.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_locations.js new file mode 100644 index 00000000000..62e86afb204 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_locations.js @@ -0,0 +1,62 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START container_v1beta1_generated_ClusterManager_ListLocations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Contains the name of the resource requested. + * Specified in the format `projects/*`. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callListLocations() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await containerClient.listLocations(request); + console.log(response); + } + + callListLocations(); + // [END container_v1beta1_generated_ClusterManager_ListLocations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_node_pools.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_node_pools.js new file mode 100644 index 00000000000..6c5aaa855e4 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_node_pools.js @@ -0,0 +1,64 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId) { + // [START container_v1beta1_generated_ClusterManager_ListNodePools_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The parent (project, location, cluster name) where the node pools will be + * listed. Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callListNodePools() { + // Construct request + const request = { + projectId, + zone, + clusterId, + }; + + // Run request + const response = await containerClient.listNodePools(request); + console.log(response); + } + + callListNodePools(); + // [END container_v1beta1_generated_ClusterManager_ListNodePools_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_operations.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_operations.js new file mode 100644 index 00000000000..adaf08f3129 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_operations.js @@ -0,0 +1,64 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone) { + // [START container_v1beta1_generated_ClusterManager_ListOperations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The parent (project and location) where the operations will be listed. + * Specified in the format `projects/* /locations/*`. + * Location "-" matches all zones and all regions. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callListOperations() { + // Construct request + const request = { + projectId, + zone, + }; + + // Run request + const response = await containerClient.listOperations(request); + console.log(response); + } + + callListOperations(); + // [END container_v1beta1_generated_ClusterManager_ListOperations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_usable_subnetworks.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_usable_subnetworks.js new file mode 100644 index 00000000000..400d21f447c --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_usable_subnetworks.js @@ -0,0 +1,83 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START container_v1beta1_generated_ClusterManager_ListUsableSubnetworks_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent project where subnetworks are usable. + * Specified in the format `projects/*`. + */ + // const parent = 'abc123' + /** + * 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. + */ + // const filter = 'abc123' + /** + * 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) + */ + // const pageSize = 1234 + /** + * Specifies a page token to use. Set this to the nextPageToken returned by + * previous list requests to get the next page of results. + */ + // const pageToken = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callListUsableSubnetworks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await containerClient.listUsableSubnetworksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListUsableSubnetworks(); + // [END container_v1beta1_generated_ClusterManager_ListUsableSubnetworks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.rollback_node_pool_upgrade.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.rollback_node_pool_upgrade.js new file mode 100644 index 00000000000..fd127925ad0 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.rollback_node_pool_upgrade.js @@ -0,0 +1,71 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, nodePoolId) { + // [START container_v1beta1_generated_ClusterManager_RollbackNodePoolUpgrade_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster, node pool id) of the node poll to + * rollback upgrade. + * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + /** + * Option for rollback to ignore the PodDisruptionBudget. + * Default value is false. + */ + // const respectPdb = true + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callRollbackNodePoolUpgrade() { + // Construct request + const request = { + projectId, + zone, + clusterId, + nodePoolId, + }; + + // Run request + const response = await containerClient.rollbackNodePoolUpgrade(request); + console.log(response); + } + + callRollbackNodePoolUpgrade(); + // [END container_v1beta1_generated_ClusterManager_RollbackNodePoolUpgrade_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_addons_config.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_addons_config.js new file mode 100644 index 00000000000..575a4bf0e5f --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_addons_config.js @@ -0,0 +1,70 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, addonsConfig) { + // [START container_v1beta1_generated_ClusterManager_SetAddonsConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The desired configurations for the various addons available to + * run in the cluster. + */ + // const addonsConfig = {} + /** + * The name (project, location, cluster) of the cluster to set addons. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetAddonsConfig() { + // Construct request + const request = { + projectId, + zone, + clusterId, + addonsConfig, + }; + + // Run request + const response = await containerClient.setAddonsConfig(request); + console.log(response); + } + + callSetAddonsConfig(); + // [END container_v1beta1_generated_ClusterManager_SetAddonsConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_labels.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_labels.js new file mode 100644 index 00000000000..9690ae6d011 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_labels.js @@ -0,0 +1,79 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, resourceLabels, labelFingerprint) { + // [START container_v1beta1_generated_ClusterManager_SetLabels_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The labels to set for that cluster. + */ + // const resourceLabels = 1234 + /** + * 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. + */ + // const labelFingerprint = 'abc123' + /** + * The name (project, location, cluster name) of the cluster to set labels. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetLabels() { + // Construct request + const request = { + projectId, + zone, + clusterId, + resourceLabels, + labelFingerprint, + }; + + // Run request + const response = await containerClient.setLabels(request); + console.log(response); + } + + callSetLabels(); + // [END container_v1beta1_generated_ClusterManager_SetLabels_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_legacy_abac.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_legacy_abac.js new file mode 100644 index 00000000000..c59d4c74879 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_legacy_abac.js @@ -0,0 +1,69 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, enabled) { + // [START container_v1beta1_generated_ClusterManager_SetLegacyAbac_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Whether ABAC authorization will be enabled in the cluster. + */ + // const enabled = true + /** + * The name (project, location, cluster name) of the cluster to set legacy + * abac. Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetLegacyAbac() { + // Construct request + const request = { + projectId, + zone, + clusterId, + enabled, + }; + + // Run request + const response = await containerClient.setLegacyAbac(request); + console.log(response); + } + + callSetLegacyAbac(); + // [END container_v1beta1_generated_ClusterManager_SetLegacyAbac_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_locations.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_locations.js new file mode 100644 index 00000000000..7a830f08e75 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_locations.js @@ -0,0 +1,74 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, locations) { + // [START container_v1beta1_generated_ClusterManager_SetLocations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The desired list of Google Compute Engine + * zones (https://cloud.google.com/compute/docs/zones#available) 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. + */ + // const locations = 'abc123' + /** + * The name (project, location, cluster) of the cluster to set locations. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetLocations() { + // Construct request + const request = { + projectId, + zone, + clusterId, + locations, + }; + + // Run request + const response = await containerClient.setLocations(request); + console.log(response); + } + + callSetLocations(); + // [END container_v1beta1_generated_ClusterManager_SetLocations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_logging_service.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_logging_service.js new file mode 100644 index 00000000000..e6cd4a0d7f1 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_logging_service.js @@ -0,0 +1,77 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, loggingService) { + // [START container_v1beta1_generated_ClusterManager_SetLoggingService_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The logging service the cluster should use to write logs. + * Currently available options: + * * `logging.googleapis.com/kubernetes` - The Cloud Logging + * service with a Kubernetes-native resource model + * * `logging.googleapis.com` - The legacy Cloud Logging service (no longer + * available as of GKE 1.15). + * * `none` - no logs will be exported from the cluster. + * If left as an empty string,`logging.googleapis.com/kubernetes` will be + * used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. + */ + // const loggingService = 'abc123' + /** + * The name (project, location, cluster) of the cluster to set logging. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetLoggingService() { + // Construct request + const request = { + projectId, + zone, + clusterId, + loggingService, + }; + + // Run request + const response = await containerClient.setLoggingService(request); + console.log(response); + } + + callSetLoggingService(); + // [END container_v1beta1_generated_ClusterManager_SetLoggingService_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_maintenance_policy.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_maintenance_policy.js new file mode 100644 index 00000000000..fa688eb7520 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_maintenance_policy.js @@ -0,0 +1,86 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, maintenancePolicy) { + // [START container_v1beta1_generated_ClusterManager_SetMaintenancePolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The Google Developers Console project ID or project + * number (https://cloud.google.com/resource-manager/docs/creating-managing-projects). + */ + // const projectId = 'abc123' + /** + * Required. The name of the Google Compute Engine + * zone (https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. + */ + // const zone = 'abc123' + /** + * Required. The name of the cluster to update. + */ + // const clusterId = 'abc123' + /** + * Required. The maintenance policy to be set for the cluster. An empty field + * clears the existing maintenance policy. + */ + // const maintenancePolicy = {} + /** + * The name (project, location, cluster name) of the cluster to set + * maintenance policy. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetMaintenancePolicy() { + // Construct request + const request = { + projectId, + zone, + clusterId, + maintenancePolicy, + }; + + // Run request + const response = await containerClient.setMaintenancePolicy(request); + console.log(response); + } + + callSetMaintenancePolicy(); + // [END container_v1beta1_generated_ClusterManager_SetMaintenancePolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_master_auth.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_master_auth.js new file mode 100644 index 00000000000..f39467e7cab --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_master_auth.js @@ -0,0 +1,74 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, action, update) { + // [START container_v1beta1_generated_ClusterManager_SetMasterAuth_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The exact form of action to be taken on the master auth. + */ + // const action = {} + /** + * Required. A description of the update. + */ + // const update = {} + /** + * The name (project, location, cluster) of the cluster to set auth. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetMasterAuth() { + // Construct request + const request = { + projectId, + zone, + clusterId, + action, + update, + }; + + // Run request + const response = await containerClient.setMasterAuth(request); + console.log(response); + } + + callSetMasterAuth(); + // [END container_v1beta1_generated_ClusterManager_SetMasterAuth_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_monitoring_service.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_monitoring_service.js new file mode 100644 index 00000000000..a7fe3208d49 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_monitoring_service.js @@ -0,0 +1,77 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, monitoringService) { + // [START container_v1beta1_generated_ClusterManager_SetMonitoringService_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The monitoring service the cluster should use to write metrics. + * Currently available options: + * * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring + * service with a Kubernetes-native resource model + * * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no + * longer available as of GKE 1.15). + * * `none` - No metrics will be exported from the cluster. + * If left as an empty string,`monitoring.googleapis.com/kubernetes` will be + * used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. + */ + // const monitoringService = 'abc123' + /** + * The name (project, location, cluster) of the cluster to set monitoring. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetMonitoringService() { + // Construct request + const request = { + projectId, + zone, + clusterId, + monitoringService, + }; + + // Run request + const response = await containerClient.setMonitoringService(request); + console.log(response); + } + + callSetMonitoringService(); + // [END container_v1beta1_generated_ClusterManager_SetMonitoringService_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_network_policy.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_network_policy.js new file mode 100644 index 00000000000..08f2bd01e43 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_network_policy.js @@ -0,0 +1,69 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, networkPolicy) { + // [START container_v1beta1_generated_ClusterManager_SetNetworkPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Configuration options for the NetworkPolicy feature. + */ + // const networkPolicy = {} + /** + * The name (project, location, cluster name) of the cluster to set networking + * policy. Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetNetworkPolicy() { + // Construct request + const request = { + projectId, + zone, + clusterId, + networkPolicy, + }; + + // Run request + const response = await containerClient.setNetworkPolicy(request); + console.log(response); + } + + callSetNetworkPolicy(); + // [END container_v1beta1_generated_ClusterManager_SetNetworkPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_autoscaling.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_autoscaling.js new file mode 100644 index 00000000000..48045be1f16 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_autoscaling.js @@ -0,0 +1,71 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, nodePoolId, autoscaling) { + // [START container_v1beta1_generated_ClusterManager_SetNodePoolAutoscaling_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Autoscaling configuration for the node pool. + */ + // const autoscaling = {} + /** + * The name (project, location, cluster, node pool) of the node pool to set + * autoscaler settings. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetNodePoolAutoscaling() { + // Construct request + const request = { + projectId, + zone, + clusterId, + nodePoolId, + autoscaling, + }; + + // Run request + const response = await containerClient.setNodePoolAutoscaling(request); + console.log(response); + } + + callSetNodePoolAutoscaling(); + // [END container_v1beta1_generated_ClusterManager_SetNodePoolAutoscaling_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_management.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_management.js new file mode 100644 index 00000000000..904e07be6c2 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_management.js @@ -0,0 +1,71 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, nodePoolId, management) { + // [START container_v1beta1_generated_ClusterManager_SetNodePoolManagement_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. NodeManagement configuration for the node pool. + */ + // const management = {} + /** + * The name (project, location, cluster, node pool id) of the node pool to set + * management properties. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetNodePoolManagement() { + // Construct request + const request = { + projectId, + zone, + clusterId, + nodePoolId, + management, + }; + + // Run request + const response = await containerClient.setNodePoolManagement(request); + console.log(response); + } + + callSetNodePoolManagement(); + // [END container_v1beta1_generated_ClusterManager_SetNodePoolManagement_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_size.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_size.js new file mode 100644 index 00000000000..3903f3ff656 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_size.js @@ -0,0 +1,71 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, nodePoolId, nodeCount) { + // [START container_v1beta1_generated_ClusterManager_SetNodePoolSize_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The desired node count for the pool. + */ + // const nodeCount = 1234 + /** + * The name (project, location, cluster, node pool id) of the node pool to set + * size. + * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetNodePoolSize() { + // Construct request + const request = { + projectId, + zone, + clusterId, + nodePoolId, + nodeCount, + }; + + // Run request + const response = await containerClient.setNodePoolSize(request); + console.log(response); + } + + callSetNodePoolSize(); + // [END container_v1beta1_generated_ClusterManager_SetNodePoolSize_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.start_i_p_rotation.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.start_i_p_rotation.js new file mode 100644 index 00000000000..181752cb53f --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.start_i_p_rotation.js @@ -0,0 +1,68 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId) { + // [START container_v1beta1_generated_ClusterManager_StartIPRotation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster name) of the cluster to start IP + * rotation. Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + /** + * Whether to rotate credentials during IP rotation. + */ + // const rotateCredentials = true + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callStartIPRotation() { + // Construct request + const request = { + projectId, + zone, + clusterId, + }; + + // Run request + const response = await containerClient.startIPRotation(request); + console.log(response); + } + + callStartIPRotation(); + // [END container_v1beta1_generated_ClusterManager_StartIPRotation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_cluster.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_cluster.js new file mode 100644 index 00000000000..23c5ff8b0c8 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_cluster.js @@ -0,0 +1,69 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, update) { + // [START container_v1beta1_generated_ClusterManager_UpdateCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A description of the update. + */ + // const update = {} + /** + * The name (project, location, cluster) of the cluster to update. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callUpdateCluster() { + // Construct request + const request = { + projectId, + zone, + clusterId, + update, + }; + + // Run request + const response = await containerClient.updateCluster(request); + console.log(response); + } + + callUpdateCluster(); + // [END container_v1beta1_generated_ClusterManager_UpdateCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_master.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_master.js new file mode 100644 index 00000000000..d76efa7a362 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_master.js @@ -0,0 +1,76 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, masterVersion) { + // [START container_v1beta1_generated_ClusterManager_UpdateMaster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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 + */ + // const masterVersion = 'abc123' + /** + * The name (project, location, cluster) of the cluster to update. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callUpdateMaster() { + // Construct request + const request = { + projectId, + zone, + clusterId, + masterVersion, + }; + + // Run request + const response = await containerClient.updateMaster(request); + console.log(response); + } + + callUpdateMaster(); + // [END container_v1beta1_generated_ClusterManager_UpdateMaster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_node_pool.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_node_pool.js new file mode 100644 index 00000000000..8f5b298a36e --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_node_pool.js @@ -0,0 +1,168 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, nodePoolId, nodeVersion, imageType) { + // [START container_v1beta1_generated_ClusterManager_UpdateNodePool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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 + */ + // const nodeVersion = 'abc123' + /** + * Required. The desired image type for the node pool. Please see + * https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for + * available image types. + */ + // const imageType = 'abc123' + /** + * The desired list of Google Compute Engine + * zones (https://cloud.google.com/compute/docs/zones#available) in which the + * node pool's nodes should be located. Changing the locations for a node pool + * will result in nodes being either created or removed from the node pool, + * depending on whether locations are being added or removed. + */ + // const locations = 'abc123' + /** + * The desired workload metadata config for the node pool. + */ + // const workloadMetadataConfig = {} + /** + * The name (project, location, cluster, node pool) of the node pool to + * update. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + /** + * Upgrade settings control disruption and speed of the upgrade. + */ + // const upgradeSettings = {} + /** + * The desired network tags to be applied to all nodes in the node pool. + * If this field is not present, the tags will not be changed. Otherwise, + * the existing network tags will be *replaced* with the provided tags. + */ + // const tags = {} + /** + * The desired node taints to be applied to all nodes in the node pool. + * If this field is not present, the taints will not be changed. Otherwise, + * the existing node taints will be *replaced* with the provided taints. + */ + // const taints = {} + /** + * The desired node labels to be applied to all nodes in the node pool. + * If this field is not present, the labels will not be changed. Otherwise, + * the existing node labels will be *replaced* with the provided labels. + */ + // const labels = {} + /** + * Parameters that can be configured on Linux nodes. + */ + // const linuxNodeConfig = {} + /** + * Node kubelet configs. + */ + // const kubeletConfig = {} + /** + * Node network config. + */ + // const nodeNetworkConfig = {} + /** + * GCFS config. + */ + // const gcfsConfig = {} + /** + * Confidential nodes config. + * All the nodes in the node pool will be Confidential VM once enabled. + */ + // const confidentialNodes = {} + /** + * Enable or disable gvnic on the node pool. + */ + // const gvnic = {} + /** + * The current etag of the node pool. + * If an etag is provided and does not match the current etag of the node + * pool, update will be blocked and an ABORTED error will be returned. + */ + // const etag = 'abc123' + /** + * Enable or disable NCCL fast socket for the node pool. + */ + // const fastSocket = {} + /** + * Logging configuration. + */ + // const loggingConfig = {} + /** + * The resource labels for the node pool to use to annotate any related + * Google Compute Engine resources. + */ + // const resourceLabels = {} + /** + * Parameters that can be configured on Windows nodes. + */ + // const windowsNodeConfig = {} + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callUpdateNodePool() { + // Construct request + const request = { + projectId, + zone, + clusterId, + nodePoolId, + nodeVersion, + imageType, + }; + + // Run request + const response = await containerClient.updateNodePool(request); + console.log(response); + } + + callUpdateNodePool(); + // [END container_v1beta1_generated_ClusterManager_UpdateNodePool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json new file mode 100644 index 00000000000..5e5c05ee1ca --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json @@ -0,0 +1,1955 @@ +{ + "clientLibrary": { + "name": "nodejs-container", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.container.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "container_v1beta1_generated_ClusterManager_ListClusters_async", + "title": "ClusterManager listClusters Sample", + "origin": "API_DEFINITION", + "description": " Lists all clusters owned by a project in either the specified zone or all zones.", + "canonical": true, + "file": "cluster_manager.list_clusters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListClusters", + "fullName": "google.container.v1beta1.ClusterManager.ListClusters", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.ListClustersResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "ListClusters", + "fullName": "google.container.v1beta1.ClusterManager.ListClusters", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_GetCluster_async", + "title": "ClusterManager getCluster Sample", + "origin": "API_DEFINITION", + "description": " Gets the details for a specific cluster.", + "canonical": true, + "file": "cluster_manager.get_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCluster", + "fullName": "google.container.v1beta1.ClusterManager.GetCluster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Cluster", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "GetCluster", + "fullName": "google.container.v1beta1.ClusterManager.GetCluster", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_CreateCluster_async", + "title": "ClusterManager createCluster Sample", + "origin": "API_DEFINITION", + "description": " 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](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). 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.", + "canonical": true, + "file": "cluster_manager.create_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCluster", + "fullName": "google.container.v1beta1.ClusterManager.CreateCluster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster", + "type": ".google.container.v1beta1.Cluster" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "CreateCluster", + "fullName": "google.container.v1beta1.ClusterManager.CreateCluster", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_UpdateCluster_async", + "title": "ClusterManager updateCluster Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings for a specific cluster.", + "canonical": true, + "file": "cluster_manager.update_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCluster", + "fullName": "google.container.v1beta1.ClusterManager.UpdateCluster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "update", + "type": ".google.container.v1beta1.ClusterUpdate" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "UpdateCluster", + "fullName": "google.container.v1beta1.ClusterManager.UpdateCluster", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_UpdateNodePool_async", + "title": "ClusterManager updateNodePool Sample", + "origin": "API_DEFINITION", + "description": " Updates the version and/or image type of a specific node pool.", + "canonical": true, + "file": "cluster_manager.update_node_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 160, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateNodePool", + "fullName": "google.container.v1beta1.ClusterManager.UpdateNodePool", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "node_version", + "type": "TYPE_STRING" + }, + { + "name": "image_type", + "type": "TYPE_STRING" + }, + { + "name": "locations", + "type": "TYPE_STRING[]" + }, + { + "name": "workload_metadata_config", + "type": ".google.container.v1beta1.WorkloadMetadataConfig" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "upgrade_settings", + "type": ".google.container.v1beta1.NodePool.UpgradeSettings" + }, + { + "name": "tags", + "type": ".google.container.v1beta1.NetworkTags" + }, + { + "name": "taints", + "type": ".google.container.v1beta1.NodeTaints" + }, + { + "name": "labels", + "type": ".google.container.v1beta1.NodeLabels" + }, + { + "name": "linux_node_config", + "type": ".google.container.v1beta1.LinuxNodeConfig" + }, + { + "name": "kubelet_config", + "type": ".google.container.v1beta1.NodeKubeletConfig" + }, + { + "name": "node_network_config", + "type": ".google.container.v1beta1.NodeNetworkConfig" + }, + { + "name": "gcfs_config", + "type": ".google.container.v1beta1.GcfsConfig" + }, + { + "name": "confidential_nodes", + "type": ".google.container.v1beta1.ConfidentialNodes" + }, + { + "name": "gvnic", + "type": ".google.container.v1beta1.VirtualNIC" + }, + { + "name": "etag", + "type": "TYPE_STRING" + }, + { + "name": "fast_socket", + "type": ".google.container.v1beta1.FastSocket" + }, + { + "name": "logging_config", + "type": ".google.container.v1beta1.NodePoolLoggingConfig" + }, + { + "name": "resource_labels", + "type": ".google.container.v1beta1.ResourceLabels" + }, + { + "name": "windows_node_config", + "type": ".google.container.v1beta1.WindowsNodeConfig" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "UpdateNodePool", + "fullName": "google.container.v1beta1.ClusterManager.UpdateNodePool", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_SetNodePoolAutoscaling_async", + "title": "ClusterManager setNodePoolAutoscaling Sample", + "origin": "API_DEFINITION", + "description": " Sets the autoscaling settings of a specific node pool.", + "canonical": true, + "file": "cluster_manager.set_node_pool_autoscaling.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetNodePoolAutoscaling", + "fullName": "google.container.v1beta1.ClusterManager.SetNodePoolAutoscaling", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "autoscaling", + "type": ".google.container.v1beta1.NodePoolAutoscaling" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "SetNodePoolAutoscaling", + "fullName": "google.container.v1beta1.ClusterManager.SetNodePoolAutoscaling", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_SetLoggingService_async", + "title": "ClusterManager setLoggingService Sample", + "origin": "API_DEFINITION", + "description": " Sets the logging service for a specific cluster.", + "canonical": true, + "file": "cluster_manager.set_logging_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetLoggingService", + "fullName": "google.container.v1beta1.ClusterManager.SetLoggingService", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "logging_service", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "SetLoggingService", + "fullName": "google.container.v1beta1.ClusterManager.SetLoggingService", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_SetMonitoringService_async", + "title": "ClusterManager setMonitoringService Sample", + "origin": "API_DEFINITION", + "description": " Sets the monitoring service for a specific cluster.", + "canonical": true, + "file": "cluster_manager.set_monitoring_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetMonitoringService", + "fullName": "google.container.v1beta1.ClusterManager.SetMonitoringService", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "monitoring_service", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "SetMonitoringService", + "fullName": "google.container.v1beta1.ClusterManager.SetMonitoringService", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_SetAddonsConfig_async", + "title": "ClusterManager setAddonsConfig Sample", + "origin": "API_DEFINITION", + "description": " Sets the addons for a specific cluster.", + "canonical": true, + "file": "cluster_manager.set_addons_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetAddonsConfig", + "fullName": "google.container.v1beta1.ClusterManager.SetAddonsConfig", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "addons_config", + "type": ".google.container.v1beta1.AddonsConfig" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "SetAddonsConfig", + "fullName": "google.container.v1beta1.ClusterManager.SetAddonsConfig", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_SetLocations_async", + "title": "ClusterManager setLocations Sample", + "origin": "API_DEFINITION", + "description": " Sets the locations for a specific cluster. Deprecated. Use [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters/update) instead.", + "canonical": true, + "file": "cluster_manager.set_locations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetLocations", + "fullName": "google.container.v1beta1.ClusterManager.SetLocations", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "locations", + "type": "TYPE_STRING[]" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "SetLocations", + "fullName": "google.container.v1beta1.ClusterManager.SetLocations", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_UpdateMaster_async", + "title": "ClusterManager updateMaster Sample", + "origin": "API_DEFINITION", + "description": " Updates the master for a specific cluster.", + "canonical": true, + "file": "cluster_manager.update_master.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateMaster", + "fullName": "google.container.v1beta1.ClusterManager.UpdateMaster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "master_version", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "UpdateMaster", + "fullName": "google.container.v1beta1.ClusterManager.UpdateMaster", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_SetMasterAuth_async", + "title": "ClusterManager setMasterAuth Sample", + "origin": "API_DEFINITION", + "description": " Sets master auth materials. Currently supports changing the admin password or a specific cluster, either via password generation or explicitly setting the password.", + "canonical": true, + "file": "cluster_manager.set_master_auth.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetMasterAuth", + "fullName": "google.container.v1beta1.ClusterManager.SetMasterAuth", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "action", + "type": ".google.container.v1beta1.SetMasterAuthRequest.Action" + }, + { + "name": "update", + "type": ".google.container.v1beta1.MasterAuth" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "SetMasterAuth", + "fullName": "google.container.v1beta1.ClusterManager.SetMasterAuth", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_DeleteCluster_async", + "title": "ClusterManager deleteCluster Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "cluster_manager.delete_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCluster", + "fullName": "google.container.v1beta1.ClusterManager.DeleteCluster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "DeleteCluster", + "fullName": "google.container.v1beta1.ClusterManager.DeleteCluster", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_ListOperations_async", + "title": "ClusterManager listOperations Sample", + "origin": "API_DEFINITION", + "description": " Lists all operations in a project in the specified zone or all zones.", + "canonical": true, + "file": "cluster_manager.list_operations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListOperations", + "fullName": "google.container.v1beta1.ClusterManager.ListOperations", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.ListOperationsResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "ListOperations", + "fullName": "google.container.v1beta1.ClusterManager.ListOperations", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_GetOperation_async", + "title": "ClusterManager getOperation Sample", + "origin": "API_DEFINITION", + "description": " Gets the specified operation.", + "canonical": true, + "file": "cluster_manager.get_operation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetOperation", + "fullName": "google.container.v1beta1.ClusterManager.GetOperation", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "operation_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "GetOperation", + "fullName": "google.container.v1beta1.ClusterManager.GetOperation", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_CancelOperation_async", + "title": "ClusterManager cancelOperation Sample", + "origin": "API_DEFINITION", + "description": " Cancels the specified operation.", + "canonical": true, + "file": "cluster_manager.cancel_operation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CancelOperation", + "fullName": "google.container.v1beta1.ClusterManager.CancelOperation", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "operation_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "CancelOperation", + "fullName": "google.container.v1beta1.ClusterManager.CancelOperation", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_GetServerConfig_async", + "title": "ClusterManager getServerConfig Sample", + "origin": "API_DEFINITION", + "description": " Returns configuration info about the Google Kubernetes Engine service.", + "canonical": true, + "file": "cluster_manager.get_server_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetServerConfig", + "fullName": "google.container.v1beta1.ClusterManager.GetServerConfig", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.ServerConfig", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "GetServerConfig", + "fullName": "google.container.v1beta1.ClusterManager.GetServerConfig", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_GetJSONWebKeys_async", + "title": "ClusterManager getJSONWebKeys Sample", + "origin": "API_DEFINITION", + "description": " Gets the public component of the cluster signing keys in JSON Web Key format. This API is not yet intended for general use, and is not available for all clusters.", + "canonical": true, + "file": "cluster_manager.get_j_s_o_n_web_keys.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetJSONWebKeys", + "fullName": "google.container.v1beta1.ClusterManager.GetJSONWebKeys", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.GetJSONWebKeysResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "GetJSONWebKeys", + "fullName": "google.container.v1beta1.ClusterManager.GetJSONWebKeys", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_ListNodePools_async", + "title": "ClusterManager listNodePools Sample", + "origin": "API_DEFINITION", + "description": " Lists the node pools for a cluster.", + "canonical": true, + "file": "cluster_manager.list_node_pools.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListNodePools", + "fullName": "google.container.v1beta1.ClusterManager.ListNodePools", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.ListNodePoolsResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "ListNodePools", + "fullName": "google.container.v1beta1.ClusterManager.ListNodePools", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_GetNodePool_async", + "title": "ClusterManager getNodePool Sample", + "origin": "API_DEFINITION", + "description": " Retrieves the requested node pool.", + "canonical": true, + "file": "cluster_manager.get_node_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetNodePool", + "fullName": "google.container.v1beta1.ClusterManager.GetNodePool", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.NodePool", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "GetNodePool", + "fullName": "google.container.v1beta1.ClusterManager.GetNodePool", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_CreateNodePool_async", + "title": "ClusterManager createNodePool Sample", + "origin": "API_DEFINITION", + "description": " Creates a node pool for a cluster.", + "canonical": true, + "file": "cluster_manager.create_node_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateNodePool", + "fullName": "google.container.v1beta1.ClusterManager.CreateNodePool", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool", + "type": ".google.container.v1beta1.NodePool" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "CreateNodePool", + "fullName": "google.container.v1beta1.ClusterManager.CreateNodePool", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_DeleteNodePool_async", + "title": "ClusterManager deleteNodePool Sample", + "origin": "API_DEFINITION", + "description": " Deletes a node pool from a cluster.", + "canonical": true, + "file": "cluster_manager.delete_node_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteNodePool", + "fullName": "google.container.v1beta1.ClusterManager.DeleteNodePool", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "DeleteNodePool", + "fullName": "google.container.v1beta1.ClusterManager.DeleteNodePool", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_CompleteNodePoolUpgrade_async", + "title": "ClusterManager completeNodePoolUpgrade Sample", + "origin": "API_DEFINITION", + "description": " CompleteNodePoolUpgrade will signal an on-going node pool upgrade to complete.", + "canonical": true, + "file": "cluster_manager.complete_node_pool_upgrade.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CompleteNodePoolUpgrade", + "fullName": "google.container.v1beta1.ClusterManager.CompleteNodePoolUpgrade", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "CompleteNodePoolUpgrade", + "fullName": "google.container.v1beta1.ClusterManager.CompleteNodePoolUpgrade", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_RollbackNodePoolUpgrade_async", + "title": "ClusterManager rollbackNodePoolUpgrade Sample", + "origin": "API_DEFINITION", + "description": " Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last upgrade successfully completed.", + "canonical": true, + "file": "cluster_manager.rollback_node_pool_upgrade.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RollbackNodePoolUpgrade", + "fullName": "google.container.v1beta1.ClusterManager.RollbackNodePoolUpgrade", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "respect_pdb", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "RollbackNodePoolUpgrade", + "fullName": "google.container.v1beta1.ClusterManager.RollbackNodePoolUpgrade", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_SetNodePoolManagement_async", + "title": "ClusterManager setNodePoolManagement Sample", + "origin": "API_DEFINITION", + "description": " Sets the NodeManagement options for a node pool.", + "canonical": true, + "file": "cluster_manager.set_node_pool_management.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetNodePoolManagement", + "fullName": "google.container.v1beta1.ClusterManager.SetNodePoolManagement", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "management", + "type": ".google.container.v1beta1.NodeManagement" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "SetNodePoolManagement", + "fullName": "google.container.v1beta1.ClusterManager.SetNodePoolManagement", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_SetLabels_async", + "title": "ClusterManager setLabels Sample", + "origin": "API_DEFINITION", + "description": " Sets labels on a cluster.", + "canonical": true, + "file": "cluster_manager.set_labels.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetLabels", + "fullName": "google.container.v1beta1.ClusterManager.SetLabels", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "resource_labels", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "label_fingerprint", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "SetLabels", + "fullName": "google.container.v1beta1.ClusterManager.SetLabels", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_SetLegacyAbac_async", + "title": "ClusterManager setLegacyAbac Sample", + "origin": "API_DEFINITION", + "description": " Enables or disables the ABAC authorization mechanism on a cluster.", + "canonical": true, + "file": "cluster_manager.set_legacy_abac.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetLegacyAbac", + "fullName": "google.container.v1beta1.ClusterManager.SetLegacyAbac", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "enabled", + "type": "TYPE_BOOL" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "SetLegacyAbac", + "fullName": "google.container.v1beta1.ClusterManager.SetLegacyAbac", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_StartIPRotation_async", + "title": "ClusterManager startIPRotation Sample", + "origin": "API_DEFINITION", + "description": " Starts master IP rotation.", + "canonical": true, + "file": "cluster_manager.start_i_p_rotation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StartIPRotation", + "fullName": "google.container.v1beta1.ClusterManager.StartIPRotation", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "rotate_credentials", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "StartIPRotation", + "fullName": "google.container.v1beta1.ClusterManager.StartIPRotation", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_CompleteIPRotation_async", + "title": "ClusterManager completeIPRotation Sample", + "origin": "API_DEFINITION", + "description": " Completes master IP rotation.", + "canonical": true, + "file": "cluster_manager.complete_i_p_rotation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CompleteIPRotation", + "fullName": "google.container.v1beta1.ClusterManager.CompleteIPRotation", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "CompleteIPRotation", + "fullName": "google.container.v1beta1.ClusterManager.CompleteIPRotation", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_SetNodePoolSize_async", + "title": "ClusterManager setNodePoolSize Sample", + "origin": "API_DEFINITION", + "description": " SetNodePoolSizeRequest sets the size of a node pool. The new size will be used for all replicas, including future replicas created by modifying [NodePool.locations][google.container.v1beta1.NodePool.locations].", + "canonical": true, + "file": "cluster_manager.set_node_pool_size.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetNodePoolSize", + "fullName": "google.container.v1beta1.ClusterManager.SetNodePoolSize", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "node_count", + "type": "TYPE_INT32" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "SetNodePoolSize", + "fullName": "google.container.v1beta1.ClusterManager.SetNodePoolSize", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_SetNetworkPolicy_async", + "title": "ClusterManager setNetworkPolicy Sample", + "origin": "API_DEFINITION", + "description": " Enables or disables Network Policy for a cluster.", + "canonical": true, + "file": "cluster_manager.set_network_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetNetworkPolicy", + "fullName": "google.container.v1beta1.ClusterManager.SetNetworkPolicy", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "network_policy", + "type": ".google.container.v1beta1.NetworkPolicy" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "SetNetworkPolicy", + "fullName": "google.container.v1beta1.ClusterManager.SetNetworkPolicy", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_SetMaintenancePolicy_async", + "title": "ClusterManager setMaintenancePolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the maintenance policy for a cluster.", + "canonical": true, + "file": "cluster_manager.set_maintenance_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetMaintenancePolicy", + "fullName": "google.container.v1beta1.ClusterManager.SetMaintenancePolicy", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "maintenance_policy", + "type": ".google.container.v1beta1.MaintenancePolicy" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "SetMaintenancePolicy", + "fullName": "google.container.v1beta1.ClusterManager.SetMaintenancePolicy", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_ListUsableSubnetworks_async", + "title": "ClusterManager listUsableSubnetworks Sample", + "origin": "API_DEFINITION", + "description": " Lists subnetworks that can be used for creating clusters in a project.", + "canonical": true, + "file": "cluster_manager.list_usable_subnetworks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListUsableSubnetworks", + "fullName": "google.container.v1beta1.ClusterManager.ListUsableSubnetworks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.ListUsableSubnetworksResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "ListUsableSubnetworks", + "fullName": "google.container.v1beta1.ClusterManager.ListUsableSubnetworks", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_CheckAutopilotCompatibility_async", + "title": "ClusterManager checkAutopilotCompatibility Sample", + "origin": "API_DEFINITION", + "description": " Checks the cluster compatibility with Autopilot mode, and returns a list of compatibility issues.", + "canonical": true, + "file": "cluster_manager.check_autopilot_compatibility.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CheckAutopilotCompatibility", + "fullName": "google.container.v1beta1.ClusterManager.CheckAutopilotCompatibility", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.CheckAutopilotCompatibilityResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "CheckAutopilotCompatibility", + "fullName": "google.container.v1beta1.ClusterManager.CheckAutopilotCompatibility", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_ListLocations_async", + "title": "ClusterManager listLocations Sample", + "origin": "API_DEFINITION", + "description": " Fetches locations that offer Google Kubernetes Engine.", + "canonical": true, + "file": "cluster_manager.list_locations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListLocations", + "fullName": "google.container.v1beta1.ClusterManager.ListLocations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.ListLocationsResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "ListLocations", + "fullName": "google.container.v1beta1.ClusterManager.ListLocations", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-container/v1beta1/src/index.ts b/owl-bot-staging/google-container/v1beta1/src/index.ts new file mode 100644 index 00000000000..44cbef9d2d2 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1beta1 from './v1beta1'; +const ClusterManagerClient = v1beta1.ClusterManagerClient; +type ClusterManagerClient = v1beta1.ClusterManagerClient; +export {v1beta1, ClusterManagerClient}; +export default {v1beta1, ClusterManagerClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client.ts b/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client.ts new file mode 100644 index 00000000000..168ebbd3a99 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client.ts @@ -0,0 +1,3623 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/cluster_manager_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './cluster_manager_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Google Kubernetes Engine Cluster Manager v1beta1 + * @class + * @memberof v1beta1 + */ +export class ClusterManagerClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + clusterManagerStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ClusterManagerClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new ClusterManagerClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ClusterManagerClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listUsableSubnetworks: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'subnetworks') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.container.v1beta1.ClusterManager', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.clusterManagerStub) { + return this.clusterManagerStub; + } + + // Put together the "service stub" for + // google.container.v1beta1.ClusterManager. + this.clusterManagerStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.container.v1beta1.ClusterManager') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.container.v1beta1.ClusterManager, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const clusterManagerStubMethods = + ['listClusters', 'getCluster', 'createCluster', 'updateCluster', 'updateNodePool', 'setNodePoolAutoscaling', 'setLoggingService', 'setMonitoringService', 'setAddonsConfig', 'setLocations', 'updateMaster', 'setMasterAuth', 'deleteCluster', 'listOperations', 'getOperation', 'cancelOperation', 'getServerConfig', 'getJsonWebKeys', 'listNodePools', 'getNodePool', 'createNodePool', 'deleteNodePool', 'completeNodePoolUpgrade', 'rollbackNodePoolUpgrade', 'setNodePoolManagement', 'setLabels', 'setLegacyAbac', 'startIpRotation', 'completeIpRotation', 'setNodePoolSize', 'setNetworkPolicy', 'setMaintenancePolicy', 'listUsableSubnetworks', 'checkAutopilotCompatibility', 'listLocations']; + for (const methodName of clusterManagerStubMethods) { + const callPromise = this.clusterManagerStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.clusterManagerStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'container.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'container.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Lists all clusters owned by a project in either the specified zone or all + * zones. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the parent field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides, or "-" for all zones. This field has been deprecated and + * replaced by the parent field. + * @param {string} request.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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.ListClustersResponse | ListClustersResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.list_clusters.js + * region_tag:container_v1beta1_generated_ClusterManager_ListClusters_async + */ + listClusters( + request?: protos.google.container.v1beta1.IListClustersRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IListClustersResponse, + protos.google.container.v1beta1.IListClustersRequest|undefined, {}|undefined + ]>; + listClusters( + request: protos.google.container.v1beta1.IListClustersRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IListClustersResponse, + protos.google.container.v1beta1.IListClustersRequest|null|undefined, + {}|null|undefined>): void; + listClusters( + request: protos.google.container.v1beta1.IListClustersRequest, + callback: Callback< + protos.google.container.v1beta1.IListClustersResponse, + protos.google.container.v1beta1.IListClustersRequest|null|undefined, + {}|null|undefined>): void; + listClusters( + request?: protos.google.container.v1beta1.IListClustersRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IListClustersResponse, + protos.google.container.v1beta1.IListClustersRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IListClustersResponse, + protos.google.container.v1beta1.IListClustersRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IListClustersResponse, + protos.google.container.v1beta1.IListClustersRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + }); + this.initialize(); + return this.innerApiCalls.listClusters(request, options, callback); + } +/** + * Gets the details for a specific cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to retrieve. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to retrieve. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Cluster | Cluster}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.get_cluster.js + * region_tag:container_v1beta1_generated_ClusterManager_GetCluster_async + */ + getCluster( + request?: protos.google.container.v1beta1.IGetClusterRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.ICluster, + protos.google.container.v1beta1.IGetClusterRequest|undefined, {}|undefined + ]>; + getCluster( + request: protos.google.container.v1beta1.IGetClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.ICluster, + protos.google.container.v1beta1.IGetClusterRequest|null|undefined, + {}|null|undefined>): void; + getCluster( + request: protos.google.container.v1beta1.IGetClusterRequest, + callback: Callback< + protos.google.container.v1beta1.ICluster, + protos.google.container.v1beta1.IGetClusterRequest|null|undefined, + {}|null|undefined>): void; + getCluster( + request?: protos.google.container.v1beta1.IGetClusterRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.ICluster, + protos.google.container.v1beta1.IGetClusterRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.ICluster, + protos.google.container.v1beta1.IGetClusterRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.ICluster, + protos.google.container.v1beta1.IGetClusterRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.getCluster(request, options, callback); + } +/** + * 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](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). + * + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the parent field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the parent + * field. + * @param {google.container.v1beta1.Cluster} request.cluster + * Required. A [cluster + * resource](https://cloud.google.com/container-engine/reference/rest/v1beta1/projects.locations.clusters) + * @param {string} request.parent + * The parent (project and location) where the cluster will be created. + * Specified in the format `projects/* /locations/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.create_cluster.js + * region_tag:container_v1beta1_generated_ClusterManager_CreateCluster_async + */ + createCluster( + request?: protos.google.container.v1beta1.ICreateClusterRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICreateClusterRequest|undefined, {}|undefined + ]>; + createCluster( + request: protos.google.container.v1beta1.ICreateClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICreateClusterRequest|null|undefined, + {}|null|undefined>): void; + createCluster( + request: protos.google.container.v1beta1.ICreateClusterRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICreateClusterRequest|null|undefined, + {}|null|undefined>): void; + createCluster( + request?: protos.google.container.v1beta1.ICreateClusterRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICreateClusterRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICreateClusterRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICreateClusterRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + }); + this.initialize(); + return this.innerApiCalls.createCluster(request, options, callback); + } +/** + * Updates the settings for a specific cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {google.container.v1beta1.ClusterUpdate} request.update + * Required. A description of the update. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to update. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.update_cluster.js + * region_tag:container_v1beta1_generated_ClusterManager_UpdateCluster_async + */ + updateCluster( + request?: protos.google.container.v1beta1.IUpdateClusterRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateClusterRequest|undefined, {}|undefined + ]>; + updateCluster( + request: protos.google.container.v1beta1.IUpdateClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateClusterRequest|null|undefined, + {}|null|undefined>): void; + updateCluster( + request: protos.google.container.v1beta1.IUpdateClusterRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateClusterRequest|null|undefined, + {}|null|undefined>): void; + updateCluster( + request?: protos.google.container.v1beta1.IUpdateClusterRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateClusterRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateClusterRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateClusterRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateCluster(request, options, callback); + } +/** + * Updates the version and/or image type of a specific node pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Required. Deprecated. The name of the node pool to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodeVersion + * 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 + * @param {string} request.imageType + * Required. The desired image type for the node pool. Please see + * https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for + * available image types. + * @param {string[]} request.locations + * The desired list of Google Compute Engine + * [zones](https://cloud.google.com/compute/docs/zones#available) in which the + * node pool's nodes should be located. Changing the locations for a node pool + * will result in nodes being either created or removed from the node pool, + * depending on whether locations are being added or removed. + * @param {google.container.v1beta1.WorkloadMetadataConfig} request.workloadMetadataConfig + * The desired workload metadata config for the node pool. + * @param {string} request.name + * The name (project, location, cluster, node pool) of the node pool to + * update. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {google.container.v1beta1.NodePool.UpgradeSettings} request.upgradeSettings + * Upgrade settings control disruption and speed of the upgrade. + * @param {google.container.v1beta1.NetworkTags} request.tags + * The desired network tags to be applied to all nodes in the node pool. + * If this field is not present, the tags will not be changed. Otherwise, + * the existing network tags will be *replaced* with the provided tags. + * @param {google.container.v1beta1.NodeTaints} request.taints + * The desired node taints to be applied to all nodes in the node pool. + * If this field is not present, the taints will not be changed. Otherwise, + * the existing node taints will be *replaced* with the provided taints. + * @param {google.container.v1beta1.NodeLabels} request.labels + * The desired node labels to be applied to all nodes in the node pool. + * If this field is not present, the labels will not be changed. Otherwise, + * the existing node labels will be *replaced* with the provided labels. + * @param {google.container.v1beta1.LinuxNodeConfig} request.linuxNodeConfig + * Parameters that can be configured on Linux nodes. + * @param {google.container.v1beta1.NodeKubeletConfig} request.kubeletConfig + * Node kubelet configs. + * @param {google.container.v1beta1.NodeNetworkConfig} request.nodeNetworkConfig + * Node network config. + * @param {google.container.v1beta1.GcfsConfig} request.gcfsConfig + * GCFS config. + * @param {google.container.v1beta1.ConfidentialNodes} request.confidentialNodes + * Confidential nodes config. + * All the nodes in the node pool will be Confidential VM once enabled. + * @param {google.container.v1beta1.VirtualNIC} request.gvnic + * Enable or disable gvnic on the node pool. + * @param {string} request.etag + * The current etag of the node pool. + * If an etag is provided and does not match the current etag of the node + * pool, update will be blocked and an ABORTED error will be returned. + * @param {google.container.v1beta1.FastSocket} request.fastSocket + * Enable or disable NCCL fast socket for the node pool. + * @param {google.container.v1beta1.NodePoolLoggingConfig} request.loggingConfig + * Logging configuration. + * @param {google.container.v1beta1.ResourceLabels} request.resourceLabels + * The resource labels for the node pool to use to annotate any related + * Google Compute Engine resources. + * @param {google.container.v1beta1.WindowsNodeConfig} request.windowsNodeConfig + * Parameters that can be configured on Windows nodes. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.update_node_pool.js + * region_tag:container_v1beta1_generated_ClusterManager_UpdateNodePool_async + */ + updateNodePool( + request?: protos.google.container.v1beta1.IUpdateNodePoolRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateNodePoolRequest|undefined, {}|undefined + ]>; + updateNodePool( + request: protos.google.container.v1beta1.IUpdateNodePoolRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateNodePoolRequest|null|undefined, + {}|null|undefined>): void; + updateNodePool( + request: protos.google.container.v1beta1.IUpdateNodePoolRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateNodePoolRequest|null|undefined, + {}|null|undefined>): void; + updateNodePool( + request?: protos.google.container.v1beta1.IUpdateNodePoolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateNodePoolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateNodePoolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateNodePoolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateNodePool(request, options, callback); + } +/** + * Sets the autoscaling settings of a specific node pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Required. Deprecated. The name of the node pool to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {google.container.v1beta1.NodePoolAutoscaling} request.autoscaling + * Required. Autoscaling configuration for the node pool. + * @param {string} request.name + * The name (project, location, cluster, node pool) of the node pool to set + * autoscaler settings. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.set_node_pool_autoscaling.js + * region_tag:container_v1beta1_generated_ClusterManager_SetNodePoolAutoscaling_async + */ + setNodePoolAutoscaling( + request?: protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest|undefined, {}|undefined + ]>; + setNodePoolAutoscaling( + request: protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest|null|undefined, + {}|null|undefined>): void; + setNodePoolAutoscaling( + request: protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest|null|undefined, + {}|null|undefined>): void; + setNodePoolAutoscaling( + request?: protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setNodePoolAutoscaling(request, options, callback); + } +/** + * Sets the logging service for a specific cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string} request.loggingService + * Required. The logging service the cluster should use to write logs. + * Currently available options: + * + * * `logging.googleapis.com/kubernetes` - The Cloud Logging + * service with a Kubernetes-native resource model + * * `logging.googleapis.com` - The legacy Cloud Logging service (no longer + * available as of GKE 1.15). + * * `none` - no logs will be exported from the cluster. + * + * If left as an empty string,`logging.googleapis.com/kubernetes` will be + * used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to set logging. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.set_logging_service.js + * region_tag:container_v1beta1_generated_ClusterManager_SetLoggingService_async + */ + setLoggingService( + request?: protos.google.container.v1beta1.ISetLoggingServiceRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLoggingServiceRequest|undefined, {}|undefined + ]>; + setLoggingService( + request: protos.google.container.v1beta1.ISetLoggingServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLoggingServiceRequest|null|undefined, + {}|null|undefined>): void; + setLoggingService( + request: protos.google.container.v1beta1.ISetLoggingServiceRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLoggingServiceRequest|null|undefined, + {}|null|undefined>): void; + setLoggingService( + request?: protos.google.container.v1beta1.ISetLoggingServiceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLoggingServiceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLoggingServiceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLoggingServiceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setLoggingService(request, options, callback); + } +/** + * Sets the monitoring service for a specific cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string} request.monitoringService + * Required. The monitoring service the cluster should use to write metrics. + * Currently available options: + * + * * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring + * service with a Kubernetes-native resource model + * * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no + * longer available as of GKE 1.15). + * * `none` - No metrics will be exported from the cluster. + * + * If left as an empty string,`monitoring.googleapis.com/kubernetes` will be + * used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to set monitoring. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.set_monitoring_service.js + * region_tag:container_v1beta1_generated_ClusterManager_SetMonitoringService_async + */ + setMonitoringService( + request?: protos.google.container.v1beta1.ISetMonitoringServiceRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMonitoringServiceRequest|undefined, {}|undefined + ]>; + setMonitoringService( + request: protos.google.container.v1beta1.ISetMonitoringServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMonitoringServiceRequest|null|undefined, + {}|null|undefined>): void; + setMonitoringService( + request: protos.google.container.v1beta1.ISetMonitoringServiceRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMonitoringServiceRequest|null|undefined, + {}|null|undefined>): void; + setMonitoringService( + request?: protos.google.container.v1beta1.ISetMonitoringServiceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMonitoringServiceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMonitoringServiceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMonitoringServiceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setMonitoringService(request, options, callback); + } +/** + * Sets the addons for a specific cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {google.container.v1beta1.AddonsConfig} request.addonsConfig + * Required. The desired configurations for the various addons available to + * run in the cluster. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to set addons. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.set_addons_config.js + * region_tag:container_v1beta1_generated_ClusterManager_SetAddonsConfig_async + */ + setAddonsConfig( + request?: protos.google.container.v1beta1.ISetAddonsConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetAddonsConfigRequest|undefined, {}|undefined + ]>; + setAddonsConfig( + request: protos.google.container.v1beta1.ISetAddonsConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetAddonsConfigRequest|null|undefined, + {}|null|undefined>): void; + setAddonsConfig( + request: protos.google.container.v1beta1.ISetAddonsConfigRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetAddonsConfigRequest|null|undefined, + {}|null|undefined>): void; + setAddonsConfig( + request?: protos.google.container.v1beta1.ISetAddonsConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetAddonsConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetAddonsConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetAddonsConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setAddonsConfig(request, options, callback); + } +/** + * Sets the locations for a specific cluster. + * Deprecated. Use + * [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters/update) + * instead. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string[]} request.locations + * Required. The desired list of Google Compute Engine + * [zones](https://cloud.google.com/compute/docs/zones#available) 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. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to set locations. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.set_locations.js + * region_tag:container_v1beta1_generated_ClusterManager_SetLocations_async + * @deprecated SetLocations is deprecated and may be removed in a future version. + */ + setLocations( + request?: protos.google.container.v1beta1.ISetLocationsRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLocationsRequest|undefined, {}|undefined + ]>; + setLocations( + request: protos.google.container.v1beta1.ISetLocationsRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLocationsRequest|null|undefined, + {}|null|undefined>): void; + setLocations( + request: protos.google.container.v1beta1.ISetLocationsRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLocationsRequest|null|undefined, + {}|null|undefined>): void; + setLocations( + request?: protos.google.container.v1beta1.ISetLocationsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLocationsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLocationsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLocationsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + this.warn('DEP$ClusterManager-$SetLocations','SetLocations is deprecated and may be removed in a future version.', 'DeprecationWarning'); + return this.innerApiCalls.setLocations(request, options, callback); + } +/** + * Updates the master for a specific cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string} request.masterVersion + * 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 + * @param {string} request.name + * The name (project, location, cluster) of the cluster to update. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.update_master.js + * region_tag:container_v1beta1_generated_ClusterManager_UpdateMaster_async + */ + updateMaster( + request?: protos.google.container.v1beta1.IUpdateMasterRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateMasterRequest|undefined, {}|undefined + ]>; + updateMaster( + request: protos.google.container.v1beta1.IUpdateMasterRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateMasterRequest|null|undefined, + {}|null|undefined>): void; + updateMaster( + request: protos.google.container.v1beta1.IUpdateMasterRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateMasterRequest|null|undefined, + {}|null|undefined>): void; + updateMaster( + request?: protos.google.container.v1beta1.IUpdateMasterRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateMasterRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateMasterRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateMasterRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateMaster(request, options, callback); + } +/** + * Sets master auth materials. Currently supports changing the admin password + * or a specific cluster, either via password generation or explicitly setting + * the password. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {google.container.v1beta1.SetMasterAuthRequest.Action} request.action + * Required. The exact form of action to be taken on the master auth. + * @param {google.container.v1beta1.MasterAuth} request.update + * Required. A description of the update. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to set auth. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.set_master_auth.js + * region_tag:container_v1beta1_generated_ClusterManager_SetMasterAuth_async + */ + setMasterAuth( + request?: protos.google.container.v1beta1.ISetMasterAuthRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMasterAuthRequest|undefined, {}|undefined + ]>; + setMasterAuth( + request: protos.google.container.v1beta1.ISetMasterAuthRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMasterAuthRequest|null|undefined, + {}|null|undefined>): void; + setMasterAuth( + request: protos.google.container.v1beta1.ISetMasterAuthRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMasterAuthRequest|null|undefined, + {}|null|undefined>): void; + setMasterAuth( + request?: protos.google.container.v1beta1.ISetMasterAuthRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMasterAuthRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMasterAuthRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMasterAuthRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setMasterAuth(request, options, callback); + } +/** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to delete. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to delete. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.delete_cluster.js + * region_tag:container_v1beta1_generated_ClusterManager_DeleteCluster_async + */ + deleteCluster( + request?: protos.google.container.v1beta1.IDeleteClusterRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IDeleteClusterRequest|undefined, {}|undefined + ]>; + deleteCluster( + request: protos.google.container.v1beta1.IDeleteClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IDeleteClusterRequest|null|undefined, + {}|null|undefined>): void; + deleteCluster( + request: protos.google.container.v1beta1.IDeleteClusterRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IDeleteClusterRequest|null|undefined, + {}|null|undefined>): void; + deleteCluster( + request?: protos.google.container.v1beta1.IDeleteClusterRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IDeleteClusterRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IDeleteClusterRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IDeleteClusterRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteCluster(request, options, callback); + } +/** + * Lists all operations in a project in the specified zone or all zones. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the parent field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) to return + * operations for, or `-` for all zones. This field has been deprecated and + * replaced by the parent field. + * @param {string} request.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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.ListOperationsResponse | ListOperationsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.list_operations.js + * region_tag:container_v1beta1_generated_ClusterManager_ListOperations_async + */ + listOperations( + request?: protos.google.container.v1beta1.IListOperationsRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IListOperationsResponse, + protos.google.container.v1beta1.IListOperationsRequest|undefined, {}|undefined + ]>; + listOperations( + request: protos.google.container.v1beta1.IListOperationsRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IListOperationsResponse, + protos.google.container.v1beta1.IListOperationsRequest|null|undefined, + {}|null|undefined>): void; + listOperations( + request: protos.google.container.v1beta1.IListOperationsRequest, + callback: Callback< + protos.google.container.v1beta1.IListOperationsResponse, + protos.google.container.v1beta1.IListOperationsRequest|null|undefined, + {}|null|undefined>): void; + listOperations( + request?: protos.google.container.v1beta1.IListOperationsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IListOperationsResponse, + protos.google.container.v1beta1.IListOperationsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IListOperationsResponse, + protos.google.container.v1beta1.IListOperationsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IListOperationsResponse, + protos.google.container.v1beta1.IListOperationsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + }); + this.initialize(); + return this.innerApiCalls.listOperations(request, options, callback); + } +/** + * Gets the specified operation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.operationId + * Required. Deprecated. The server-assigned `name` of the operation. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, operation id) of the operation to get. + * Specified in the format `projects/* /locations/* /operations/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.get_operation.js + * region_tag:container_v1beta1_generated_ClusterManager_GetOperation_async + */ + getOperation( + request?: protos.google.container.v1beta1.IGetOperationRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IGetOperationRequest|undefined, {}|undefined + ]>; + getOperation( + request: protos.google.container.v1beta1.IGetOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IGetOperationRequest|null|undefined, + {}|null|undefined>): void; + getOperation( + request: protos.google.container.v1beta1.IGetOperationRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IGetOperationRequest|null|undefined, + {}|null|undefined>): void; + getOperation( + request?: protos.google.container.v1beta1.IGetOperationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IGetOperationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IGetOperationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IGetOperationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'operation_id': request.operationId ?? '', + }); + this.initialize(); + return this.innerApiCalls.getOperation(request, options, callback); + } +/** + * Cancels the specified operation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * operation resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.operationId + * Required. Deprecated. The server-assigned `name` of the operation. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, operation id) of the operation to cancel. + * Specified in the format `projects/* /locations/* /operations/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.cancel_operation.js + * region_tag:container_v1beta1_generated_ClusterManager_CancelOperation_async + */ + cancelOperation( + request?: protos.google.container.v1beta1.ICancelOperationRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.container.v1beta1.ICancelOperationRequest|undefined, {}|undefined + ]>; + cancelOperation( + request: protos.google.container.v1beta1.ICancelOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1beta1.ICancelOperationRequest|null|undefined, + {}|null|undefined>): void; + cancelOperation( + request: protos.google.container.v1beta1.ICancelOperationRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1beta1.ICancelOperationRequest|null|undefined, + {}|null|undefined>): void; + cancelOperation( + request?: protos.google.container.v1beta1.ICancelOperationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1beta1.ICancelOperationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1beta1.ICancelOperationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.container.v1beta1.ICancelOperationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'operation_id': request.operationId ?? '', + }); + this.initialize(); + return this.innerApiCalls.cancelOperation(request, options, callback); + } +/** + * Returns configuration info about the Google Kubernetes Engine service. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) to return + * operations for. This field has been deprecated and replaced by the name + * field. + * @param {string} request.name + * The name (project and location) of the server config to get, + * specified in the format `projects/* /locations/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.ServerConfig | ServerConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.get_server_config.js + * region_tag:container_v1beta1_generated_ClusterManager_GetServerConfig_async + */ + getServerConfig( + request?: protos.google.container.v1beta1.IGetServerConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IServerConfig, + protos.google.container.v1beta1.IGetServerConfigRequest|undefined, {}|undefined + ]>; + getServerConfig( + request: protos.google.container.v1beta1.IGetServerConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IServerConfig, + protos.google.container.v1beta1.IGetServerConfigRequest|null|undefined, + {}|null|undefined>): void; + getServerConfig( + request: protos.google.container.v1beta1.IGetServerConfigRequest, + callback: Callback< + protos.google.container.v1beta1.IServerConfig, + protos.google.container.v1beta1.IGetServerConfigRequest|null|undefined, + {}|null|undefined>): void; + getServerConfig( + request?: protos.google.container.v1beta1.IGetServerConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IServerConfig, + protos.google.container.v1beta1.IGetServerConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IServerConfig, + protos.google.container.v1beta1.IGetServerConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IServerConfig, + protos.google.container.v1beta1.IGetServerConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + }); + this.initialize(); + return this.innerApiCalls.getServerConfig(request, options, callback); + } +/** + * Gets the public component of the cluster signing keys in + * JSON Web Key format. + * This API is not yet intended for general use, and is not available for all + * clusters. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The cluster (project, location, cluster name) to get keys for. Specified in + * the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.GetJSONWebKeysResponse | GetJSONWebKeysResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.get_j_s_o_n_web_keys.js + * region_tag:container_v1beta1_generated_ClusterManager_GetJSONWebKeys_async + */ + getJSONWebKeys( + request?: protos.google.container.v1beta1.IGetJSONWebKeysRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IGetJSONWebKeysResponse, + protos.google.container.v1beta1.IGetJSONWebKeysRequest|undefined, {}|undefined + ]>; + getJSONWebKeys( + request: protos.google.container.v1beta1.IGetJSONWebKeysRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IGetJSONWebKeysResponse, + protos.google.container.v1beta1.IGetJSONWebKeysRequest|null|undefined, + {}|null|undefined>): void; + getJSONWebKeys( + request: protos.google.container.v1beta1.IGetJSONWebKeysRequest, + callback: Callback< + protos.google.container.v1beta1.IGetJSONWebKeysResponse, + protos.google.container.v1beta1.IGetJSONWebKeysRequest|null|undefined, + {}|null|undefined>): void; + getJSONWebKeys( + request?: protos.google.container.v1beta1.IGetJSONWebKeysRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IGetJSONWebKeysResponse, + protos.google.container.v1beta1.IGetJSONWebKeysRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IGetJSONWebKeysResponse, + protos.google.container.v1beta1.IGetJSONWebKeysRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IGetJSONWebKeysResponse, + protos.google.container.v1beta1.IGetJSONWebKeysRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.getJsonWebKeys(request, options, callback); + } +/** + * Lists the node pools for a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the parent field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the parent + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the parent field. + * @param {string} request.parent + * The parent (project, location, cluster name) where the node pools will be + * listed. Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.ListNodePoolsResponse | ListNodePoolsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.list_node_pools.js + * region_tag:container_v1beta1_generated_ClusterManager_ListNodePools_async + */ + listNodePools( + request?: protos.google.container.v1beta1.IListNodePoolsRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IListNodePoolsResponse, + protos.google.container.v1beta1.IListNodePoolsRequest|undefined, {}|undefined + ]>; + listNodePools( + request: protos.google.container.v1beta1.IListNodePoolsRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IListNodePoolsResponse, + protos.google.container.v1beta1.IListNodePoolsRequest|null|undefined, + {}|null|undefined>): void; + listNodePools( + request: protos.google.container.v1beta1.IListNodePoolsRequest, + callback: Callback< + protos.google.container.v1beta1.IListNodePoolsResponse, + protos.google.container.v1beta1.IListNodePoolsRequest|null|undefined, + {}|null|undefined>): void; + listNodePools( + request?: protos.google.container.v1beta1.IListNodePoolsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IListNodePoolsResponse, + protos.google.container.v1beta1.IListNodePoolsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IListNodePoolsResponse, + protos.google.container.v1beta1.IListNodePoolsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IListNodePoolsResponse, + protos.google.container.v1beta1.IListNodePoolsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.listNodePools(request, options, callback); + } +/** + * Retrieves the requested node pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Required. Deprecated. The name of the node pool. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster, node pool id) of the node pool to + * get. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.NodePool | NodePool}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.get_node_pool.js + * region_tag:container_v1beta1_generated_ClusterManager_GetNodePool_async + */ + getNodePool( + request?: protos.google.container.v1beta1.IGetNodePoolRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.INodePool, + protos.google.container.v1beta1.IGetNodePoolRequest|undefined, {}|undefined + ]>; + getNodePool( + request: protos.google.container.v1beta1.IGetNodePoolRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.INodePool, + protos.google.container.v1beta1.IGetNodePoolRequest|null|undefined, + {}|null|undefined>): void; + getNodePool( + request: protos.google.container.v1beta1.IGetNodePoolRequest, + callback: Callback< + protos.google.container.v1beta1.INodePool, + protos.google.container.v1beta1.IGetNodePoolRequest|null|undefined, + {}|null|undefined>): void; + getNodePool( + request?: protos.google.container.v1beta1.IGetNodePoolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.INodePool, + protos.google.container.v1beta1.IGetNodePoolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.INodePool, + protos.google.container.v1beta1.IGetNodePoolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.INodePool, + protos.google.container.v1beta1.IGetNodePoolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.getNodePool(request, options, callback); + } +/** + * Creates a node pool for a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the parent field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the parent + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the parent field. + * @param {google.container.v1beta1.NodePool} request.nodePool + * Required. The node pool to create. + * @param {string} request.parent + * The parent (project, location, cluster name) where the node pool will be + * created. Specified in the format + * `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.create_node_pool.js + * region_tag:container_v1beta1_generated_ClusterManager_CreateNodePool_async + */ + createNodePool( + request?: protos.google.container.v1beta1.ICreateNodePoolRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICreateNodePoolRequest|undefined, {}|undefined + ]>; + createNodePool( + request: protos.google.container.v1beta1.ICreateNodePoolRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICreateNodePoolRequest|null|undefined, + {}|null|undefined>): void; + createNodePool( + request: protos.google.container.v1beta1.ICreateNodePoolRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICreateNodePoolRequest|null|undefined, + {}|null|undefined>): void; + createNodePool( + request?: protos.google.container.v1beta1.ICreateNodePoolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICreateNodePoolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICreateNodePoolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICreateNodePoolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.createNodePool(request, options, callback); + } +/** + * Deletes a node pool from a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Required. Deprecated. The name of the node pool to delete. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster, node pool id) of the node pool to + * delete. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.delete_node_pool.js + * region_tag:container_v1beta1_generated_ClusterManager_DeleteNodePool_async + */ + deleteNodePool( + request?: protos.google.container.v1beta1.IDeleteNodePoolRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IDeleteNodePoolRequest|undefined, {}|undefined + ]>; + deleteNodePool( + request: protos.google.container.v1beta1.IDeleteNodePoolRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IDeleteNodePoolRequest|null|undefined, + {}|null|undefined>): void; + deleteNodePool( + request: protos.google.container.v1beta1.IDeleteNodePoolRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IDeleteNodePoolRequest|null|undefined, + {}|null|undefined>): void; + deleteNodePool( + request?: protos.google.container.v1beta1.IDeleteNodePoolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IDeleteNodePoolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IDeleteNodePoolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IDeleteNodePoolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteNodePool(request, options, callback); + } +/** + * CompleteNodePoolUpgrade will signal an on-going node pool upgrade to + * complete. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The name (project, location, cluster, node pool id) of the node pool to + * complete upgrade. + * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.complete_node_pool_upgrade.js + * region_tag:container_v1beta1_generated_ClusterManager_CompleteNodePoolUpgrade_async + */ + completeNodePoolUpgrade( + request?: protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest|undefined, {}|undefined + ]>; + completeNodePoolUpgrade( + request: protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>): void; + completeNodePoolUpgrade( + request: protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>): void; + completeNodePoolUpgrade( + request?: protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.completeNodePoolUpgrade(request, options, callback); + } +/** + * Rolls back a previously Aborted or Failed NodePool upgrade. + * This makes no changes if the last upgrade successfully completed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to rollback. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Required. Deprecated. The name of the node pool to rollback. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster, node pool id) of the node poll to + * rollback upgrade. + * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {boolean} request.respectPdb + * Option for rollback to ignore the PodDisruptionBudget. + * Default value is false. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.rollback_node_pool_upgrade.js + * region_tag:container_v1beta1_generated_ClusterManager_RollbackNodePoolUpgrade_async + */ + rollbackNodePoolUpgrade( + request?: protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest|undefined, {}|undefined + ]>; + rollbackNodePoolUpgrade( + request: protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>): void; + rollbackNodePoolUpgrade( + request: protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>): void; + rollbackNodePoolUpgrade( + request?: protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.rollbackNodePoolUpgrade(request, options, callback); + } +/** + * Sets the NodeManagement options for a node pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to update. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Required. Deprecated. The name of the node pool to update. + * This field has been deprecated and replaced by the name field. + * @param {google.container.v1beta1.NodeManagement} request.management + * Required. NodeManagement configuration for the node pool. + * @param {string} request.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/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.set_node_pool_management.js + * region_tag:container_v1beta1_generated_ClusterManager_SetNodePoolManagement_async + */ + setNodePoolManagement( + request?: protos.google.container.v1beta1.ISetNodePoolManagementRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolManagementRequest|undefined, {}|undefined + ]>; + setNodePoolManagement( + request: protos.google.container.v1beta1.ISetNodePoolManagementRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolManagementRequest|null|undefined, + {}|null|undefined>): void; + setNodePoolManagement( + request: protos.google.container.v1beta1.ISetNodePoolManagementRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolManagementRequest|null|undefined, + {}|null|undefined>): void; + setNodePoolManagement( + request?: protos.google.container.v1beta1.ISetNodePoolManagementRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolManagementRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolManagementRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolManagementRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setNodePoolManagement(request, options, callback); + } +/** + * Sets labels on a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the name field. + * @param {number[]} request.resourceLabels + * Required. The labels to set for that cluster. + * @param {string} request.labelFingerprint + * 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. + * @param {string} request.name + * The name (project, location, cluster name) of the cluster to set labels. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.set_labels.js + * region_tag:container_v1beta1_generated_ClusterManager_SetLabels_async + */ + setLabels( + request?: protos.google.container.v1beta1.ISetLabelsRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLabelsRequest|undefined, {}|undefined + ]>; + setLabels( + request: protos.google.container.v1beta1.ISetLabelsRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLabelsRequest|null|undefined, + {}|null|undefined>): void; + setLabels( + request: protos.google.container.v1beta1.ISetLabelsRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLabelsRequest|null|undefined, + {}|null|undefined>): void; + setLabels( + request?: protos.google.container.v1beta1.ISetLabelsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLabelsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLabelsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLabelsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setLabels(request, options, callback); + } +/** + * Enables or disables the ABAC authorization mechanism on a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to update. + * This field has been deprecated and replaced by the name field. + * @param {boolean} request.enabled + * Required. Whether ABAC authorization will be enabled in the cluster. + * @param {string} request.name + * The name (project, location, cluster name) of the cluster to set legacy + * abac. Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.set_legacy_abac.js + * region_tag:container_v1beta1_generated_ClusterManager_SetLegacyAbac_async + */ + setLegacyAbac( + request?: protos.google.container.v1beta1.ISetLegacyAbacRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLegacyAbacRequest|undefined, {}|undefined + ]>; + setLegacyAbac( + request: protos.google.container.v1beta1.ISetLegacyAbacRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLegacyAbacRequest|null|undefined, + {}|null|undefined>): void; + setLegacyAbac( + request: protos.google.container.v1beta1.ISetLegacyAbacRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLegacyAbacRequest|null|undefined, + {}|null|undefined>): void; + setLegacyAbac( + request?: protos.google.container.v1beta1.ISetLegacyAbacRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLegacyAbacRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLegacyAbacRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLegacyAbacRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setLegacyAbac(request, options, callback); + } +/** + * Starts master IP rotation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster name) of the cluster to start IP + * rotation. Specified in the format `projects/* /locations/* /clusters/*`. + * @param {boolean} request.rotateCredentials + * Whether to rotate credentials during IP rotation. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.start_i_p_rotation.js + * region_tag:container_v1beta1_generated_ClusterManager_StartIPRotation_async + */ + startIPRotation( + request?: protos.google.container.v1beta1.IStartIPRotationRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IStartIPRotationRequest|undefined, {}|undefined + ]>; + startIPRotation( + request: protos.google.container.v1beta1.IStartIPRotationRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IStartIPRotationRequest|null|undefined, + {}|null|undefined>): void; + startIPRotation( + request: protos.google.container.v1beta1.IStartIPRotationRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IStartIPRotationRequest|null|undefined, + {}|null|undefined>): void; + startIPRotation( + request?: protos.google.container.v1beta1.IStartIPRotationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IStartIPRotationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IStartIPRotationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IStartIPRotationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.startIpRotation(request, options, callback); + } +/** + * Completes master IP rotation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster name) of the cluster to complete IP + * rotation. Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.complete_i_p_rotation.js + * region_tag:container_v1beta1_generated_ClusterManager_CompleteIPRotation_async + */ + completeIPRotation( + request?: protos.google.container.v1beta1.ICompleteIPRotationRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICompleteIPRotationRequest|undefined, {}|undefined + ]>; + completeIPRotation( + request: protos.google.container.v1beta1.ICompleteIPRotationRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICompleteIPRotationRequest|null|undefined, + {}|null|undefined>): void; + completeIPRotation( + request: protos.google.container.v1beta1.ICompleteIPRotationRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICompleteIPRotationRequest|null|undefined, + {}|null|undefined>): void; + completeIPRotation( + request?: protos.google.container.v1beta1.ICompleteIPRotationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICompleteIPRotationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICompleteIPRotationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICompleteIPRotationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.completeIpRotation(request, options, callback); + } +/** + * SetNodePoolSizeRequest sets the size of a node pool. The new size will be + * used for all replicas, including future replicas created by modifying + * {@link google.container.v1beta1.NodePool.locations|NodePool.locations}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to update. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Required. Deprecated. The name of the node pool to update. + * This field has been deprecated and replaced by the name field. + * @param {number} request.nodeCount + * Required. The desired node count for the pool. + * @param {string} request.name + * The name (project, location, cluster, node pool id) of the node pool to set + * size. + * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.set_node_pool_size.js + * region_tag:container_v1beta1_generated_ClusterManager_SetNodePoolSize_async + */ + setNodePoolSize( + request?: protos.google.container.v1beta1.ISetNodePoolSizeRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolSizeRequest|undefined, {}|undefined + ]>; + setNodePoolSize( + request: protos.google.container.v1beta1.ISetNodePoolSizeRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolSizeRequest|null|undefined, + {}|null|undefined>): void; + setNodePoolSize( + request: protos.google.container.v1beta1.ISetNodePoolSizeRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolSizeRequest|null|undefined, + {}|null|undefined>): void; + setNodePoolSize( + request?: protos.google.container.v1beta1.ISetNodePoolSizeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolSizeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolSizeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolSizeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setNodePoolSize(request, options, callback); + } +/** + * Enables or disables Network Policy for a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the name field. + * @param {google.container.v1beta1.NetworkPolicy} request.networkPolicy + * Required. Configuration options for the NetworkPolicy feature. + * @param {string} request.name + * The name (project, location, cluster name) of the cluster to set networking + * policy. Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.set_network_policy.js + * region_tag:container_v1beta1_generated_ClusterManager_SetNetworkPolicy_async + */ + setNetworkPolicy( + request?: protos.google.container.v1beta1.ISetNetworkPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNetworkPolicyRequest|undefined, {}|undefined + ]>; + setNetworkPolicy( + request: protos.google.container.v1beta1.ISetNetworkPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNetworkPolicyRequest|null|undefined, + {}|null|undefined>): void; + setNetworkPolicy( + request: protos.google.container.v1beta1.ISetNetworkPolicyRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNetworkPolicyRequest|null|undefined, + {}|null|undefined>): void; + setNetworkPolicy( + request?: protos.google.container.v1beta1.ISetNetworkPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNetworkPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNetworkPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNetworkPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setNetworkPolicy(request, options, callback); + } +/** + * Sets the maintenance policy for a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * @param {string} request.zone + * Required. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. + * @param {string} request.clusterId + * Required. The name of the cluster to update. + * @param {google.container.v1beta1.MaintenancePolicy} request.maintenancePolicy + * Required. The maintenance policy to be set for the cluster. An empty field + * clears the existing maintenance policy. + * @param {string} request.name + * The name (project, location, cluster name) of the cluster to set + * maintenance policy. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.set_maintenance_policy.js + * region_tag:container_v1beta1_generated_ClusterManager_SetMaintenancePolicy_async + */ + setMaintenancePolicy( + request?: protos.google.container.v1beta1.ISetMaintenancePolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMaintenancePolicyRequest|undefined, {}|undefined + ]>; + setMaintenancePolicy( + request: protos.google.container.v1beta1.ISetMaintenancePolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMaintenancePolicyRequest|null|undefined, + {}|null|undefined>): void; + setMaintenancePolicy( + request: protos.google.container.v1beta1.ISetMaintenancePolicyRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMaintenancePolicyRequest|null|undefined, + {}|null|undefined>): void; + setMaintenancePolicy( + request?: protos.google.container.v1beta1.ISetMaintenancePolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMaintenancePolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMaintenancePolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMaintenancePolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setMaintenancePolicy(request, options, callback); + } +/** + * Checks the cluster compatibility with Autopilot mode, and returns a list of + * compatibility issues. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to retrieve. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.CheckAutopilotCompatibilityResponse | CheckAutopilotCompatibilityResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js + * region_tag:container_v1beta1_generated_ClusterManager_CheckAutopilotCompatibility_async + */ + checkAutopilotCompatibility( + request?: protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, + protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest|undefined, {}|undefined + ]>; + checkAutopilotCompatibility( + request: protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, + protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest|null|undefined, + {}|null|undefined>): void; + checkAutopilotCompatibility( + request: protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest, + callback: Callback< + protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, + protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest|null|undefined, + {}|null|undefined>): void; + checkAutopilotCompatibility( + request?: protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, + protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, + protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, + protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.checkAutopilotCompatibility(request, options, callback); + } +/** + * Fetches locations that offer Google Kubernetes Engine. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Contains the name of the resource requested. + * Specified in the format `projects/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.ListLocationsResponse | ListLocationsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.list_locations.js + * region_tag:container_v1beta1_generated_ClusterManager_ListLocations_async + */ + listLocations( + request?: protos.google.container.v1beta1.IListLocationsRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IListLocationsResponse, + protos.google.container.v1beta1.IListLocationsRequest|undefined, {}|undefined + ]>; + listLocations( + request: protos.google.container.v1beta1.IListLocationsRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IListLocationsResponse, + protos.google.container.v1beta1.IListLocationsRequest|null|undefined, + {}|null|undefined>): void; + listLocations( + request: protos.google.container.v1beta1.IListLocationsRequest, + callback: Callback< + protos.google.container.v1beta1.IListLocationsResponse, + protos.google.container.v1beta1.IListLocationsRequest|null|undefined, + {}|null|undefined>): void; + listLocations( + request?: protos.google.container.v1beta1.IListLocationsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IListLocationsResponse, + protos.google.container.v1beta1.IListLocationsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IListLocationsResponse, + protos.google.container.v1beta1.IListLocationsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IListLocationsResponse, + protos.google.container.v1beta1.IListLocationsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listLocations(request, options, callback); + } + + /** + * Lists subnetworks that can be used for creating clusters in a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent project where subnetworks are usable. + * Specified in the format `projects/*`. + * @param {string} request.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. + * @param {number} request.pageSize + * 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) + * @param {string} request.pageToken + * Specifies a page token to use. Set this to the nextPageToken returned by + * previous list requests to get the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.container.v1beta1.UsableSubnetwork | UsableSubnetwork}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listUsableSubnetworksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listUsableSubnetworks( + request?: protos.google.container.v1beta1.IListUsableSubnetworksRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IUsableSubnetwork[], + protos.google.container.v1beta1.IListUsableSubnetworksRequest|null, + protos.google.container.v1beta1.IListUsableSubnetworksResponse + ]>; + listUsableSubnetworks( + request: protos.google.container.v1beta1.IListUsableSubnetworksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.container.v1beta1.IListUsableSubnetworksRequest, + protos.google.container.v1beta1.IListUsableSubnetworksResponse|null|undefined, + protos.google.container.v1beta1.IUsableSubnetwork>): void; + listUsableSubnetworks( + request: protos.google.container.v1beta1.IListUsableSubnetworksRequest, + callback: PaginationCallback< + protos.google.container.v1beta1.IListUsableSubnetworksRequest, + protos.google.container.v1beta1.IListUsableSubnetworksResponse|null|undefined, + protos.google.container.v1beta1.IUsableSubnetwork>): void; + listUsableSubnetworks( + request?: protos.google.container.v1beta1.IListUsableSubnetworksRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.container.v1beta1.IListUsableSubnetworksRequest, + protos.google.container.v1beta1.IListUsableSubnetworksResponse|null|undefined, + protos.google.container.v1beta1.IUsableSubnetwork>, + callback?: PaginationCallback< + protos.google.container.v1beta1.IListUsableSubnetworksRequest, + protos.google.container.v1beta1.IListUsableSubnetworksResponse|null|undefined, + protos.google.container.v1beta1.IUsableSubnetwork>): + Promise<[ + protos.google.container.v1beta1.IUsableSubnetwork[], + protos.google.container.v1beta1.IListUsableSubnetworksRequest|null, + protos.google.container.v1beta1.IListUsableSubnetworksResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listUsableSubnetworks(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent project where subnetworks are usable. + * Specified in the format `projects/*`. + * @param {string} request.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. + * @param {number} request.pageSize + * 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) + * @param {string} request.pageToken + * Specifies a page token to use. Set this to the nextPageToken returned by + * previous list requests to get the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.container.v1beta1.UsableSubnetwork | UsableSubnetwork} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listUsableSubnetworksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listUsableSubnetworksStream( + request?: protos.google.container.v1beta1.IListUsableSubnetworksRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUsableSubnetworks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listUsableSubnetworks.createStream( + this.innerApiCalls.listUsableSubnetworks as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listUsableSubnetworks`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent project where subnetworks are usable. + * Specified in the format `projects/*`. + * @param {string} request.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. + * @param {number} request.pageSize + * 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) + * @param {string} request.pageToken + * Specifies a page token to use. Set this to the nextPageToken returned by + * previous list requests to get the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.container.v1beta1.UsableSubnetwork | UsableSubnetwork}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.list_usable_subnetworks.js + * region_tag:container_v1beta1_generated_ClusterManager_ListUsableSubnetworks_async + */ + listUsableSubnetworksAsync( + request?: protos.google.container.v1beta1.IListUsableSubnetworksRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUsableSubnetworks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listUsableSubnetworks.asyncIterate( + this.innerApiCalls['listUsableSubnetworks'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.clusterManagerStub && !this._terminated) { + return this.clusterManagerStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client_config.json b/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client_config.json new file mode 100644 index 00000000000..911352f9362 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client_config.json @@ -0,0 +1,198 @@ +{ + "interfaces": { + "google.container.v1beta1.ClusterManager": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListClusters": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetCluster": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateCluster": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCluster": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateNodePool": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetNodePoolAutoscaling": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLoggingService": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetMonitoringService": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetAddonsConfig": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLocations": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateMaster": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetMasterAuth": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCluster": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListOperations": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetOperation": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CancelOperation": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetServerConfig": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetJSONWebKeys": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListNodePools": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetNodePool": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateNodePool": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteNodePool": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CompleteNodePoolUpgrade": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RollbackNodePoolUpgrade": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetNodePoolManagement": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLabels": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLegacyAbac": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StartIPRotation": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CompleteIPRotation": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetNodePoolSize": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetNetworkPolicy": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetMaintenancePolicy": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListUsableSubnetworks": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CheckAutopilotCompatibility": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListLocations": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_proto_list.json b/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_proto_list.json new file mode 100644 index 00000000000..7a594ccf698 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/container/v1beta1/cluster_service.proto" +] diff --git a/owl-bot-staging/google-container/v1beta1/src/v1beta1/gapic_metadata.json b/owl-bot-staging/google-container/v1beta1/src/v1beta1/gapic_metadata.json new file mode 100644 index 00000000000..0278af900c2 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/src/v1beta1/gapic_metadata.json @@ -0,0 +1,377 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.container.v1beta1", + "libraryPackage": "@google-cloud/container", + "services": { + "ClusterManager": { + "clients": { + "grpc": { + "libraryClient": "ClusterManagerClient", + "rpcs": { + "ListClusters": { + "methods": [ + "listClusters" + ] + }, + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "UpdateNodePool": { + "methods": [ + "updateNodePool" + ] + }, + "SetNodePoolAutoscaling": { + "methods": [ + "setNodePoolAutoscaling" + ] + }, + "SetLoggingService": { + "methods": [ + "setLoggingService" + ] + }, + "SetMonitoringService": { + "methods": [ + "setMonitoringService" + ] + }, + "SetAddonsConfig": { + "methods": [ + "setAddonsConfig" + ] + }, + "SetLocations": { + "methods": [ + "setLocations" + ] + }, + "UpdateMaster": { + "methods": [ + "updateMaster" + ] + }, + "SetMasterAuth": { + "methods": [ + "setMasterAuth" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "ListOperations": { + "methods": [ + "listOperations" + ] + }, + "GetOperation": { + "methods": [ + "getOperation" + ] + }, + "CancelOperation": { + "methods": [ + "cancelOperation" + ] + }, + "GetServerConfig": { + "methods": [ + "getServerConfig" + ] + }, + "GetJSONWebKeys": { + "methods": [ + "getJSONWebKeys" + ] + }, + "ListNodePools": { + "methods": [ + "listNodePools" + ] + }, + "GetNodePool": { + "methods": [ + "getNodePool" + ] + }, + "CreateNodePool": { + "methods": [ + "createNodePool" + ] + }, + "DeleteNodePool": { + "methods": [ + "deleteNodePool" + ] + }, + "CompleteNodePoolUpgrade": { + "methods": [ + "completeNodePoolUpgrade" + ] + }, + "RollbackNodePoolUpgrade": { + "methods": [ + "rollbackNodePoolUpgrade" + ] + }, + "SetNodePoolManagement": { + "methods": [ + "setNodePoolManagement" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "SetLegacyAbac": { + "methods": [ + "setLegacyAbac" + ] + }, + "StartIPRotation": { + "methods": [ + "startIPRotation" + ] + }, + "CompleteIPRotation": { + "methods": [ + "completeIPRotation" + ] + }, + "SetNodePoolSize": { + "methods": [ + "setNodePoolSize" + ] + }, + "SetNetworkPolicy": { + "methods": [ + "setNetworkPolicy" + ] + }, + "SetMaintenancePolicy": { + "methods": [ + "setMaintenancePolicy" + ] + }, + "CheckAutopilotCompatibility": { + "methods": [ + "checkAutopilotCompatibility" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + }, + "ListUsableSubnetworks": { + "methods": [ + "listUsableSubnetworks", + "listUsableSubnetworksStream", + "listUsableSubnetworksAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ClusterManagerClient", + "rpcs": { + "ListClusters": { + "methods": [ + "listClusters" + ] + }, + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "UpdateNodePool": { + "methods": [ + "updateNodePool" + ] + }, + "SetNodePoolAutoscaling": { + "methods": [ + "setNodePoolAutoscaling" + ] + }, + "SetLoggingService": { + "methods": [ + "setLoggingService" + ] + }, + "SetMonitoringService": { + "methods": [ + "setMonitoringService" + ] + }, + "SetAddonsConfig": { + "methods": [ + "setAddonsConfig" + ] + }, + "SetLocations": { + "methods": [ + "setLocations" + ] + }, + "UpdateMaster": { + "methods": [ + "updateMaster" + ] + }, + "SetMasterAuth": { + "methods": [ + "setMasterAuth" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "ListOperations": { + "methods": [ + "listOperations" + ] + }, + "GetOperation": { + "methods": [ + "getOperation" + ] + }, + "CancelOperation": { + "methods": [ + "cancelOperation" + ] + }, + "GetServerConfig": { + "methods": [ + "getServerConfig" + ] + }, + "GetJSONWebKeys": { + "methods": [ + "getJSONWebKeys" + ] + }, + "ListNodePools": { + "methods": [ + "listNodePools" + ] + }, + "GetNodePool": { + "methods": [ + "getNodePool" + ] + }, + "CreateNodePool": { + "methods": [ + "createNodePool" + ] + }, + "DeleteNodePool": { + "methods": [ + "deleteNodePool" + ] + }, + "CompleteNodePoolUpgrade": { + "methods": [ + "completeNodePoolUpgrade" + ] + }, + "RollbackNodePoolUpgrade": { + "methods": [ + "rollbackNodePoolUpgrade" + ] + }, + "SetNodePoolManagement": { + "methods": [ + "setNodePoolManagement" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "SetLegacyAbac": { + "methods": [ + "setLegacyAbac" + ] + }, + "StartIPRotation": { + "methods": [ + "startIPRotation" + ] + }, + "CompleteIPRotation": { + "methods": [ + "completeIPRotation" + ] + }, + "SetNodePoolSize": { + "methods": [ + "setNodePoolSize" + ] + }, + "SetNetworkPolicy": { + "methods": [ + "setNetworkPolicy" + ] + }, + "SetMaintenancePolicy": { + "methods": [ + "setMaintenancePolicy" + ] + }, + "CheckAutopilotCompatibility": { + "methods": [ + "checkAutopilotCompatibility" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + }, + "ListUsableSubnetworks": { + "methods": [ + "listUsableSubnetworks", + "listUsableSubnetworksStream", + "listUsableSubnetworksAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-container/v1beta1/src/v1beta1/index.ts b/owl-bot-staging/google-container/v1beta1/src/v1beta1/index.ts new file mode 100644 index 00000000000..b1b39233034 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/src/v1beta1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {ClusterManagerClient} from './cluster_manager_client'; diff --git a/owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..1101d781caa --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const container = require('@google-cloud/container'); + +function main() { + const clusterManagerClient = new container.ClusterManagerClient(); +} + +main(); diff --git a/owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..6685b8649e6 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {ClusterManagerClient} from '@google-cloud/container'; + +// check that the client class type name can be used +function doStuffWithClusterManagerClient(client: ClusterManagerClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const clusterManagerClient = new ClusterManagerClient(); + doStuffWithClusterManagerClient(clusterManagerClient); +} + +main(); diff --git a/owl-bot-staging/google-container/v1beta1/system-test/install.ts b/owl-bot-staging/google-container/v1beta1/system-test/install.ts new file mode 100644 index 00000000000..c8f81b25a86 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-container/v1beta1/test/gapic_cluster_manager_v1beta1.ts b/owl-bot-staging/google-container/v1beta1/test/gapic_cluster_manager_v1beta1.ts new file mode 100644 index 00000000000..7f93f752f2c --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/test/gapic_cluster_manager_v1beta1.ts @@ -0,0 +1,5238 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as clustermanagerModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta1.ClusterManagerClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = clustermanagerModule.v1beta1.ClusterManagerClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = clustermanagerModule.v1beta1.ClusterManagerClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = clustermanagerModule.v1beta1.ClusterManagerClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.clusterManagerStub, undefined); + await client.initialize(); + assert(client.clusterManagerStub); + }); + + it('has close method for the initialized client', done => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.clusterManagerStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.clusterManagerStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('listClusters', () => { + it('invokes listClusters without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.ListClustersResponse() + ); + client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); + const [response] = await client.listClusters(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.ListClustersResponse() + ); + client.innerApiCalls.listClusters = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listClusters( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IListClustersResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listClusters = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listClusters(request), expectedError); + const actualRequest = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['zone']); + request.zone = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listClusters(request), expectedError); + }); + }); + + describe('getCluster', () => { + it('invokes getCluster without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Cluster() + ); + client.innerApiCalls.getCluster = stubSimpleCall(expectedResponse); + const [response] = await client.getCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Cluster() + ); + client.innerApiCalls.getCluster = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCluster( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.ICluster|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCluster = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCluster(request), expectedError); + }); + }); + + describe('createCluster', () => { + it('invokes createCluster without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.createCluster = stubSimpleCall(expectedResponse); + const [response] = await client.createCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.createCluster = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCluster( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCluster = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['zone']); + request.zone = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createCluster(request), expectedError); + }); + }); + + describe('updateCluster', () => { + it('invokes updateCluster without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.UpdateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.updateCluster = stubSimpleCall(expectedResponse); + const [response] = await client.updateCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.UpdateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.updateCluster = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCluster( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.UpdateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCluster = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.UpdateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateCluster(request), expectedError); + }); + }); + + describe('updateNodePool', () => { + it('invokes updateNodePool without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.UpdateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.updateNodePool = stubSimpleCall(expectedResponse); + const [response] = await client.updateNodePool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateNodePool without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.UpdateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.updateNodePool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateNodePool( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateNodePool with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.UpdateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateNodePool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateNodePool(request), expectedError); + const actualRequest = (client.innerApiCalls.updateNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateNodePool with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.UpdateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateNodePool(request), expectedError); + }); + }); + + describe('setNodePoolAutoscaling', () => { + it('invokes setNodePoolAutoscaling without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNodePoolAutoscalingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCall(expectedResponse); + const [response] = await client.setNodePoolAutoscaling(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolAutoscaling without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNodePoolAutoscalingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setNodePoolAutoscaling( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolAutoscaling with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNodePoolAutoscalingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setNodePoolAutoscaling(request), expectedError); + const actualRequest = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolAutoscaling with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNodePoolAutoscalingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setNodePoolAutoscaling(request), expectedError); + }); + }); + + describe('setLoggingService', () => { + it('invokes setLoggingService without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLoggingServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setLoggingService = stubSimpleCall(expectedResponse); + const [response] = await client.setLoggingService(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLoggingService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLoggingService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLoggingService without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLoggingServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setLoggingService = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLoggingService( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLoggingService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLoggingService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLoggingService with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLoggingServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setLoggingService = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLoggingService(request), expectedError); + const actualRequest = (client.innerApiCalls.setLoggingService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLoggingService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLoggingService with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLoggingServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setLoggingService(request), expectedError); + }); + }); + + describe('setMonitoringService', () => { + it('invokes setMonitoringService without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetMonitoringServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setMonitoringService = stubSimpleCall(expectedResponse); + const [response] = await client.setMonitoringService(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMonitoringService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMonitoringService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMonitoringService without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetMonitoringServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setMonitoringService = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setMonitoringService( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMonitoringService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMonitoringService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMonitoringService with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetMonitoringServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setMonitoringService = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setMonitoringService(request), expectedError); + const actualRequest = (client.innerApiCalls.setMonitoringService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMonitoringService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMonitoringService with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetMonitoringServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setMonitoringService(request), expectedError); + }); + }); + + describe('setAddonsConfig', () => { + it('invokes setAddonsConfig without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetAddonsConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setAddonsConfig = stubSimpleCall(expectedResponse); + const [response] = await client.setAddonsConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setAddonsConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setAddonsConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setAddonsConfig without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetAddonsConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setAddonsConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setAddonsConfig( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setAddonsConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setAddonsConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setAddonsConfig with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetAddonsConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setAddonsConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setAddonsConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.setAddonsConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setAddonsConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setAddonsConfig with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetAddonsConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setAddonsConfig(request), expectedError); + }); + }); + + describe('setLocations', () => { + it('invokes setLocations without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLocationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setLocations = stubSimpleCall(expectedResponse); + const [response] = await client.setLocations(request); + assert(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLocations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLocations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLocations without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLocationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setLocations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLocations( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLocations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLocations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLocations with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLocationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setLocations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLocations(request), expectedError); + assert(stub.calledOnce); + const actualRequest = (client.innerApiCalls.setLocations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLocations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLocations with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLocationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setLocations(request), expectedError); + assert(stub.calledOnce); + }); + }); + + describe('updateMaster', () => { + it('invokes updateMaster without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.UpdateMasterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.updateMaster = stubSimpleCall(expectedResponse); + const [response] = await client.updateMaster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateMaster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMaster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMaster without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.UpdateMasterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.updateMaster = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateMaster( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateMaster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMaster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMaster with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.UpdateMasterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMaster = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateMaster(request), expectedError); + const actualRequest = (client.innerApiCalls.updateMaster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMaster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMaster with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.UpdateMasterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateMaster(request), expectedError); + }); + }); + + describe('setMasterAuth', () => { + it('invokes setMasterAuth without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetMasterAuthRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setMasterAuth = stubSimpleCall(expectedResponse); + const [response] = await client.setMasterAuth(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMasterAuth as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMasterAuth as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMasterAuth without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetMasterAuthRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setMasterAuth = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setMasterAuth( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMasterAuth as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMasterAuth as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMasterAuth with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetMasterAuthRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setMasterAuth = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setMasterAuth(request), expectedError); + const actualRequest = (client.innerApiCalls.setMasterAuth as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMasterAuth as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMasterAuth with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetMasterAuthRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setMasterAuth(request), expectedError); + }); + }); + + describe('deleteCluster', () => { + it('invokes deleteCluster without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.deleteCluster = stubSimpleCall(expectedResponse); + const [response] = await client.deleteCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.deleteCluster = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCluster( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCluster = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteCluster(request), expectedError); + }); + }); + + describe('listOperations', () => { + it('invokes listOperations without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.ListOperationsResponse() + ); + client.innerApiCalls.listOperations = stubSimpleCall(expectedResponse); + const [response] = await client.listOperations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOperations without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.ListOperationsResponse() + ); + client.innerApiCalls.listOperations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listOperations( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IListOperationsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOperations with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listOperations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listOperations(request), expectedError); + const actualRequest = (client.innerApiCalls.listOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOperations with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['zone']); + request.zone = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listOperations(request), expectedError); + }); + }); + + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.getOperation = stubSimpleCall(expectedResponse); + const [response] = await client.getOperation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOperation without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.getOperation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getOperation( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOperation with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getOperation(request), expectedError); + const actualRequest = (client.innerApiCalls.getOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOperation with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getOperation(request), expectedError); + }); + }); + + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CancelOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelOperation = stubSimpleCall(expectedResponse); + const [response] = await client.cancelOperation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelOperation without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CancelOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelOperation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelOperation( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelOperation with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CancelOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelOperation(request), expectedError); + const actualRequest = (client.innerApiCalls.cancelOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelOperation with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CancelOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelOperation(request), expectedError); + }); + }); + + describe('getServerConfig', () => { + it('invokes getServerConfig without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetServerConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.ServerConfig() + ); + client.innerApiCalls.getServerConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getServerConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getServerConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getServerConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getServerConfig without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetServerConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.ServerConfig() + ); + client.innerApiCalls.getServerConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getServerConfig( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IServerConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getServerConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getServerConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getServerConfig with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetServerConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getServerConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getServerConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.getServerConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getServerConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getServerConfig with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetServerConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['zone']); + request.zone = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getServerConfig(request), expectedError); + }); + }); + + describe('getJSONWebKeys', () => { + it('invokes getJSONWebKeys without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetJSONWebKeysRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetJSONWebKeysRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.GetJSONWebKeysResponse() + ); + client.innerApiCalls.getJsonWebKeys = stubSimpleCall(expectedResponse); + const [response] = await client.getJSONWebKeys(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJsonWebKeys as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJsonWebKeys as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJSONWebKeys without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetJSONWebKeysRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetJSONWebKeysRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.GetJSONWebKeysResponse() + ); + client.innerApiCalls.getJsonWebKeys = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getJSONWebKeys( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IGetJSONWebKeysResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJsonWebKeys as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJsonWebKeys as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJSONWebKeys with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetJSONWebKeysRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetJSONWebKeysRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getJsonWebKeys = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getJSONWebKeys(request), expectedError); + const actualRequest = (client.innerApiCalls.getJsonWebKeys as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJsonWebKeys as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJSONWebKeys with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetJSONWebKeysRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetJSONWebKeysRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getJSONWebKeys(request), expectedError); + }); + }); + + describe('listNodePools', () => { + it('invokes listNodePools without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListNodePoolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.ListNodePoolsResponse() + ); + client.innerApiCalls.listNodePools = stubSimpleCall(expectedResponse); + const [response] = await client.listNodePools(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listNodePools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listNodePools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNodePools without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListNodePoolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.ListNodePoolsResponse() + ); + client.innerApiCalls.listNodePools = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listNodePools( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IListNodePoolsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listNodePools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listNodePools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNodePools with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListNodePoolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listNodePools = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listNodePools(request), expectedError); + const actualRequest = (client.innerApiCalls.listNodePools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listNodePools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNodePools with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListNodePoolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listNodePools(request), expectedError); + }); + }); + + describe('getNodePool', () => { + it('invokes getNodePool without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.NodePool() + ); + client.innerApiCalls.getNodePool = stubSimpleCall(expectedResponse); + const [response] = await client.getNodePool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNodePool without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.NodePool() + ); + client.innerApiCalls.getNodePool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getNodePool( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.INodePool|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNodePool with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getNodePool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getNodePool(request), expectedError); + const actualRequest = (client.innerApiCalls.getNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNodePool with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getNodePool(request), expectedError); + }); + }); + + describe('createNodePool', () => { + it('invokes createNodePool without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CreateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.createNodePool = stubSimpleCall(expectedResponse); + const [response] = await client.createNodePool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNodePool without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CreateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.createNodePool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createNodePool( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNodePool with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CreateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createNodePool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createNodePool(request), expectedError); + const actualRequest = (client.innerApiCalls.createNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNodePool with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CreateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createNodePool(request), expectedError); + }); + }); + + describe('deleteNodePool', () => { + it('invokes deleteNodePool without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.DeleteNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.deleteNodePool = stubSimpleCall(expectedResponse); + const [response] = await client.deleteNodePool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNodePool without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.DeleteNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.deleteNodePool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteNodePool( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNodePool with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.DeleteNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteNodePool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteNodePool(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNodePool with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.DeleteNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteNodePool(request), expectedError); + }); + }); + + describe('completeNodePoolUpgrade', () => { + it('invokes completeNodePoolUpgrade without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CompleteNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CompleteNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.completeNodePoolUpgrade = stubSimpleCall(expectedResponse); + const [response] = await client.completeNodePoolUpgrade(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeNodePoolUpgrade without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CompleteNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CompleteNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.completeNodePoolUpgrade = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.completeNodePoolUpgrade( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeNodePoolUpgrade with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CompleteNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CompleteNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.completeNodePoolUpgrade = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.completeNodePoolUpgrade(request), expectedError); + const actualRequest = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeNodePoolUpgrade with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CompleteNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CompleteNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.completeNodePoolUpgrade(request), expectedError); + }); + }); + + describe('rollbackNodePoolUpgrade', () => { + it('invokes rollbackNodePoolUpgrade without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.RollbackNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCall(expectedResponse); + const [response] = await client.rollbackNodePoolUpgrade(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackNodePoolUpgrade without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.RollbackNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.rollbackNodePoolUpgrade( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackNodePoolUpgrade with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.RollbackNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.rollbackNodePoolUpgrade(request), expectedError); + const actualRequest = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackNodePoolUpgrade with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.RollbackNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.rollbackNodePoolUpgrade(request), expectedError); + }); + }); + + describe('setNodePoolManagement', () => { + it('invokes setNodePoolManagement without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNodePoolManagementRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setNodePoolManagement = stubSimpleCall(expectedResponse); + const [response] = await client.setNodePoolManagement(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNodePoolManagement as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolManagement as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolManagement without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNodePoolManagementRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setNodePoolManagement = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setNodePoolManagement( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNodePoolManagement as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolManagement as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolManagement with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNodePoolManagementRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setNodePoolManagement = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setNodePoolManagement(request), expectedError); + const actualRequest = (client.innerApiCalls.setNodePoolManagement as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolManagement as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolManagement with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNodePoolManagementRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setNodePoolManagement(request), expectedError); + }); + }); + + describe('setLabels', () => { + it('invokes setLabels without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLabelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); + const [response] = await client.setLabels(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLabels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLabels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLabels without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLabelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setLabels = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLabels( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLabels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLabels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLabels with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLabelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setLabels = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLabels(request), expectedError); + const actualRequest = (client.innerApiCalls.setLabels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLabels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLabels with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLabelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setLabels(request), expectedError); + }); + }); + + describe('setLegacyAbac', () => { + it('invokes setLegacyAbac without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLegacyAbacRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setLegacyAbac = stubSimpleCall(expectedResponse); + const [response] = await client.setLegacyAbac(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLegacyAbac as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLegacyAbac as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLegacyAbac without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLegacyAbacRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setLegacyAbac = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLegacyAbac( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLegacyAbac as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLegacyAbac as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLegacyAbac with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLegacyAbacRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setLegacyAbac = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLegacyAbac(request), expectedError); + const actualRequest = (client.innerApiCalls.setLegacyAbac as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLegacyAbac as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLegacyAbac with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLegacyAbacRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setLegacyAbac(request), expectedError); + }); + }); + + describe('startIPRotation', () => { + it('invokes startIPRotation without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.StartIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.startIpRotation = stubSimpleCall(expectedResponse); + const [response] = await client.startIPRotation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.startIpRotation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startIpRotation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startIPRotation without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.StartIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.startIpRotation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.startIPRotation( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.startIpRotation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startIpRotation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startIPRotation with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.StartIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startIpRotation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.startIPRotation(request), expectedError); + const actualRequest = (client.innerApiCalls.startIpRotation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startIpRotation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startIPRotation with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.StartIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.startIPRotation(request), expectedError); + }); + }); + + describe('completeIPRotation', () => { + it('invokes completeIPRotation without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CompleteIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.completeIpRotation = stubSimpleCall(expectedResponse); + const [response] = await client.completeIPRotation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.completeIpRotation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeIpRotation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeIPRotation without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CompleteIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.completeIpRotation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.completeIPRotation( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.completeIpRotation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeIpRotation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeIPRotation with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CompleteIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.completeIpRotation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.completeIPRotation(request), expectedError); + const actualRequest = (client.innerApiCalls.completeIpRotation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeIpRotation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeIPRotation with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CompleteIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.completeIPRotation(request), expectedError); + }); + }); + + describe('setNodePoolSize', () => { + it('invokes setNodePoolSize without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNodePoolSizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setNodePoolSize = stubSimpleCall(expectedResponse); + const [response] = await client.setNodePoolSize(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNodePoolSize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolSize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolSize without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNodePoolSizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setNodePoolSize = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setNodePoolSize( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNodePoolSize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolSize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolSize with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNodePoolSizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setNodePoolSize = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setNodePoolSize(request), expectedError); + const actualRequest = (client.innerApiCalls.setNodePoolSize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolSize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolSize with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNodePoolSizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setNodePoolSize(request), expectedError); + }); + }); + + describe('setNetworkPolicy', () => { + it('invokes setNetworkPolicy without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNetworkPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setNetworkPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setNetworkPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNetworkPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNetworkPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNetworkPolicy without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNetworkPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setNetworkPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setNetworkPolicy( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNetworkPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNetworkPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNetworkPolicy with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNetworkPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setNetworkPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setNetworkPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.setNetworkPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNetworkPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNetworkPolicy with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNetworkPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setNetworkPolicy(request), expectedError); + }); + }); + + describe('setMaintenancePolicy', () => { + it('invokes setMaintenancePolicy without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetMaintenancePolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setMaintenancePolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setMaintenancePolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMaintenancePolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMaintenancePolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMaintenancePolicy without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetMaintenancePolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setMaintenancePolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setMaintenancePolicy( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMaintenancePolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMaintenancePolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMaintenancePolicy with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetMaintenancePolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setMaintenancePolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setMaintenancePolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.setMaintenancePolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMaintenancePolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMaintenancePolicy with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetMaintenancePolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setMaintenancePolicy(request), expectedError); + }); + }); + + describe('checkAutopilotCompatibility', () => { + it('invokes checkAutopilotCompatibility without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CheckAutopilotCompatibilityRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CheckAutopilotCompatibilityRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.CheckAutopilotCompatibilityResponse() + ); + client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCall(expectedResponse); + const [response] = await client.checkAutopilotCompatibility(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAutopilotCompatibility without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CheckAutopilotCompatibilityRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CheckAutopilotCompatibilityRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.CheckAutopilotCompatibilityResponse() + ); + client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.checkAutopilotCompatibility( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAutopilotCompatibility with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CheckAutopilotCompatibilityRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CheckAutopilotCompatibilityRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkAutopilotCompatibility(request), expectedError); + const actualRequest = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAutopilotCompatibility with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CheckAutopilotCompatibilityRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CheckAutopilotCompatibilityRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.checkAutopilotCompatibility(request), expectedError); + }); + }); + + describe('listLocations', () => { + it('invokes listLocations without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListLocationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListLocationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.ListLocationsResponse() + ); + client.innerApiCalls.listLocations = stubSimpleCall(expectedResponse); + const [response] = await client.listLocations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listLocations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listLocations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLocations without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListLocationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListLocationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.ListLocationsResponse() + ); + client.innerApiCalls.listLocations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listLocations( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IListLocationsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listLocations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listLocations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLocations with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListLocationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListLocationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listLocations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listLocations(request), expectedError); + const actualRequest = (client.innerApiCalls.listLocations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listLocations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLocations with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListLocationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListLocationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listLocations(request), expectedError); + }); + }); + + describe('listUsableSubnetworks', () => { + it('invokes listUsableSubnetworks without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), + ]; + client.innerApiCalls.listUsableSubnetworks = stubSimpleCall(expectedResponse); + const [response] = await client.listUsableSubnetworks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUsableSubnetworks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUsableSubnetworks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsableSubnetworks without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), + ]; + client.innerApiCalls.listUsableSubnetworks = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listUsableSubnetworks( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IUsableSubnetwork[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUsableSubnetworks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUsableSubnetworks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsableSubnetworks with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listUsableSubnetworks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listUsableSubnetworks(request), expectedError); + const actualRequest = (client.innerApiCalls.listUsableSubnetworks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUsableSubnetworks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsableSubnetworksStream without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), + ]; + client.descriptors.page.listUsableSubnetworks.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listUsableSubnetworksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.container.v1beta1.UsableSubnetwork[] = []; + stream.on('data', (response: protos.google.container.v1beta1.UsableSubnetwork) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUsableSubnetworks, request)); + assert( + (client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listUsableSubnetworksStream with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listUsableSubnetworks.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listUsableSubnetworksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.container.v1beta1.UsableSubnetwork[] = []; + stream.on('data', (response: protos.google.container.v1beta1.UsableSubnetwork) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUsableSubnetworks, request)); + assert( + (client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUsableSubnetworks without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), + ]; + client.descriptors.page.listUsableSubnetworks.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.container.v1beta1.IUsableSubnetwork[] = []; + const iterable = client.listUsableSubnetworksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUsableSubnetworks with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listUsableSubnetworks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listUsableSubnetworksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.container.v1beta1.IUsableSubnetwork[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); +}); diff --git a/owl-bot-staging/google-container/v1beta1/tsconfig.json b/owl-bot-staging/google-container/v1beta1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/google-container/v1beta1/webpack.config.js b/owl-bot-staging/google-container/v1beta1/webpack.config.js new file mode 100644 index 00000000000..9032271af9d --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 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. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'ClusterManager', + filename: './cluster-manager.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; From e556eac23177ed60710133177780e3f782a6cf62 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 12 Jul 2023 19:49:15 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../google-container/v1/.eslintignore | 7 - .../google-container/v1/.eslintrc.json | 3 - .../google-container/v1/.gitignore | 14 - owl-bot-staging/google-container/v1/.jsdoc.js | 55 - .../google-container/v1/.mocharc.js | 33 - .../google-container/v1/.prettierrc.js | 22 - owl-bot-staging/google-container/v1/README.md | 1 - .../v1/linkinator.config.json | 16 - .../google-container/v1/package.json | 64 - .../google/container/v1/cluster_service.proto | 5087 --------------- .../v1/cluster_manager.cancel_operation.js | 61 - ...r_manager.check_autopilot_compatibility.js | 61 - .../cluster_manager.complete_i_p_rotation.js | 61 - ...ster_manager.complete_node_pool_upgrade.js | 62 - .../v1/cluster_manager.create_cluster.js | 67 - .../v1/cluster_manager.create_node_pool.js | 67 - .../v1/cluster_manager.delete_cluster.js | 61 - .../v1/cluster_manager.delete_node_pool.js | 62 - .../v1/cluster_manager.get_cluster.js | 61 - .../cluster_manager.get_j_s_o_n_web_keys.js | 61 - .../v1/cluster_manager.get_node_pool.js | 62 - .../v1/cluster_manager.get_operation.js | 61 - .../v1/cluster_manager.get_server_config.js | 61 - .../v1/cluster_manager.list_clusters.js | 62 - .../v1/cluster_manager.list_node_pools.js | 61 - .../v1/cluster_manager.list_operations.js | 62 - ...cluster_manager.list_usable_subnetworks.js | 82 - ...ster_manager.rollback_node_pool_upgrade.js | 67 - .../v1/cluster_manager.set_addons_config.js | 67 - .../v1/cluster_manager.set_labels.js | 76 - .../v1/cluster_manager.set_legacy_abac.js | 66 - .../v1/cluster_manager.set_locations.js | 71 - .../v1/cluster_manager.set_logging_service.js | 74 - .../cluster_manager.set_maintenance_policy.js | 86 - .../v1/cluster_manager.set_master_auth.js | 71 - .../cluster_manager.set_monitoring_service.js | 74 - .../v1/cluster_manager.set_network_policy.js | 66 - ...uster_manager.set_node_pool_autoscaling.js | 67 - ...luster_manager.set_node_pool_management.js | 67 - .../v1/cluster_manager.set_node_pool_size.js | 67 - .../v1/cluster_manager.start_i_p_rotation.js | 65 - .../v1/cluster_manager.update_cluster.js | 66 - .../v1/cluster_manager.update_master.js | 73 - .../v1/cluster_manager.update_node_pool.js | 164 - .../snippet_metadata.google.container.v1.json | 1915 ------ .../google-container/v1/src/index.ts | 25 - .../v1/src/v1/cluster_manager_client.ts | 3551 ----------- .../src/v1/cluster_manager_client_config.json | 192 - .../v1/src/v1/cluster_manager_proto_list.json | 3 - .../v1/src/v1/gapic_metadata.json | 367 -- .../google-container/v1/src/v1/index.ts | 19 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - .../v1/system-test/install.ts | 49 - .../v1/test/gapic_cluster_manager_v1.ts | 5130 --------------- .../google-container/v1/tsconfig.json | 19 - .../google-container/v1/webpack.config.js | 64 - .../google-container/v1beta1/.eslintignore | 7 - .../google-container/v1beta1/.eslintrc.json | 3 - .../google-container/v1beta1/.gitignore | 14 - .../google-container/v1beta1/.jsdoc.js | 55 - .../google-container/v1beta1/.mocharc.js | 33 - .../google-container/v1beta1/.prettierrc.js | 22 - .../google-container/v1beta1/README.md | 1 - .../v1beta1/linkinator.config.json | 16 - .../google-container/v1beta1/package.json | 64 - .../container/v1beta1/cluster_service.proto | 5617 ----------------- .../cluster_manager.cancel_operation.js | 64 - ...r_manager.check_autopilot_compatibility.js | 61 - .../cluster_manager.complete_i_p_rotation.js | 64 - ...ster_manager.complete_node_pool_upgrade.js | 62 - .../v1beta1/cluster_manager.create_cluster.js | 69 - .../cluster_manager.create_node_pool.js | 70 - .../v1beta1/cluster_manager.delete_cluster.js | 64 - .../cluster_manager.delete_node_pool.js | 66 - .../v1beta1/cluster_manager.get_cluster.js | 64 - .../cluster_manager.get_j_s_o_n_web_keys.js | 61 - .../v1beta1/cluster_manager.get_node_pool.js | 66 - .../v1beta1/cluster_manager.get_operation.js | 64 - .../cluster_manager.get_server_config.js | 63 - .../v1beta1/cluster_manager.list_clusters.js | 64 - .../v1beta1/cluster_manager.list_locations.js | 62 - .../cluster_manager.list_node_pools.js | 64 - .../cluster_manager.list_operations.js | 64 - ...cluster_manager.list_usable_subnetworks.js | 83 - ...ster_manager.rollback_node_pool_upgrade.js | 71 - .../cluster_manager.set_addons_config.js | 70 - .../v1beta1/cluster_manager.set_labels.js | 79 - .../cluster_manager.set_legacy_abac.js | 69 - .../v1beta1/cluster_manager.set_locations.js | 74 - .../cluster_manager.set_logging_service.js | 77 - .../cluster_manager.set_maintenance_policy.js | 86 - .../cluster_manager.set_master_auth.js | 74 - .../cluster_manager.set_monitoring_service.js | 77 - .../cluster_manager.set_network_policy.js | 69 - ...uster_manager.set_node_pool_autoscaling.js | 71 - ...luster_manager.set_node_pool_management.js | 71 - .../cluster_manager.set_node_pool_size.js | 71 - .../cluster_manager.start_i_p_rotation.js | 68 - .../v1beta1/cluster_manager.update_cluster.js | 69 - .../v1beta1/cluster_manager.update_master.js | 76 - .../cluster_manager.update_node_pool.js | 168 - ...pet_metadata.google.container.v1beta1.json | 1955 ------ .../google-container/v1beta1/src/index.ts | 25 - .../src/v1beta1/cluster_manager_client.ts | 3623 ----------- .../cluster_manager_client_config.json | 198 - .../v1beta1/cluster_manager_proto_list.json | 3 - .../v1beta1/src/v1beta1/gapic_metadata.json | 377 -- .../v1beta1/src/v1beta1/index.ts | 19 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - .../v1beta1/system-test/install.ts | 49 - .../test/gapic_cluster_manager_v1beta1.ts | 5238 --------------- .../google-container/v1beta1/tsconfig.json | 19 - .../v1beta1/webpack.config.js | 64 - .../container/v1beta1/cluster_service.proto | 35 +- packages/google-container/protos/protos.d.ts | 120 + packages/google-container/protos/protos.js | 302 + packages/google-container/protos/protos.json | 26 + 119 files changed, 480 insertions(+), 39036 deletions(-) delete mode 100644 owl-bot-staging/google-container/v1/.eslintignore delete mode 100644 owl-bot-staging/google-container/v1/.eslintrc.json delete mode 100644 owl-bot-staging/google-container/v1/.gitignore delete mode 100644 owl-bot-staging/google-container/v1/.jsdoc.js delete mode 100644 owl-bot-staging/google-container/v1/.mocharc.js delete mode 100644 owl-bot-staging/google-container/v1/.prettierrc.js delete mode 100644 owl-bot-staging/google-container/v1/README.md delete mode 100644 owl-bot-staging/google-container/v1/linkinator.config.json delete mode 100644 owl-bot-staging/google-container/v1/package.json delete mode 100644 owl-bot-staging/google-container/v1/protos/google/container/v1/cluster_service.proto delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.cancel_operation.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_i_p_rotation.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_cluster.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_node_pool.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_cluster.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_node_pool.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_cluster.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_j_s_o_n_web_keys.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_node_pool.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_operation.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_server_config.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_clusters.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_node_pools.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_operations.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_usable_subnetworks.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.rollback_node_pool_upgrade.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_addons_config.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_labels.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_legacy_abac.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_locations.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_logging_service.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_maintenance_policy.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_master_auth.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_monitoring_service.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_network_policy.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_autoscaling.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_management.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_size.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.start_i_p_rotation.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_cluster.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_master.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_node_pool.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/snippet_metadata.google.container.v1.json delete mode 100644 owl-bot-staging/google-container/v1/src/index.ts delete mode 100644 owl-bot-staging/google-container/v1/src/v1/cluster_manager_client.ts delete mode 100644 owl-bot-staging/google-container/v1/src/v1/cluster_manager_client_config.json delete mode 100644 owl-bot-staging/google-container/v1/src/v1/cluster_manager_proto_list.json delete mode 100644 owl-bot-staging/google-container/v1/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-container/v1/src/v1/index.ts delete mode 100644 owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-container/v1/system-test/install.ts delete mode 100644 owl-bot-staging/google-container/v1/test/gapic_cluster_manager_v1.ts delete mode 100644 owl-bot-staging/google-container/v1/tsconfig.json delete mode 100644 owl-bot-staging/google-container/v1/webpack.config.js delete mode 100644 owl-bot-staging/google-container/v1beta1/.eslintignore delete mode 100644 owl-bot-staging/google-container/v1beta1/.eslintrc.json delete mode 100644 owl-bot-staging/google-container/v1beta1/.gitignore delete mode 100644 owl-bot-staging/google-container/v1beta1/.jsdoc.js delete mode 100644 owl-bot-staging/google-container/v1beta1/.mocharc.js delete mode 100644 owl-bot-staging/google-container/v1beta1/.prettierrc.js delete mode 100644 owl-bot-staging/google-container/v1beta1/README.md delete mode 100644 owl-bot-staging/google-container/v1beta1/linkinator.config.json delete mode 100644 owl-bot-staging/google-container/v1beta1/package.json delete mode 100644 owl-bot-staging/google-container/v1beta1/protos/google/container/v1beta1/cluster_service.proto delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.cancel_operation.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_i_p_rotation.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_node_pool_upgrade.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_cluster.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_node_pool.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_cluster.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_node_pool.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_cluster.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_j_s_o_n_web_keys.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_node_pool.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_operation.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_server_config.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_clusters.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_locations.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_node_pools.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_operations.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_usable_subnetworks.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.rollback_node_pool_upgrade.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_addons_config.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_labels.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_legacy_abac.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_locations.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_logging_service.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_maintenance_policy.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_master_auth.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_monitoring_service.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_network_policy.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_autoscaling.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_management.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_size.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.start_i_p_rotation.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_cluster.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_master.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_node_pool.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json delete mode 100644 owl-bot-staging/google-container/v1beta1/src/index.ts delete mode 100644 owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client.ts delete mode 100644 owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client_config.json delete mode 100644 owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_proto_list.json delete mode 100644 owl-bot-staging/google-container/v1beta1/src/v1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-container/v1beta1/src/v1beta1/index.ts delete mode 100644 owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-container/v1beta1/system-test/install.ts delete mode 100644 owl-bot-staging/google-container/v1beta1/test/gapic_cluster_manager_v1beta1.ts delete mode 100644 owl-bot-staging/google-container/v1beta1/tsconfig.json delete mode 100644 owl-bot-staging/google-container/v1beta1/webpack.config.js diff --git a/owl-bot-staging/google-container/v1/.eslintignore b/owl-bot-staging/google-container/v1/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-container/v1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-container/v1/.eslintrc.json b/owl-bot-staging/google-container/v1/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-container/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-container/v1/.gitignore b/owl-bot-staging/google-container/v1/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-container/v1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -/.coverage -/coverage -/.nyc_output -/docs/ -/out/ -/build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/google-container/v1/.jsdoc.js b/owl-bot-staging/google-container/v1/.jsdoc.js deleted file mode 100644 index 6dc18e81193..00000000000 --- a/owl-bot-staging/google-container/v1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2023 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/container', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-container/v1/.mocharc.js b/owl-bot-staging/google-container/v1/.mocharc.js deleted file mode 100644 index 1a38f257db7..00000000000 --- a/owl-bot-staging/google-container/v1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/google-container/v1/.prettierrc.js b/owl-bot-staging/google-container/v1/.prettierrc.js deleted file mode 100644 index 55639e70f9e..00000000000 --- a/owl-bot-staging/google-container/v1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-container/v1/README.md b/owl-bot-staging/google-container/v1/README.md deleted file mode 100644 index f32441d7e6b..00000000000 --- a/owl-bot-staging/google-container/v1/README.md +++ /dev/null @@ -1 +0,0 @@ -Container: Nodejs Client diff --git a/owl-bot-staging/google-container/v1/linkinator.config.json b/owl-bot-staging/google-container/v1/linkinator.config.json deleted file mode 100644 index befd23c8633..00000000000 --- a/owl-bot-staging/google-container/v1/linkinator.config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "recurse": true, - "skip": [ - "https://codecov.io/gh/googleapis/", - "www.googleapis.com", - "img.shields.io", - "https://console.cloud.google.com/cloudshell", - "https://support.google.com" - ], - "silent": true, - "concurrency": 5, - "retry": true, - "retryErrors": true, - "retryErrorsCount": 5, - "retryErrorsJitter": 3000 -} diff --git a/owl-bot-staging/google-container/v1/package.json b/owl-bot-staging/google-container/v1/package.json deleted file mode 100644 index 9795068794e..00000000000 --- a/owl-bot-staging/google-container/v1/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@google-cloud/container", - "version": "0.1.0", - "description": "Container client for Node.js", - "repository": "googleapis/nodejs-container", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google container", - "container", - "cluster manager" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "predocs-test": "npm run docs", - "docs-test": "linkinator docs", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^3.5.7" - }, - "devDependencies": { - "@types/mocha": "^10.0.1", - "@types/node": "^18.11.18", - "@types/sinon": "^10.0.13", - "c8": "^7.12.0", - "gts": "^3.1.1", - "jsdoc": "^4.0.0", - "jsdoc-fresh": "^2.0.1", - "jsdoc-region-tag": "^2.0.1", - "linkinator": "^4.1.2", - "mocha": "^10.2.0", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^15.0.1", - "ts-loader": "^8.4.0", - "typescript": "^4.8.4", - "webpack": "^4.46.0", - "webpack-cli": "^4.10.0" - }, - "engines": { - "node": ">=v12" - } -} diff --git a/owl-bot-staging/google-container/v1/protos/google/container/v1/cluster_service.proto b/owl-bot-staging/google-container/v1/protos/google/container/v1/cluster_service.proto deleted file mode 100644 index 8fa1e9d0069..00000000000 --- a/owl-bot-staging/google-container/v1/protos/google/container/v1/cluster_service.proto +++ /dev/null @@ -1,5087 +0,0 @@ -// Copyright 2023 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. - -syntax = "proto3"; - -package google.container.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; -import "google/rpc/code.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.Container.V1"; -option go_package = "cloud.google.com/go/container/apiv1/containerpb;containerpb"; -option java_multiple_files = true; -option java_outer_classname = "ClusterServiceProto"; -option java_package = "com.google.container.v1"; -option php_namespace = "Google\\Cloud\\Container\\V1"; -option ruby_package = "Google::Cloud::Container::V1"; -option (google.api.resource_definition) = { - type: "pubsub.googleapis.com/Topic" - pattern: "projects/{project}/topics/{topic}" -}; - -// Google Kubernetes Engine Cluster Manager v1 -service ClusterManager { - option (google.api.default_host) = "container.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Lists all clusters owned by a project in either the specified zone or all - // zones. - rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/clusters" - additional_bindings { - get: "/v1/projects/{project_id}/zones/{zone}/clusters" - } - }; - option (google.api.method_signature) = "project_id,zone"; - option (google.api.method_signature) = "parent"; - } - - // Gets the details of a specific cluster. - rpc GetCluster(GetClusterRequest) returns (Cluster) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/clusters/*}" - additional_bindings { - get: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - option (google.api.method_signature) = "name"; - } - - // 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](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). - // - // 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. - rpc CreateCluster(CreateClusterRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/clusters" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster"; - option (google.api.method_signature) = "parent,cluster"; - } - - // Updates the settings of a specific cluster. - rpc UpdateCluster(UpdateClusterRequest) returns (Operation) { - option (google.api.http) = { - put: "/v1/{name=projects/*/locations/*/clusters/*}" - body: "*" - additional_bindings { - put: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id,update"; - option (google.api.method_signature) = "name,update"; - } - - // Updates the version and/or image type for the specified node pool. - rpc UpdateNodePool(UpdateNodePoolRequest) returns (Operation) { - option (google.api.http) = { - put: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/update" - body: "*" - } - }; - } - - // Sets the autoscaling settings for the specified node pool. - rpc SetNodePoolAutoscaling(SetNodePoolAutoscalingRequest) - returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setAutoscaling" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/autoscaling" - body: "*" - } - }; - } - - // Sets the logging service for a specific cluster. - rpc SetLoggingService(SetLoggingServiceRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setLogging" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/logging" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,logging_service"; - option (google.api.method_signature) = "name,logging_service"; - } - - // Sets the monitoring service for a specific cluster. - rpc SetMonitoringService(SetMonitoringServiceRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setMonitoring" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/monitoring" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,monitoring_service"; - option (google.api.method_signature) = "name,monitoring_service"; - } - - // Sets the addons for a specific cluster. - rpc SetAddonsConfig(SetAddonsConfigRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setAddons" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/addons" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,addons_config"; - option (google.api.method_signature) = "name,addons_config"; - } - - // Sets the locations for a specific cluster. - // Deprecated. Use - // [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update) - // instead. - rpc SetLocations(SetLocationsRequest) returns (Operation) { - option deprecated = true; - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setLocations" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/locations" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,locations"; - option (google.api.method_signature) = "name,locations"; - } - - // Updates the master for a specific cluster. - rpc UpdateMaster(UpdateMasterRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:updateMaster" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/master" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,master_version"; - option (google.api.method_signature) = "name,master_version"; - } - - // Sets master auth materials. Currently supports changing the admin password - // or a specific cluster, either via password generation or explicitly setting - // the password. - rpc SetMasterAuth(SetMasterAuthRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setMasterAuth" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setMasterAuth" - body: "*" - } - }; - } - - // 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. - rpc DeleteCluster(DeleteClusterRequest) returns (Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/clusters/*}" - additional_bindings { - delete: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - option (google.api.method_signature) = "name"; - } - - // Lists all operations in a project in a specific zone or all zones. - rpc ListOperations(ListOperationsRequest) returns (ListOperationsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/operations" - additional_bindings { - get: "/v1/projects/{project_id}/zones/{zone}/operations" - } - }; - option (google.api.method_signature) = "project_id,zone"; - } - - // Gets the specified operation. - rpc GetOperation(GetOperationRequest) returns (Operation) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/operations/*}" - additional_bindings { - get: "/v1/projects/{project_id}/zones/{zone}/operations/{operation_id}" - } - }; - option (google.api.method_signature) = "project_id,zone,operation_id"; - option (google.api.method_signature) = "name"; - } - - // Cancels the specified operation. - rpc CancelOperation(CancelOperationRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/operations/*}:cancel" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/operations/{operation_id}:cancel" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,operation_id"; - option (google.api.method_signature) = "name"; - } - - // Returns configuration info about the Google Kubernetes Engine service. - rpc GetServerConfig(GetServerConfigRequest) returns (ServerConfig) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*}/serverConfig" - additional_bindings { - get: "/v1/projects/{project_id}/zones/{zone}/serverconfig" - } - }; - option (google.api.method_signature) = "project_id,zone"; - option (google.api.method_signature) = "name"; - } - - // Gets the public component of the cluster signing keys in - // JSON Web Key format. - // This API is not yet intended for general use, and is not available for all - // clusters. - rpc GetJSONWebKeys(GetJSONWebKeysRequest) returns (GetJSONWebKeysResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/clusters/*}/jwks" - }; - } - - // Lists the node pools for a cluster. - rpc ListNodePools(ListNodePoolsRequest) returns (ListNodePoolsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/clusters/*}/nodePools" - additional_bindings { - get: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - option (google.api.method_signature) = "parent"; - } - - // Retrieves the requested node pool. - rpc GetNodePool(GetNodePoolRequest) returns (NodePool) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}" - additional_bindings { - get: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,node_pool_id"; - option (google.api.method_signature) = "name"; - } - - // Creates a node pool for a cluster. - rpc CreateNodePool(CreateNodePoolRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/clusters/*}/nodePools" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,node_pool"; - option (google.api.method_signature) = "parent,node_pool"; - } - - // Deletes a node pool from a cluster. - rpc DeleteNodePool(DeleteNodePoolRequest) returns (Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}" - additional_bindings { - delete: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,node_pool_id"; - option (google.api.method_signature) = "name"; - } - - // CompleteNodePoolUpgrade will signal an on-going node pool upgrade to - // complete. - rpc CompleteNodePoolUpgrade(CompleteNodePoolUpgradeRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}:completeUpgrade" - body: "*" - }; - } - - // Rolls back a previously Aborted or Failed NodePool upgrade. - // This makes no changes if the last upgrade successfully completed. - rpc RollbackNodePoolUpgrade(RollbackNodePoolUpgradeRequest) - returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}:rollback" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}:rollback" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,node_pool_id"; - option (google.api.method_signature) = "name"; - } - - // Sets the NodeManagement options for a node pool. - rpc SetNodePoolManagement(SetNodePoolManagementRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setManagement" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/setManagement" - body: "*" - } - }; - } - - // Sets labels on a cluster. - rpc SetLabels(SetLabelsRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setResourceLabels" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/resourceLabels" - body: "*" - } - }; - } - - // Enables or disables the ABAC authorization mechanism on a cluster. - rpc SetLegacyAbac(SetLegacyAbacRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setLegacyAbac" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/legacyAbac" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id,enabled"; - option (google.api.method_signature) = "name,enabled"; - } - - // Starts master IP rotation. - rpc StartIPRotation(StartIPRotationRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:startIpRotation" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:startIpRotation" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - option (google.api.method_signature) = "name"; - } - - // Completes master IP rotation. - rpc CompleteIPRotation(CompleteIPRotationRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:completeIpRotation" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:completeIpRotation" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - option (google.api.method_signature) = "name"; - } - - // Sets the size for a specific node pool. The new size will be used for all - // replicas, including future replicas created by modifying - // [NodePool.locations][google.container.v1.NodePool.locations]. - rpc SetNodePoolSize(SetNodePoolSizeRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setSize" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/setSize" - body: "*" - } - }; - } - - // Enables or disables Network Policy for a cluster. - rpc SetNetworkPolicy(SetNetworkPolicyRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setNetworkPolicy" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setNetworkPolicy" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,network_policy"; - option (google.api.method_signature) = "name,network_policy"; - } - - // Sets the maintenance policy for a cluster. - rpc SetMaintenancePolicy(SetMaintenancePolicyRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setMaintenancePolicy" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setMaintenancePolicy" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,maintenance_policy"; - option (google.api.method_signature) = "name,maintenance_policy"; - } - - // Lists subnetworks that are usable for creating clusters in a project. - rpc ListUsableSubnetworks(ListUsableSubnetworksRequest) - returns (ListUsableSubnetworksResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*}/aggregated/usableSubnetworks" - }; - } - - // Checks the cluster compatibility with Autopilot mode, and returns a list of - // compatibility issues. - rpc CheckAutopilotCompatibility(CheckAutopilotCompatibilityRequest) - returns (CheckAutopilotCompatibilityResponse) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/clusters/*}:checkAutopilotCompatibility" - }; - } -} - -// Parameters that can be configured on Linux nodes. -message LinuxNodeConfig { - // Possible cgroup modes that can be used. - enum CgroupMode { - // CGROUP_MODE_UNSPECIFIED is when unspecified cgroup configuration is used. - // The default for the GKE node OS image will be used. - CGROUP_MODE_UNSPECIFIED = 0; - - // CGROUP_MODE_V1 specifies to use cgroupv1 for the cgroup configuration on - // the node image. - CGROUP_MODE_V1 = 1; - - // CGROUP_MODE_V2 specifies to use cgroupv2 for the cgroup configuration on - // the node image. - CGROUP_MODE_V2 = 2; - } - - // The Linux kernel parameters to be applied to the nodes and all pods running - // on the nodes. - // - // The following parameters are supported. - // - // net.core.busy_poll - // net.core.busy_read - // net.core.netdev_max_backlog - // net.core.rmem_max - // net.core.wmem_default - // net.core.wmem_max - // net.core.optmem_max - // net.core.somaxconn - // net.ipv4.tcp_rmem - // net.ipv4.tcp_wmem - // net.ipv4.tcp_tw_reuse - map sysctls = 1; - - // cgroup_mode specifies the cgroup mode to be used on the node. - CgroupMode cgroup_mode = 2; -} - -// Parameters that can be configured on Windows nodes. -// Windows Node Config that define the parameters that will be used to -// configure the Windows node pool settings -message WindowsNodeConfig { - // Possible OS version that can be used. - enum OSVersion { - // When OSVersion is not specified - OS_VERSION_UNSPECIFIED = 0; - - // LTSC2019 specifies to use LTSC2019 as the Windows Servercore Base Image - OS_VERSION_LTSC2019 = 1; - - // LTSC2022 specifies to use LTSC2022 as the Windows Servercore Base Image - OS_VERSION_LTSC2022 = 2; - } - - // OSVersion specifies the Windows node config to be used on the node - OSVersion os_version = 1; -} - -// Node kubelet configs. -message NodeKubeletConfig { - // Control the CPU management policy on the node. - // See - // https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/ - // - // The following values are allowed. - // * "none": the default, which represents the existing scheduling behavior. - // * "static": allows pods with certain resource characteristics to be granted - // increased CPU affinity and exclusivity on the node. - // The default value is 'none' if unspecified. - string cpu_manager_policy = 1; - - // Enable CPU CFS quota enforcement for containers that specify CPU limits. - // - // This option is enabled by default which makes kubelet use CFS quota - // (https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt) to - // enforce container CPU limits. Otherwise, CPU limits will not be enforced at - // all. - // - // Disable this option to mitigate CPU throttling problems while still having - // your pods to be in Guaranteed QoS class by specifying the CPU limits. - // - // The default value is 'true' if unspecified. - google.protobuf.BoolValue cpu_cfs_quota = 2; - - // Set the CPU CFS quota period value 'cpu.cfs_period_us'. - // - // The string must be a sequence of decimal numbers, each with optional - // fraction and a unit suffix, such as "300ms". - // Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". - // The value must be a positive duration. - string cpu_cfs_quota_period = 3; - - // Set the Pod PID limits. See - // https://kubernetes.io/docs/concepts/policy/pid-limiting/#pod-pid-limits - // - // Controls the maximum number of processes allowed to run in a pod. The value - // must be greater than or equal to 1024 and less than 4194304. - int64 pod_pids_limit = 4; -} - -// Parameters that describe the nodes in a cluster. -// -// GKE Autopilot clusters do not -// recognize parameters in `NodeConfig`. Use -// [AutoprovisioningNodePoolDefaults][google.container.v1.AutoprovisioningNodePoolDefaults] -// instead. -message NodeConfig { - // The name of a Google Compute Engine [machine - // type](https://cloud.google.com/compute/docs/machine-types) - // - // If unspecified, the default machine type is `e2-medium`. - string machine_type = 1; - - // 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. - int32 disk_size_gb = 2; - - // 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](https://cloud.google.com/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. - repeated string oauth_scopes = 3; - - // The Google Cloud Platform Service Account to be used by the node VMs. - // Specify the email address of the Service Account; otherwise, if no Service - // Account is specified, the "default" service account is used. - string service_account = 9; - - // 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-ensure-gke-docker" - // - "gci-metrics-enabled" - // - "gci-update-strategy" - // - "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" - // - // 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. - map metadata = 4; - - // The image type to use for this node. Note that for a given image type, - // the latest version of it will be used. Please see - // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for - // available image types. - string image_type = 5; - - // 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/ - map labels = 6; - - // 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. - int32 local_ssd_count = 7; - - // 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. - repeated string tags = 8; - - // 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. - bool preemptible = 10; - - // 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. - repeated AcceleratorConfig accelerators = 11; - - // Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or - // 'pd-balanced') - // - // If unspecified, the default disk type is 'pd-standard' - string disk_type = 12; - - // 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](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform) - string min_cpu_platform = 13; - - // The workload metadata configuration for this node. - WorkloadMetadataConfig workload_metadata_config = 14; - - // 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/ - repeated NodeTaint taints = 15; - - // Sandbox configuration for this node. - SandboxConfig sandbox_config = 17; - - // Setting this field will assign instances of this - // pool to run on the specified node group. This is useful for running - // workloads on [sole tenant - // nodes](https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes). - string node_group = 18; - - // The optional reservation affinity. Setting this field will apply - // the specified [Zonal Compute - // Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources) - // to this node pool. - ReservationAffinity reservation_affinity = 19; - - // Shielded Instance options. - ShieldedInstanceConfig shielded_instance_config = 20; - - // Parameters that can be configured on Linux nodes. - LinuxNodeConfig linux_node_config = 21; - - // Node kubelet configs. - NodeKubeletConfig kubelet_config = 22; - - // - // The Customer Managed Encryption Key used to encrypt the boot disk attached - // to each node in the node pool. This should be of the form - // projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. - // For more information about protecting resources with Cloud KMS Keys please - // see: - // https://cloud.google.com/compute/docs/disks/customer-managed-encryption - string boot_disk_kms_key = 23; - - // Google Container File System (image streaming) configs. - GcfsConfig gcfs_config = 25; - - // Advanced features for the Compute Engine VM. - AdvancedMachineFeatures advanced_machine_features = 26; - - // Enable or disable gvnic in the node pool. - VirtualNIC gvnic = 29; - - // Spot flag for enabling Spot VM, which is a rebrand of - // the existing preemptible flag. - bool spot = 32; - - // Confidential nodes config. - // All the nodes in the node pool will be Confidential VM once enabled. - ConfidentialNodes confidential_nodes = 35; - - // Enable or disable NCCL fast socket for the node pool. - optional FastSocket fast_socket = 36; - - // The resource labels for the node pool to use to annotate any related - // Google Compute Engine resources. - map resource_labels = 37; - - // Logging configuration. - NodePoolLoggingConfig logging_config = 38; - - // Parameters that can be configured on Windows nodes. - WindowsNodeConfig windows_node_config = 39; - - // Parameters for using raw-block Local NVMe SSDs. - LocalNvmeSsdBlockConfig local_nvme_ssd_block_config = 40; - - // Parameters for the node ephemeral storage using Local SSDs. - // If unspecified, ephemeral storage is backed by the boot disk. - EphemeralStorageLocalSsdConfig ephemeral_storage_local_ssd_config = 41; - - // Parameters for node pools to be backed by shared sole tenant node groups. - SoleTenantConfig sole_tenant_config = 42; -} - -// Specifies options for controlling advanced machine features. -message AdvancedMachineFeatures { - // The number of threads per physical core. To disable simultaneous - // multithreading (SMT) set this to 1. If unset, the maximum number of threads - // supported per core by the underlying processor is assumed. - optional int64 threads_per_core = 1; -} - -// Parameters for node pool-level network config. -message NodeNetworkConfig { - // Configuration of all network bandwidth tiers - message NetworkPerformanceConfig { - // Node network tier - enum Tier { - // Default value - TIER_UNSPECIFIED = 0; - - // Higher bandwidth, actual values based on VM size. - TIER_1 = 1; - } - - // Specifies the total network bandwidth tier for the NodePool. - optional Tier total_egress_bandwidth_tier = 1; - } - - // Input only. Whether to create a new range for pod IPs in this node pool. - // Defaults are provided for `pod_range` and `pod_ipv4_cidr_block` if they - // are not specified. - // - // If neither `create_pod_range` or `pod_range` are specified, the - // cluster-level default (`ip_allocation_policy.cluster_ipv4_cidr_block`) is - // used. - // - // Only applicable if `ip_allocation_policy.use_ip_aliases` is true. - // - // This field cannot be changed after the node pool has been created. - bool create_pod_range = 4 [(google.api.field_behavior) = INPUT_ONLY]; - - // The ID of the secondary range for pod IPs. - // If `create_pod_range` is true, this ID is used for the new range. - // If `create_pod_range` is false, uses an existing secondary range with this - // ID. - // - // Only applicable if `ip_allocation_policy.use_ip_aliases` is true. - // - // This field cannot be changed after the node pool has been created. - string pod_range = 5; - - // The IP address range for pod IPs in this node pool. - // - // Only applicable if `create_pod_range` 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](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `10.96.0.0/14`) to pick a specific range to use. - // - // Only applicable if `ip_allocation_policy.use_ip_aliases` is true. - // - // This field cannot be changed after the node pool has been created. - string pod_ipv4_cidr_block = 6; - - // Whether nodes have internal IP addresses only. - // If enable_private_nodes is not specified, then the value is derived from - // [cluster.privateClusterConfig.enablePrivateNodes][google.container.v1beta1.PrivateClusterConfig.enablePrivateNodes] - optional bool enable_private_nodes = 9; - - // Network bandwidth tier configuration. - optional NetworkPerformanceConfig network_performance_config = 11; - - // [PRIVATE FIELD] - // Pod CIDR size overprovisioning config for the nodepool. - // - // Pod CIDR size per node depends on max_pods_per_node. By default, the value - // of max_pods_per_node is rounded off to next power of 2 and we then double - // that to get the size of pod CIDR block per node. - // Example: max_pods_per_node of 30 would result in 64 IPs (/26). - // - // This config can disable the doubling of IPs (we still round off to next - // power of 2) - // Example: max_pods_per_node of 30 will result in 32 IPs (/27) when - // overprovisioning is disabled. - PodCIDROverprovisionConfig pod_cidr_overprovision_config = 13; -} - -// A set of Shielded Instance options. -message ShieldedInstanceConfig { - // 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. - bool enable_secure_boot = 1; - - // 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. - bool enable_integrity_monitoring = 2; -} - -// SandboxConfig contains configurations of the sandbox to use for the node. -message SandboxConfig { - // Possible types of sandboxes. - enum Type { - // Default value. This should not be used. - UNSPECIFIED = 0; - - // Run sandbox using gvisor. - GVISOR = 1; - } - - // Type of the sandbox to use for the node. - Type type = 2; -} - -// GcfsConfig contains configurations of Google Container File System -// (image streaming). -message GcfsConfig { - // Whether to use GCFS. - bool enabled = 1; -} - -// [ReservationAffinity](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources) -// is the configuration of desired reservation which instances could take -// capacity from. -message ReservationAffinity { - // Indicates whether to consume capacity from a reservation or not. - enum Type { - // Default value. This should not be used. - UNSPECIFIED = 0; - - // Do not consume from any reserved capacity. - NO_RESERVATION = 1; - - // Consume any reservation available. - ANY_RESERVATION = 2; - - // Must consume from a specific reservation. Must specify key value fields - // for specifying the reservations. - SPECIFIC_RESERVATION = 3; - } - - // Corresponds to the type of reservation consumption. - Type consume_reservation_type = 1; - - // Corresponds to the label key of a reservation resource. To target a - // SPECIFIC_RESERVATION by name, specify - // "compute.googleapis.com/reservation-name" as the key and specify the name - // of your reservation as its value. - string key = 2; - - // Corresponds to the label value(s) of reservation resource(s). - repeated string values = 3; -} - -// SoleTenantConfig contains the NodeAffinities to specify what shared sole -// tenant node groups should back the node pool. -message SoleTenantConfig { - // Specifies the NodeAffinity key, values, and affinity operator according to - // [shared sole tenant node group - // affinities](https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes#node_affinity_and_anti-affinity). - message NodeAffinity { - // Operator allows user to specify affinity or anti-affinity for the - // given key values. - enum Operator { - // Invalid or unspecified affinity operator. - OPERATOR_UNSPECIFIED = 0; - - // Affinity operator. - IN = 1; - - // Anti-affinity operator. - NOT_IN = 2; - } - - // Key for NodeAffinity. - string key = 1; - - // Operator for NodeAffinity. - Operator operator = 2; - - // Values for NodeAffinity. - repeated string values = 3; - } - - // NodeAffinities used to match to a shared sole tenant node group. - repeated NodeAffinity node_affinities = 1; -} - -// Kubernetes taint is composed of three fields: key, value, and effect. Effect -// can only be one of three types: NoSchedule, PreferNoSchedule or NoExecute. -// -// See -// [here](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration) -// for more information, including usage and the valid values. -message NodeTaint { - // Possible values for Effect in taint. - enum Effect { - // Not set - EFFECT_UNSPECIFIED = 0; - - // NoSchedule - NO_SCHEDULE = 1; - - // PreferNoSchedule - PREFER_NO_SCHEDULE = 2; - - // NoExecute - NO_EXECUTE = 3; - } - - // Key for taint. - string key = 1; - - // Value for taint. - string value = 2; - - // Effect for taint. - Effect effect = 3; -} - -// Collection of Kubernetes [node -// taints](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration). -message NodeTaints { - // List of node taints. - repeated NodeTaint taints = 1; -} - -// Collection of node-level [Kubernetes -// labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels). -message NodeLabels { - // Map of node label keys and node label values. - map labels = 1; -} - -// Collection of [GCP -// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). -message ResourceLabels { - // Map of node label keys and node label values. - map labels = 1; -} - -// Collection of Compute Engine network tags that can be applied to a node's -// underlying VM instance. -message NetworkTags { - // List of network tags. - repeated string tags = 1; -} - -// The authentication information for accessing the master endpoint. -// Authentication can be done using HTTP basic auth or using client -// certificates. -message MasterAuth { - // 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). - // - // Warning: basic authentication is deprecated, and will be removed in GKE - // control plane versions 1.19 and newer. For a list of recommended - // authentication methods, see: - // https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication - string username = 1 [deprecated = true]; - - // 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. - // - // Warning: basic authentication is deprecated, and will be removed in GKE - // control plane versions 1.19 and newer. For a list of recommended - // authentication methods, see: - // https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication - string password = 2 [deprecated = true]; - - // Configuration for client certificate authentication on the cluster. For - // clusters before v1.12, if no configuration is specified, a client - // certificate is issued. - ClientCertificateConfig client_certificate_config = 3; - - // [Output only] Base64-encoded public certificate that is the root of - // trust for the cluster. - string cluster_ca_certificate = 100; - - // [Output only] Base64-encoded public certificate used by clients to - // authenticate to the cluster endpoint. - string client_certificate = 101; - - // [Output only] Base64-encoded private key used by clients to authenticate - // to the cluster endpoint. - string client_key = 102; -} - -// Configuration for client certificates on the cluster. -message ClientCertificateConfig { - // Issue a client certificate. - bool issue_client_certificate = 1; -} - -// Configuration for the addons that can be automatically spun up in the -// cluster, enabling additional functionality. -message AddonsConfig { - // Configuration for the HTTP (L7) load balancing controller addon, which - // makes it easy to set up HTTP load balancers for services in a cluster. - HttpLoadBalancing http_load_balancing = 1; - - // 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. - HorizontalPodAutoscaling horizontal_pod_autoscaling = 2; - - // 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 - KubernetesDashboard kubernetes_dashboard = 3 [deprecated = true]; - - // 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. - NetworkPolicyConfig network_policy_config = 4; - - // Configuration for the Cloud Run addon, which allows the user to use a - // managed Knative service. - CloudRunConfig cloud_run_config = 7; - - // Configuration for NodeLocalDNS, a dns cache running on cluster nodes - DnsCacheConfig dns_cache_config = 8; - - // Configuration for the ConfigConnector add-on, a Kubernetes - // extension to manage hosted GCP services through the Kubernetes API - ConfigConnectorConfig config_connector_config = 10; - - // Configuration for the Compute Engine Persistent Disk CSI driver. - GcePersistentDiskCsiDriverConfig gce_persistent_disk_csi_driver_config = 11; - - // Configuration for the GCP Filestore CSI driver. - GcpFilestoreCsiDriverConfig gcp_filestore_csi_driver_config = 14; - - // Configuration for the Backup for GKE agent addon. - GkeBackupAgentConfig gke_backup_agent_config = 16; -} - -// 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. -message HttpLoadBalancing { - // 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. - bool disabled = 1; -} - -// 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. -message HorizontalPodAutoscaling { - // Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. - // When enabled, it ensures that metrics are collected into Stackdriver - // Monitoring. - bool disabled = 1; -} - -// Configuration for the Kubernetes Dashboard. -message KubernetesDashboard { - // Whether the Kubernetes Dashboard is enabled for this cluster. - bool disabled = 1; -} - -// 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. -message NetworkPolicyConfig { - // Whether NetworkPolicy is enabled for this cluster. - bool disabled = 1; -} - -// Configuration for NodeLocal DNSCache -message DnsCacheConfig { - // Whether NodeLocal DNSCache is enabled for this cluster. - bool enabled = 1; -} - -// Configuration for controlling master global access settings. -message PrivateClusterMasterGlobalAccessConfig { - // Whenever master is accessible globally or not. - bool enabled = 1; -} - -// Configuration options for private clusters. -message PrivateClusterConfig { - // 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. - bool enable_private_nodes = 1; - - // Whether the master's internal IP address is used as the cluster endpoint. - bool enable_private_endpoint = 2; - - // 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. - string master_ipv4_cidr_block = 3; - - // Output only. The internal IP address of this cluster's master endpoint. - string private_endpoint = 4; - - // Output only. The external IP address of this cluster's master endpoint. - string public_endpoint = 5; - - // Output only. The peering name in the customer VPC used by this cluster. - string peering_name = 7; - - // Controls master global access settings. - PrivateClusterMasterGlobalAccessConfig master_global_access_config = 8; - - // Subnet to provision the master's private endpoint during cluster creation. - // Specified in projects/*/regions/*/subnetworks/* format. - string private_endpoint_subnetwork = 10; -} - -// Configuration for returning group information from authenticators. -message AuthenticatorGroupsConfig { - // Whether this cluster should return group membership lookups - // during authentication using a group of security groups. - bool enabled = 1; - - // The name of the security group-of-groups to be used. Only relevant - // if enabled = true. - string security_group = 2; -} - -// Configuration options for the Cloud Run feature. -message CloudRunConfig { - // Load balancer type of ingress service of Cloud Run. - enum LoadBalancerType { - // Load balancer type for Cloud Run is unspecified. - LOAD_BALANCER_TYPE_UNSPECIFIED = 0; - - // Install external load balancer for Cloud Run. - LOAD_BALANCER_TYPE_EXTERNAL = 1; - - // Install internal load balancer for Cloud Run. - LOAD_BALANCER_TYPE_INTERNAL = 2; - } - - // Whether Cloud Run addon is enabled for this cluster. - bool disabled = 1; - - // Which load balancer type is installed for Cloud Run. - LoadBalancerType load_balancer_type = 3; -} - -// Configuration options for the Config Connector add-on. -message ConfigConnectorConfig { - // Whether Cloud Connector is enabled for this cluster. - bool enabled = 1; -} - -// Configuration for the Compute Engine PD CSI driver. -message GcePersistentDiskCsiDriverConfig { - // Whether the Compute Engine PD CSI driver is enabled for this cluster. - bool enabled = 1; -} - -// Configuration for the GCP Filestore CSI driver. -message GcpFilestoreCsiDriverConfig { - // Whether the GCP Filestore CSI driver is enabled for this cluster. - bool enabled = 1; -} - -// Configuration for the Backup for GKE Agent. -message GkeBackupAgentConfig { - // Whether the Backup for GKE agent is enabled for this cluster. - bool enabled = 1; -} - -// 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. -message MasterAuthorizedNetworksConfig { - // CidrBlock contains an optional name and one CIDR block. - message CidrBlock { - // display_name is an optional field for users to identify CIDR blocks. - string display_name = 1; - - // cidr_block must be specified in CIDR notation. - string cidr_block = 2; - } - - // Whether or not master authorized networks is enabled. - bool enabled = 1; - - // cidr_blocks define up to 50 external networks that could access - // Kubernetes master through HTTPS. - repeated CidrBlock cidr_blocks = 2; - - // Whether master is accessbile via Google Compute Engine Public IP addresses. - optional bool gcp_public_cidrs_access_enabled = 3; -} - -// Configuration for the legacy Attribute Based Access Control authorization -// mode. -message LegacyAbac { - // 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. - bool enabled = 1; -} - -// Configuration options for the NetworkPolicy feature. -// https://kubernetes.io/docs/concepts/services-networking/networkpolicies/ -message NetworkPolicy { - // Allowed Network Policy providers. - enum Provider { - // Not set - PROVIDER_UNSPECIFIED = 0; - - // Tigera (Calico Felix). - CALICO = 1; - } - - // The selected network policy provider. - Provider provider = 1; - - // Whether network policy is enabled on the cluster. - bool enabled = 2; -} - -// Configuration for Binary Authorization. -message BinaryAuthorization { - // Binary Authorization mode of operation. - enum EvaluationMode { - // Default value - EVALUATION_MODE_UNSPECIFIED = 0; - - // Disable BinaryAuthorization - DISABLED = 1; - - // Enforce Kubernetes admission requests with BinaryAuthorization using the - // project's singleton policy. This is equivalent to setting the - // enabled boolean to true. - PROJECT_SINGLETON_POLICY_ENFORCE = 2; - } - - // This field is deprecated. Leave this unset and instead configure - // BinaryAuthorization using evaluation_mode. If evaluation_mode is set to - // anything other than EVALUATION_MODE_UNSPECIFIED, this field is ignored. - bool enabled = 1 [deprecated = true]; - - // Mode of operation for binauthz policy evaluation. If unspecified, defaults - // to DISABLED. - EvaluationMode evaluation_mode = 2; -} - -// [PRIVATE FIELD] -// Config for pod CIDR size overprovisioning. -message PodCIDROverprovisionConfig { - // Whether Pod CIDR overprovisioning is disabled. - // Note: Pod CIDR overprovisioning is enabled by default. - bool disable = 1; -} - -// Configuration for controlling how IPs are allocated in the cluster. -message IPAllocationPolicy { - // Whether alias IPs will be used for pod IPs in the cluster. - // This is used in conjunction with use_routes. It cannot - // be true if use_routes is true. If both use_ip_aliases and use_routes are - // false, then the server picks the default IP allocation mode - bool use_ip_aliases = 1; - - // Whether a new subnetwork will be created automatically for the cluster. - // - // This field is only applicable when `use_ip_aliases` is true. - bool create_subnetwork = 2; - - // 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. - string subnetwork_name = 3; - - // This field is deprecated, use cluster_ipv4_cidr_block. - string cluster_ipv4_cidr = 4 [deprecated = true]; - - // This field is deprecated, use node_ipv4_cidr_block. - string node_ipv4_cidr = 5 [deprecated = true]; - - // This field is deprecated, use services_ipv4_cidr_block. - string services_ipv4_cidr = 6 [deprecated = true]; - - // 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. - string cluster_secondary_range_name = 7; - - // 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. - string services_secondary_range_name = 8; - - // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // 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. - string cluster_ipv4_cidr_block = 9; - - // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // 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. - string node_ipv4_cidr_block = 10; - - // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // 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. - string services_ipv4_cidr_block = 11; - - // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // 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. - string tpu_ipv4_cidr_block = 13; - - // Whether routes will be used for pod IPs in the cluster. - // This is used in conjunction with use_ip_aliases. It cannot be true if - // use_ip_aliases is true. If both use_ip_aliases and use_routes are false, - // then the server picks the default IP allocation mode - bool use_routes = 15; - - // The IP stack type of the cluster - StackType stack_type = 16; - - // The ipv6 access type (internal or external) when create_subnetwork is true - IPv6AccessType ipv6_access_type = 17; - - // [PRIVATE FIELD] - // Pod CIDR size overprovisioning config for the cluster. - // - // Pod CIDR size per node depends on max_pods_per_node. By default, the value - // of max_pods_per_node is doubled and then rounded off to next power of 2 to - // get the size of pod CIDR block per node. - // Example: max_pods_per_node of 30 would result in 64 IPs (/26). - // - // This config can disable the doubling of IPs (we still round off to next - // power of 2) - // Example: max_pods_per_node of 30 will result in 32 IPs (/27) when - // overprovisioning is disabled. - PodCIDROverprovisionConfig pod_cidr_overprovision_config = 21; - - // Output only. [Output only] The subnet's IPv6 CIDR block used by nodes and - // pods. - string subnet_ipv6_cidr_block = 22 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. [Output only] The services IPv6 CIDR block for the cluster. - string services_ipv6_cidr_block = 23 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. [Output only] The additional pod ranges that are added to the - // cluster. These pod ranges can be used by new node pools to allocate pod IPs - // automatically. Once the range is removed it will not show up in - // IPAllocationPolicy. - AdditionalPodRangesConfig additional_pod_ranges_config = 24 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A Google Kubernetes Engine cluster. -message Cluster { - // The current status of the cluster. - enum Status { - // Not set. - STATUS_UNSPECIFIED = 0; - - // The PROVISIONING state indicates the cluster is being created. - PROVISIONING = 1; - - // The RUNNING state indicates the cluster has been created and is fully - // usable. - RUNNING = 2; - - // 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. - RECONCILING = 3; - - // The STOPPING state indicates the cluster is being deleted. - STOPPING = 4; - - // The ERROR state indicates the cluster is unusable. It will be - // automatically deleted. Details can be found in the `statusMessage` field. - ERROR = 5; - - // The DEGRADED state indicates the cluster requires user action to restore - // full functionality. Details can be found in the `statusMessage` field. - DEGRADED = 6; - } - - // 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. - string name = 1; - - // An optional description of this cluster. - string description = 2; - - // The number of nodes to create in this cluster. You must ensure that your - // 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 - // "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. - int32 initial_node_count = 3 [deprecated = true]; - - // 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. - NodeConfig node_config = 4 [deprecated = true]; - - // 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. - MasterAuth master_auth = 5; - - // The logging service the cluster should use to write logs. - // Currently available options: - // - // * `logging.googleapis.com/kubernetes` - The Cloud Logging - // service with a Kubernetes-native resource model - // * `logging.googleapis.com` - The legacy Cloud Logging service (no longer - // available as of GKE 1.15). - // * `none` - no logs will be exported from the cluster. - // - // If left as an empty string,`logging.googleapis.com/kubernetes` will be - // used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. - string logging_service = 6; - - // The monitoring service the cluster should use to write metrics. - // Currently available options: - // - // * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring - // service with a Kubernetes-native resource model - // * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no - // longer available as of GKE 1.15). - // * `none` - No metrics will be exported from the cluster. - // - // If left as an empty string,`monitoring.googleapis.com/kubernetes` will be - // used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. - string monitoring_service = 7; - - // The name of the Google Compute Engine - // [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) - // to which the cluster is connected. If left unspecified, the `default` - // network will be used. - string network = 8; - - // The IP address range of the container pods in this cluster, in - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // 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`. - string cluster_ipv4_cidr = 9; - - // Configurations for the various addons available to run in the cluster. - AddonsConfig addons_config = 10; - - // The name of the Google Compute Engine - // [subnetwork](https://cloud.google.com/compute/docs/subnetworks) to which - // the cluster is connected. - string subnetwork = 11; - - // The node pools associated with this cluster. - // This field should not be set if "node_config" or "initial_node_count" are - // specified. - repeated NodePool node_pools = 12; - - // The list of Google Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster's nodes should be located. - // - // This field provides a default value if - // [NodePool.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools#NodePool.FIELDS.locations) - // are not specified during node pool creation. - // - // Warning: changing cluster locations will update the - // [NodePool.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools#NodePool.FIELDS.locations) - // of all node pools and will result in nodes being added and/or removed. - repeated string locations = 13; - - // 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. - bool enable_kubernetes_alpha = 14; - - // The resource labels for the cluster to use to annotate any related - // Google Compute Engine resources. - map resource_labels = 15; - - // The fingerprint of the set of labels for this cluster. - string label_fingerprint = 16; - - // Configuration for the legacy ABAC authorization mode. - LegacyAbac legacy_abac = 18; - - // Configuration options for the NetworkPolicy feature. - NetworkPolicy network_policy = 19; - - // Configuration for cluster IP allocation. - IPAllocationPolicy ip_allocation_policy = 20; - - // The configuration options for master authorized networks feature. - MasterAuthorizedNetworksConfig master_authorized_networks_config = 22; - - // Configure the maintenance policy for this cluster. - MaintenancePolicy maintenance_policy = 23; - - // Configuration for Binary Authorization. - BinaryAuthorization binary_authorization = 24; - - // Cluster-level autoscaling configuration. - ClusterAutoscaling autoscaling = 26; - - // Configuration for cluster networking. - NetworkConfig network_config = 27; - - // 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. - MaxPodsConstraint default_max_pods_constraint = 30; - - // Configuration for exporting resource usages. Resource usage export is - // disabled when this config is unspecified. - ResourceUsageExportConfig resource_usage_export_config = 33; - - // Configuration controlling RBAC group membership information. - AuthenticatorGroupsConfig authenticator_groups_config = 34; - - // Configuration for private cluster. - PrivateClusterConfig private_cluster_config = 37; - - // Configuration of etcd encryption. - DatabaseEncryption database_encryption = 38; - - // Cluster-level Vertical Pod Autoscaling configuration. - VerticalPodAutoscaling vertical_pod_autoscaling = 39; - - // Shielded Nodes configuration. - ShieldedNodes shielded_nodes = 40; - - // Release channel configuration. If left unspecified on cluster creation and - // a version is specified, the cluster is enrolled in the most mature release - // channel where the version is available (first checking STABLE, then - // REGULAR, and finally RAPID). Otherwise, if no release channel - // configuration and no version is specified, the cluster is enrolled in the - // REGULAR channel with its default version. - ReleaseChannel release_channel = 41; - - // Configuration for the use of Kubernetes Service Accounts in GCP IAM - // policies. - WorkloadIdentityConfig workload_identity_config = 43; - - // Configuration for issuance of mTLS keys and certificates to Kubernetes - // pods. - MeshCertificates mesh_certificates = 67; - - // Configuration for the fine-grained cost management feature. - CostManagementConfig cost_management_config = 45; - - // Notification configuration of the cluster. - NotificationConfig notification_config = 49; - - // Configuration of Confidential Nodes. - // All the nodes in the cluster will be Confidential VM once enabled. - ConfidentialNodes confidential_nodes = 50; - - // Configuration for Identity Service component. - IdentityServiceConfig identity_service_config = 54; - - // [Output only] Server-defined URL for the resource. - string self_link = 100; - - // [Output only] The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field is deprecated, use location instead. - string zone = 101 [deprecated = true]; - - // [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. - string endpoint = 102; - - // 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 - string initial_cluster_version = 103; - - // [Output only] The current software version of the master endpoint. - string current_master_version = 104; - - // [Output only] Deprecated, use - // [NodePools.version](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools) - // 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. - string current_node_version = 105 [deprecated = true]; - - // [Output only] The time the cluster was created, in - // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string create_time = 106; - - // [Output only] The current status of this cluster. - Status status = 107; - - // [Output only] Deprecated. Use conditions instead. - // Additional information about the current status of this - // cluster, if available. - string status_message = 108 [deprecated = true]; - - // [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. - int32 node_ipv4_cidr_size = 109; - - // [Output only] The IP address range of the Kubernetes services in - // this cluster, in - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `1.2.3.4/29`). Service addresses are - // typically put in the last `/16` from the container CIDR. - string services_ipv4_cidr = 110; - - // Deprecated. Use node_pools.instance_group_urls. - repeated string instance_group_urls = 111 [deprecated = true]; - - // [Output only] The number of nodes currently in the cluster. Deprecated. - // Call Kubernetes API directly to retrieve node information. - int32 current_node_count = 112 [deprecated = true]; - - // [Output only] The time the cluster will be automatically - // deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string expire_time = 113; - - // [Output only] The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) - // or - // [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) - // in which the cluster resides. - string location = 114; - - // Enable the ability to use Cloud TPUs in this cluster. - bool enable_tpu = 115; - - // [Output only] The IP address range of the Cloud TPUs in this cluster, in - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `1.2.3.4/29`). - string tpu_ipv4_cidr_block = 116; - - // Which conditions caused the current cluster state. - repeated StatusCondition conditions = 118; - - // Autopilot configuration for the cluster. - Autopilot autopilot = 128; - - // Output only. Unique id for the cluster. - string id = 129 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Default NodePool settings for the entire cluster. These settings are - // overridden if specified on the specific NodePool object. - optional NodePoolDefaults node_pool_defaults = 131; - - // Logging configuration for the cluster. - LoggingConfig logging_config = 132; - - // Monitoring configuration for the cluster. - MonitoringConfig monitoring_config = 133; - - // Node pool configs that apply to all auto-provisioned node pools - // in autopilot clusters and node auto-provisioning enabled clusters. - NodePoolAutoConfig node_pool_auto_config = 136; - - // This checksum is computed by the server based on the value of cluster - // fields, and may be sent on update requests to ensure the client has an - // up-to-date value before proceeding. - string etag = 139; - - // Fleet information for the cluster. - Fleet fleet = 140; - - // Enable/Disable Security Posture API features for the cluster. - SecurityPostureConfig security_posture_config = 145; - - // Beta APIs Config - K8sBetaAPIConfig enable_k8s_beta_apis = 143; -} - -// K8sBetaAPIConfig , configuration for beta APIs -message K8sBetaAPIConfig { - // Enabled k8s beta APIs. - repeated string enabled_apis = 1; -} - -// SecurityPostureConfig defines the flags needed to enable/disable features for -// the Security Posture API. -message SecurityPostureConfig { - // Mode defines enablement mode for GKE Security posture features. - enum Mode { - // Default value not specified. - MODE_UNSPECIFIED = 0; - - // Disables Security Posture features on the cluster. - DISABLED = 1; - - // Applies Security Posture features on the cluster. - BASIC = 2; - } - - // VulnerabilityMode defines enablement mode for vulnerability scanning. - enum VulnerabilityMode { - // Default value not specified. - VULNERABILITY_MODE_UNSPECIFIED = 0; - - // Disables vulnerability scanning on the cluster. - VULNERABILITY_DISABLED = 1; - - // Applies basic vulnerability scanning on the cluster. - VULNERABILITY_BASIC = 2; - } - - // Sets which mode to use for Security Posture features. - optional Mode mode = 1; - - // Sets which mode to use for vulnerability scanning. - optional VulnerabilityMode vulnerability_mode = 2; -} - -// Node pool configs that apply to all auto-provisioned node pools -// in autopilot clusters and node auto-provisioning enabled clusters. -message NodePoolAutoConfig { - // 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 creation. Each tag within the list - // must comply with RFC1035. - NetworkTags network_tags = 1; -} - -// Subset of Nodepool message that has defaults. -message NodePoolDefaults { - // Subset of NodeConfig message that has defaults. - NodeConfigDefaults node_config_defaults = 1; -} - -// Subset of NodeConfig message that has defaults. -message NodeConfigDefaults { - // GCFS (Google Container File System, also known as Riptide) options. - GcfsConfig gcfs_config = 1; - - // Logging configuration for node pools. - NodePoolLoggingConfig logging_config = 3; -} - -// 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. -message ClusterUpdate { - // 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 - string desired_node_version = 4; - - // The monitoring service the cluster should use to write metrics. - // Currently available options: - // - // * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring - // service with a Kubernetes-native resource model - // * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no - // longer available as of GKE 1.15). - // * `none` - No metrics will be exported from the cluster. - // - // If left as an empty string,`monitoring.googleapis.com/kubernetes` will be - // used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. - string desired_monitoring_service = 5; - - // Configurations for the various addons available to run in the cluster. - AddonsConfig desired_addons_config = 6; - - // 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. - string desired_node_pool_id = 7; - - // The desired image type for the node pool. - // NOTE: Set the "desired_node_pool" field as well. - string desired_image_type = 8; - - // Configuration of etcd encryption. - DatabaseEncryption desired_database_encryption = 46; - - // Configuration for Workload Identity. - WorkloadIdentityConfig desired_workload_identity_config = 47; - - // Configuration for issuance of mTLS keys and certificates to Kubernetes - // pods. - MeshCertificates desired_mesh_certificates = 67; - - // Configuration for Shielded Nodes. - ShieldedNodes desired_shielded_nodes = 48; - - // The desired configuration for the fine-grained cost management feature. - CostManagementConfig desired_cost_management_config = 49; - - // DNSConfig contains clusterDNS config for this cluster. - DNSConfig desired_dns_config = 53; - - // 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. - NodePoolAutoscaling desired_node_pool_autoscaling = 9; - - // The desired list of Google Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster's nodes should be located. - // - // This list must always include the cluster's primary zone. - // - // Warning: changing cluster locations will update the locations of all node - // pools and will result in nodes being added and/or removed. - repeated string desired_locations = 10; - - // The desired configuration options for master authorized networks feature. - MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12; - - // Cluster-level autoscaling configuration. - ClusterAutoscaling desired_cluster_autoscaling = 15; - - // The desired configuration options for the Binary Authorization feature. - BinaryAuthorization desired_binary_authorization = 16; - - // The logging service the cluster should use to write logs. - // Currently available options: - // - // * `logging.googleapis.com/kubernetes` - The Cloud Logging - // service with a Kubernetes-native resource model - // * `logging.googleapis.com` - The legacy Cloud Logging service (no longer - // available as of GKE 1.15). - // * `none` - no logs will be exported from the cluster. - // - // If left as an empty string,`logging.googleapis.com/kubernetes` will be - // used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. - string desired_logging_service = 19; - - // The desired configuration for exporting resource usage. - ResourceUsageExportConfig desired_resource_usage_export_config = 21; - - // Cluster-level Vertical Pod Autoscaling configuration. - VerticalPodAutoscaling desired_vertical_pod_autoscaling = 22; - - // The desired private cluster configuration. - PrivateClusterConfig desired_private_cluster_config = 25; - - // The desired config of Intra-node visibility. - IntraNodeVisibilityConfig desired_intra_node_visibility_config = 26; - - // The desired status of whether to disable default sNAT for this cluster. - DefaultSnatStatus desired_default_snat_status = 28; - - // The desired release channel configuration. - ReleaseChannel desired_release_channel = 31; - - // The desired L4 Internal Load Balancer Subsetting configuration. - ILBSubsettingConfig desired_l4ilb_subsetting_config = 39; - - // The desired datapath provider for the cluster. - DatapathProvider desired_datapath_provider = 50; - - // The desired state of IPv6 connectivity to Google Services. - PrivateIPv6GoogleAccess desired_private_ipv6_google_access = 51; - - // The desired notification configuration. - NotificationConfig desired_notification_config = 55; - - // The desired authenticator groups config for the cluster. - AuthenticatorGroupsConfig desired_authenticator_groups_config = 63; - - // The desired logging configuration. - LoggingConfig desired_logging_config = 64; - - // The desired monitoring configuration. - MonitoringConfig desired_monitoring_config = 65; - - // The desired Identity Service component configuration. - IdentityServiceConfig desired_identity_service_config = 66; - - // ServiceExternalIPsConfig specifies the config for the use of Services with - // ExternalIPs field. - ServiceExternalIPsConfig desired_service_external_ips_config = 60; - - // Enable/Disable private endpoint for the cluster's master. - optional bool desired_enable_private_endpoint = 71; - - // 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 - string desired_master_version = 100; - - // The desired GCFS config for the cluster - GcfsConfig desired_gcfs_config = 109; - - // The desired network tags that apply to all auto-provisioned node pools - // in autopilot clusters and node auto-provisioning enabled clusters. - NetworkTags desired_node_pool_auto_config_network_tags = 110; - - // The desired config of Gateway API on this cluster. - GatewayAPIConfig desired_gateway_api_config = 114; - - // The current etag of the cluster. - // If an etag is provided and does not match the current etag of the cluster, - // update will be blocked and an ABORTED error will be returned. - string etag = 115; - - // The desired node pool logging configuration defaults for the cluster. - NodePoolLoggingConfig desired_node_pool_logging_config = 116; - - // The desired fleet configuration for the cluster. - Fleet desired_fleet = 117; - - // The desired stack type of the cluster. - // If a stack type is provided and does not match the current stack type of - // the cluster, update will attempt to change the stack type to the new type. - StackType desired_stack_type = 119; - - // The additional pod ranges to be added to the cluster. These pod ranges - // can be used by node pools to allocate pod IPs. - AdditionalPodRangesConfig additional_pod_ranges_config = 120; - - // The additional pod ranges that are to be removed from the cluster. - // The pod ranges specified here must have been specified earlier in the - // 'additional_pod_ranges_config' argument. - AdditionalPodRangesConfig removed_additional_pod_ranges_config = 121; - - // Kubernetes open source beta apis enabled on the cluster. Only beta apis - K8sBetaAPIConfig enable_k8s_beta_apis = 122; - - // Enable/Disable Security Posture API features for the cluster. - SecurityPostureConfig desired_security_posture_config = 124; - - // The desired network performance config. - NetworkConfig.ClusterNetworkPerformanceConfig - desired_network_performance_config = 125; - - // Enable/Disable FQDN Network Policy for the cluster. - optional bool desired_enable_fqdn_network_policy = 126; - - // The desired workload policy configuration for the autopilot cluster. - WorkloadPolicyConfig desired_autopilot_workload_policy_config = 128; - - // Desired Beta APIs to be enabled for cluster. - K8sBetaAPIConfig desired_k8s_beta_apis = 131; -} - -// AdditionalPodRangesConfig is the configuration for additional pod secondary -// ranges supporting the ClusterUpdate message. -message AdditionalPodRangesConfig { - // Name for pod secondary ipv4 range which has the actual range defined ahead. - repeated string pod_range_names = 1; -} - -// This operation resource represents operations that may have happened or are -// happening on the cluster. All fields are output only. -message Operation { - // Current status of the operation. - enum Status { - // Not set. - STATUS_UNSPECIFIED = 0; - - // The operation has been created. - PENDING = 1; - - // The operation is currently running. - RUNNING = 2; - - // The operation is done, either cancelled or completed. - DONE = 3; - - // The operation is aborting. - ABORTING = 4; - } - - // Operation type categorizes the operation. - enum Type { - // Not set. - TYPE_UNSPECIFIED = 0; - - // The cluster is being created. The cluster should be assumed to be - // unusable until the operation finishes. - // - // In the event of the operation failing, the cluster will enter the [ERROR - // state][Cluster.Status.ERROR] and eventually be deleted. - CREATE_CLUSTER = 1; - - // The cluster is being deleted. The cluster should be assumed to be - // unusable as soon as this operation starts. - // - // In the event of the operation failing, the cluster will enter the [ERROR - // state][Cluster.Status.ERROR] and the deletion will be automatically - // retried until completed. - DELETE_CLUSTER = 2; - - // The [cluster - // version][google.container.v1.ClusterUpdate.desired_master_version] is - // being updated. Note that this includes "upgrades" to the same version, - // which are simply a recreation. This also includes - // [auto-upgrades](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades#upgrading_automatically). - // For more details, see [documentation on cluster - // upgrades](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades#cluster_upgrades). - UPGRADE_MASTER = 3; - - // A node pool is being updated. Despite calling this an "upgrade", this - // includes most forms of updates to node pools. This also includes - // [auto-upgrades](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-upgrades). - // - // This operation sets the - // [progress][google.container.v1.Operation.progress] field and may be - // [canceled][google.container.v1.ClusterManager.CancelOperation]. - // - // The upgrade strategy depends on [node pool - // configuration](https://cloud.google.com/kubernetes-engine/docs/concepts/node-pool-upgrade-strategies). - // The nodes are generally still usable during this operation. - UPGRADE_NODES = 4; - - // A problem has been detected with the control plane and is being repaired. - // This operation type is initiated by GKE. For more details, see - // [documentation on - // repairs](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#repairs). - REPAIR_CLUSTER = 5; - - // The cluster is being updated. This is a broad category of operations and - // includes operations that only change metadata as well as those that must - // recreate the entire cluster. If the control plane must be recreated, this - // will cause temporary downtime for zonal clusters. - // - // Some features require recreating the nodes as well. Those will be - // recreated as separate operations and the update may not be completely - // functional until the node pools recreations finish. Node recreations will - // generally follow [maintenance - // policies](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions). - // - // Some GKE-initiated operations use this type. This includes certain types - // of auto-upgrades and incident mitigations. - UPDATE_CLUSTER = 6; - - // A node pool is being created. The node pool should be assumed to be - // unusable until this operation finishes. In the event of an error, the - // node pool may be partially created. - // - // If enabled, [node - // autoprovisioning](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-provisioning) - // may have automatically initiated such operations. - CREATE_NODE_POOL = 7; - - // The node pool is being deleted. The node pool should be assumed to be - // unusable as soon as this operation starts. - DELETE_NODE_POOL = 8; - - // The node pool's [manamagent][google.container.v1.NodePool.management] - // field is being updated. These operations only update metadata and may be - // concurrent with most other operations. - SET_NODE_POOL_MANAGEMENT = 9; - - // A problem has been detected with nodes and [they are being - // repaired](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-repair). - // This operation type is initiated by GKE, typically automatically. This - // operation may be concurrent with other operations and there may be - // multiple repairs occurring on the same node pool. - AUTO_REPAIR_NODES = 10; - - // Unused. Automatic node upgrade uses - // [UPGRADE_NODES][google.container.v1.Operation.Type.UPGRADE_NODES]. - AUTO_UPGRADE_NODES = 11 [deprecated = true]; - - // Unused. Updating labels uses - // [UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER]. - SET_LABELS = 12 [deprecated = true]; - - // Unused. Updating master auth uses - // [UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER]. - SET_MASTER_AUTH = 13 [deprecated = true]; - - // The node pool is being resized. With the exception of resizing to or from - // size zero, the node pool is generally usable during this operation. - SET_NODE_POOL_SIZE = 14; - - // Unused. Updating network policy uses - // [UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER]. - SET_NETWORK_POLICY = 15 [deprecated = true]; - - // Unused. Updating maintenance policy uses - // [UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER]. - SET_MAINTENANCE_POLICY = 16 [deprecated = true]; - - // The control plane is being resized. This operation type is initiated by - // GKE. These operations are often performed preemptively to ensure that the - // control plane has sufficient resources and is not typically an indication - // of issues. For more details, see - // [documentation on - // resizes](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#repairs). - RESIZE_CLUSTER = 18; - } - - // The server-assigned ID for the operation. - string name = 1; - - // The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // operation is taking place. This field is deprecated, use location instead. - string zone = 2 [deprecated = true]; - - // The operation type. - Type operation_type = 3; - - // The current status of the operation. - Status status = 4; - - // Detailed operation progress, if available. - string detail = 8; - - // Output only. If an error has occurred, a textual description of the error. - // Deprecated. Use the field error instead. - string status_message = 5 - [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; - - // Server-defined URI for the operation. Example: - // `https://container.googleapis.com/v1alpha1/projects/123/locations/us-central1/operations/operation-123`. - string self_link = 6; - - // Server-defined URI for the target of the operation. The format of this is a - // URI to the resource being modified (such as a cluster, node pool, or node). - // For node pool repairs, there may be multiple nodes being repaired, but only - // one will be the target. - // - // Examples: - // - // - - // ## - // `https://container.googleapis.com/v1/projects/123/locations/us-central1/clusters/my-cluster` - // - // ## - // `https://container.googleapis.com/v1/projects/123/zones/us-central1-c/clusters/my-cluster/nodePools/my-np` - // - // `https://container.googleapis.com/v1/projects/123/zones/us-central1-c/clusters/my-cluster/nodePools/my-np/node/my-node` - string target_link = 7; - - // [Output only] The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) - // or - // [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) - // in which the cluster resides. - string location = 9; - - // [Output only] The time the operation started, in - // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string start_time = 10; - - // [Output only] The time the operation completed, in - // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string end_time = 11; - - // Output only. [Output only] Progress information for an operation. - OperationProgress progress = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Which conditions caused the current cluster state. - // Deprecated. Use field error instead. - repeated StatusCondition cluster_conditions = 13 [deprecated = true]; - - // Which conditions caused the current node pool state. - // Deprecated. Use field error instead. - repeated StatusCondition nodepool_conditions = 14 [deprecated = true]; - - // The error result of the operation in case of failure. - google.rpc.Status error = 15; -} - -// Information about operation (or operation stage) progress. -message OperationProgress { - // Progress metric is (string, int|float|string) pair. - message Metric { - // Required. Metric name, e.g., "nodes total", "percent done". - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Strictly one of the values is required. - oneof value { - // For metrics with integer value. - int64 int_value = 2; - - // For metrics with floating point value. - double double_value = 3; - - // For metrics with custom values (ratios, visual progress, etc.). - string string_value = 4; - } - } - - // A non-parameterized string describing an operation stage. - // Unset for single-stage operations. - string name = 1; - - // Status of an operation stage. - // Unset for single-stage operations. - Operation.Status status = 2; - - // Progress metric bundle, for example: - // metrics: [{name: "nodes done", int_value: 15}, - // {name: "nodes total", int_value: 32}] - // or - // metrics: [{name: "progress", double_value: 0.56}, - // {name: "progress scale", double_value: 1.0}] - repeated Metric metrics = 3; - - // Substages of an operation or a stage. - repeated OperationProgress stages = 4; -} - -// CreateClusterRequest creates a cluster. -message CreateClusterRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the parent - // field. - string zone = 2 [deprecated = true]; - - // Required. A [cluster - // resource](https://cloud.google.com/container-engine/reference/rest/v1/projects.locations.clusters) - Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; - - // The parent (project and location) where the cluster will be created. - // Specified in the format `projects/*/locations/*`. - string parent = 5; -} - -// GetClusterRequest gets the settings of a cluster. -message GetClusterRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to retrieve. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // The name (project, location, cluster) of the cluster to retrieve. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 5; -} - -// UpdateClusterRequest updates the settings of a cluster. -message UpdateClusterRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Required. A description of the update. - ClusterUpdate update = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to update. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 5; -} - -// UpdateNodePoolRequests update a node pool's image and/or version. -message UpdateNodePoolRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Deprecated. The name of the node pool to upgrade. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [deprecated = true]; - - // 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 - string node_version = 5 [(google.api.field_behavior) = REQUIRED]; - - // Required. The desired image type for the node pool. Please see - // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for - // available image types. - string image_type = 6 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster, node pool) of the node pool to - // update. Specified in the format - // `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 8; - - // The desired list of Google Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) in which the - // node pool's nodes should be located. Changing the locations for a node pool - // will result in nodes being either created or removed from the node pool, - // depending on whether locations are being added or removed. - repeated string locations = 13; - - // The desired workload metadata config for the node pool. - WorkloadMetadataConfig workload_metadata_config = 14; - - // Upgrade settings control disruption and speed of the upgrade. - NodePool.UpgradeSettings upgrade_settings = 15; - - // The desired network tags to be applied to all nodes in the node pool. - // If this field is not present, the tags will not be changed. Otherwise, - // the existing network tags will be *replaced* with the provided tags. - NetworkTags tags = 16; - - // The desired node taints to be applied to all nodes in the node pool. - // If this field is not present, the taints will not be changed. Otherwise, - // the existing node taints will be *replaced* with the provided taints. - NodeTaints taints = 17; - - // The desired node labels to be applied to all nodes in the node pool. - // If this field is not present, the labels will not be changed. Otherwise, - // the existing node labels will be *replaced* with the provided labels. - NodeLabels labels = 18; - - // Parameters that can be configured on Linux nodes. - LinuxNodeConfig linux_node_config = 19; - - // Node kubelet configs. - NodeKubeletConfig kubelet_config = 20; - - // Node network config. - NodeNetworkConfig node_network_config = 21; - - // GCFS config. - GcfsConfig gcfs_config = 22; - - // Confidential nodes config. - // All the nodes in the node pool will be Confidential VM once enabled. - ConfidentialNodes confidential_nodes = 23; - - // Enable or disable gvnic on the node pool. - VirtualNIC gvnic = 29; - - // The current etag of the node pool. - // If an etag is provided and does not match the current etag of the node - // pool, update will be blocked and an ABORTED error will be returned. - string etag = 30; - - // Enable or disable NCCL fast socket for the node pool. - FastSocket fast_socket = 31; - - // Logging configuration. - NodePoolLoggingConfig logging_config = 32; - - // The resource labels for the node pool to use to annotate any related - // Google Compute Engine resources. - ResourceLabels resource_labels = 33; - - // Parameters that can be configured on Windows nodes. - WindowsNodeConfig windows_node_config = 34; -} - -// SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool. -message SetNodePoolAutoscalingRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Deprecated. The name of the node pool to upgrade. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [deprecated = true]; - - // Required. Autoscaling configuration for the node pool. - NodePoolAutoscaling autoscaling = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster, node pool) of the node pool to set - // autoscaler settings. Specified in the format - // `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 6; -} - -// SetLoggingServiceRequest sets the logging service of a cluster. -message SetLoggingServiceRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Required. The logging service the cluster should use to write logs. - // Currently available options: - // - // * `logging.googleapis.com/kubernetes` - The Cloud Logging - // service with a Kubernetes-native resource model - // * `logging.googleapis.com` - The legacy Cloud Logging service (no longer - // available as of GKE 1.15). - // * `none` - no logs will be exported from the cluster. - // - // If left as an empty string,`logging.googleapis.com/kubernetes` will be - // used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. - string logging_service = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set logging. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 5; -} - -// SetMonitoringServiceRequest sets the monitoring service of a cluster. -message SetMonitoringServiceRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Required. The monitoring service the cluster should use to write metrics. - // Currently available options: - // - // * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring - // service with a Kubernetes-native resource model - // * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no - // longer available as of GKE 1.15). - // * `none` - No metrics will be exported from the cluster. - // - // If left as an empty string,`monitoring.googleapis.com/kubernetes` will be - // used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. - string monitoring_service = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set monitoring. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 6; -} - -// SetAddonsConfigRequest sets the addons associated with the cluster. -message SetAddonsConfigRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Required. The desired configurations for the various addons available to - // run in the cluster. - AddonsConfig addons_config = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set addons. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 6; -} - -// SetLocationsRequest sets the locations of the cluster. -message SetLocationsRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Required. The desired list of Google Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) 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. - repeated string locations = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set locations. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 6; -} - -// UpdateMasterRequest updates the master of the cluster. -message UpdateMasterRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // 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 - string master_version = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to update. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 7; -} - -// SetMasterAuthRequest updates the admin password of a cluster. -message SetMasterAuthRequest { - // Operation type: what type update to perform. - enum Action { - // Operation is unknown and will error out. - UNKNOWN = 0; - - // Set the password to a user generated value. - SET_PASSWORD = 1; - - // Generate a new password and set it to that. - GENERATE_PASSWORD = 2; - - // 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. - SET_USERNAME = 3; - } - - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Required. The exact form of action to be taken on the master auth. - Action action = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. A description of the update. - MasterAuth update = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set auth. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 7; -} - -// DeleteClusterRequest deletes a cluster. -message DeleteClusterRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to delete. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // The name (project, location, cluster) of the cluster to delete. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 4; -} - -// ListClustersRequest lists clusters. -message ListClustersRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides, or "-" for all zones. This field has been deprecated and - // replaced by the parent field. - string zone = 2 [deprecated = true]; - - // The parent (project and location) where the clusters will be listed. - // Specified in the format `projects/*/locations/*`. - // Location "-" matches all zones and all regions. - string parent = 4; -} - -// ListClustersResponse is the result of ListClustersRequest. -message ListClustersResponse { - // A list of clusters in the project in the specified zone, or - // across all ones. - repeated Cluster clusters = 1; - - // If any zones are listed here, the list of clusters returned - // may be missing those zones. - repeated string missing_zones = 2; -} - -// GetOperationRequest gets a single operation. -message GetOperationRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The server-assigned `name` of the operation. - // This field has been deprecated and replaced by the name field. - string operation_id = 3 [deprecated = true]; - - // The name (project, location, operation id) of the operation to get. - // Specified in the format `projects/*/locations/*/operations/*`. - string name = 5; -} - -// ListOperationsRequest lists operations. -message ListOperationsRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) to return - // operations for, or `-` for all zones. This field has been deprecated and - // replaced by the parent field. - string zone = 2 [deprecated = true]; - - // The parent (project and location) where the operations will be listed. - // Specified in the format `projects/*/locations/*`. - // Location "-" matches all zones and all regions. - string parent = 4; -} - -// CancelOperationRequest cancels a single operation. -message CancelOperationRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // operation resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The server-assigned `name` of the operation. - // This field has been deprecated and replaced by the name field. - string operation_id = 3 [deprecated = true]; - - // The name (project, location, operation id) of the operation to cancel. - // Specified in the format `projects/*/locations/*/operations/*`. - string name = 4; -} - -// ListOperationsResponse is the result of ListOperationsRequest. -message ListOperationsResponse { - // A list of operations in the project in the specified zone. - repeated Operation operations = 1; - - // If any zones are listed here, the list of operations returned - // may be missing the operations from those zones. - repeated string missing_zones = 2; -} - -// Gets the current Kubernetes Engine service configuration. -message GetServerConfigRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) to return - // operations for. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // The name (project and location) of the server config to get, - // specified in the format `projects/*/locations/*`. - string name = 4; -} - -// Kubernetes Engine service configuration. -message ServerConfig { - // ReleaseChannelConfig exposes configuration for a release channel. - message ReleaseChannelConfig { - // The release channel this configuration applies to. - ReleaseChannel.Channel channel = 1; - - // The default version for newly created clusters on the channel. - string default_version = 2; - - // List of valid versions for the channel. - repeated string valid_versions = 4; - } - - // Version of Kubernetes the service deploys by default. - string default_cluster_version = 1; - - // List of valid node upgrade target versions, in descending order. - repeated string valid_node_versions = 3; - - // Default image type. - string default_image_type = 4; - - // List of valid image types. - repeated string valid_image_types = 5; - - // List of valid master versions, in descending order. - repeated string valid_master_versions = 6; - - // List of release channel configurations. - repeated ReleaseChannelConfig channels = 9; -} - -// CreateNodePoolRequest creates a node pool for a cluster. -message CreateNodePoolRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the parent - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the parent field. - string cluster_id = 3 [deprecated = true]; - - // Required. The node pool to create. - NodePool node_pool = 4 [(google.api.field_behavior) = REQUIRED]; - - // The parent (project, location, cluster name) where the node pool will be - // created. Specified in the format - // `projects/*/locations/*/clusters/*`. - string parent = 6; -} - -// DeleteNodePoolRequest deletes a node pool for a cluster. -message DeleteNodePoolRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Deprecated. The name of the node pool to delete. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [deprecated = true]; - - // The name (project, location, cluster, node pool id) of the node pool to - // delete. Specified in the format - // `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 6; -} - -// ListNodePoolsRequest lists the node pool(s) for a cluster. -message ListNodePoolsRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the parent - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the parent field. - string cluster_id = 3 [deprecated = true]; - - // The parent (project, location, cluster name) where the node pools will be - // listed. Specified in the format `projects/*/locations/*/clusters/*`. - string parent = 5; -} - -// GetNodePoolRequest retrieves a node pool for a cluster. -message GetNodePoolRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Deprecated. The name of the node pool. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [deprecated = true]; - - // The name (project, location, cluster, node pool id) of the node pool to - // get. Specified in the format - // `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 6; -} - -// Settings for blue-green upgrade. -message BlueGreenSettings { - // Standard rollout policy is the default policy for blue-green. - message StandardRolloutPolicy { - // Blue pool size to drain in a batch. - oneof update_batch_size { - // Percentage of the blue pool nodes to drain in a batch. - // The range of this field should be (0.0, 1.0]. - float batch_percentage = 1; - - // Number of blue nodes to drain in a batch. - int32 batch_node_count = 2; - } - - // Soak time after each batch gets drained. Default to zero. - optional google.protobuf.Duration batch_soak_duration = 3; - } - - // The rollout policy controls the general rollout progress of blue-green. - oneof rollout_policy { - // Standard policy for the blue-green upgrade. - StandardRolloutPolicy standard_rollout_policy = 1; - } - - // Time needed after draining entire blue pool. After this period, blue pool - // will be cleaned up. - optional google.protobuf.Duration node_pool_soak_duration = 2; -} - -// 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. -message NodePool { - // These upgrade settings control the level of parallelism and the level of - // disruption caused by an upgrade. - // - // maxUnavailable controls the number of nodes that can be simultaneously - // unavailable. - // - // maxSurge controls the number of additional nodes that can be added to the - // node pool temporarily for the time of the upgrade to increase the number of - // available nodes. - // - // (maxUnavailable + maxSurge) determines the level of parallelism (how many - // nodes are being upgraded at the same time). - // - // Note: upgrades inevitably introduce some disruption since workloads need to - // be moved from old nodes to new, upgraded ones. Even if maxUnavailable=0, - // this holds true. (Disruption stays within the limits of - // PodDisruptionBudget, if it is configured.) - // - // Consider a hypothetical node pool with 5 nodes having maxSurge=2, - // maxUnavailable=1. This means the upgrade process upgrades 3 nodes - // simultaneously. It creates 2 additional (upgraded) nodes, then it brings - // down 3 old (not yet upgraded) nodes at the same time. This ensures that - // there are always at least 4 nodes available. - // - // These upgrade settings configure the upgrade strategy for the node pool. - // Use strategy to switch between the strategies applied to the node pool. - // - // If the strategy is ROLLING, use max_surge and max_unavailable to control - // the level of parallelism and the level of disruption caused by upgrade. - // 1. maxSurge controls the number of additional nodes that can be added to - // the node pool temporarily for the time of the upgrade to increase the - // number of available nodes. - // 2. maxUnavailable controls the number of nodes that can be simultaneously - // unavailable. - // 3. (maxUnavailable + maxSurge) determines the level of parallelism (how - // many nodes are being upgraded at the same time). - // - // If the strategy is BLUE_GREEN, use blue_green_settings to configure the - // blue-green upgrade related settings. - // 1. standard_rollout_policy is the default policy. The policy is used to - // control the way blue pool gets drained. The draining is executed in the - // batch mode. The batch size could be specified as either percentage of the - // node pool size or the number of nodes. batch_soak_duration is the soak - // time after each batch gets drained. - // 2. node_pool_soak_duration is the soak time after all blue nodes are - // drained. After this period, the blue pool nodes will be deleted. - message UpgradeSettings { - // The maximum number of nodes that can be created beyond the current size - // of the node pool during the upgrade process. - int32 max_surge = 1; - - // The maximum number of nodes that can be simultaneously unavailable during - // the upgrade process. A node is considered available if its status is - // Ready. - int32 max_unavailable = 2; - - // Update strategy of the node pool. - optional NodePoolUpdateStrategy strategy = 3; - - // Settings for blue-green upgrade strategy. - optional BlueGreenSettings blue_green_settings = 4; - } - - // UpdateInfo contains resource (instance groups, etc), status and other - // intermediate information relevant to a node pool upgrade. - message UpdateInfo { - // Information relevant to blue-green upgrade. - message BlueGreenInfo { - // Phase represents the different stages blue-green upgrade is running in. - enum Phase { - // Unspecified phase. - PHASE_UNSPECIFIED = 0; - - // blue-green upgrade has been initiated. - UPDATE_STARTED = 1; - - // Start creating green pool nodes. - CREATING_GREEN_POOL = 2; - - // Start cordoning blue pool nodes. - CORDONING_BLUE_POOL = 3; - - // Start draining blue pool nodes. - DRAINING_BLUE_POOL = 4; - - // Start soaking time after draining entire blue pool. - NODE_POOL_SOAKING = 5; - - // Start deleting blue nodes. - DELETING_BLUE_POOL = 6; - - // Rollback has been initiated. - ROLLBACK_STARTED = 7; - } - - // Current blue-green upgrade phase. - Phase phase = 1; - - // The resource URLs of the [managed instance groups] - // (/compute/docs/instance-groups/creating-groups-of-managed-instances) - // associated with blue pool. - repeated string blue_instance_group_urls = 2; - - // The resource URLs of the [managed instance groups] - // (/compute/docs/instance-groups/creating-groups-of-managed-instances) - // associated with green pool. - repeated string green_instance_group_urls = 3; - - // Time to start deleting blue pool to complete blue-green upgrade, - // in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string blue_pool_deletion_start_time = 4; - - // Version of green pool. - string green_pool_version = 5; - } - - // Information of a blue-green upgrade. - BlueGreenInfo blue_green_info = 1; - } - - // The current status of the node pool instance. - enum Status { - // Not set. - STATUS_UNSPECIFIED = 0; - - // The PROVISIONING state indicates the node pool is being created. - PROVISIONING = 1; - - // The RUNNING state indicates the node pool has been created - // and is fully usable. - RUNNING = 2; - - // 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. - RUNNING_WITH_ERROR = 3; - - // 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. - RECONCILING = 4; - - // The STOPPING state indicates the node pool is being deleted. - STOPPING = 5; - - // The ERROR state indicates the node pool may be unusable. Details - // can be found in the `statusMessage` field. - ERROR = 6; - } - - // PlacementPolicy defines the placement policy used by the node pool. - message PlacementPolicy { - // Type defines the type of placement policy. - enum Type { - // TYPE_UNSPECIFIED specifies no requirements on nodes - // placement. - TYPE_UNSPECIFIED = 0; - - // COMPACT specifies node placement in the same availability domain to - // ensure low communication latency. - COMPACT = 1; - } - - // The type of placement. - Type type = 1; - } - - // The name of the node pool. - string name = 1; - - // The node configuration of the pool. - NodeConfig config = 2; - - // The initial node count for the pool. You must ensure that your - // 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; - - // The list of Google Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) in which the - // NodePool's nodes should be located. - // - // If this value is unspecified during node pool creation, the - // [Cluster.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters#Cluster.FIELDS.locations) - // value will be used, instead. - // - // Warning: changing node pool locations will result in nodes being added - // and/or removed. - repeated string locations = 13; - - // Networking configuration for this NodePool. If specified, it overrides the - // cluster-level defaults. - NodeNetworkConfig network_config = 14; - - // [Output only] Server-defined URL for the resource. - string self_link = 100; - - // The version of Kubernetes running on this NodePool's nodes. If unspecified, - // it defaults as described - // [here](https://cloud.google.com/kubernetes-engine/versioning#specifying_node_version). - string version = 101; - - // [Output only] The resource URLs of the [managed instance - // groups](https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-managed-instances) - // associated with this node pool. - // During the node pool blue-green upgrade operation, the URLs contain both - // blue and green resources. - repeated string instance_group_urls = 102; - - // [Output only] The status of the nodes in this pool instance. - Status status = 103; - - // [Output only] Deprecated. Use conditions instead. - // Additional information about the current status of this - // node pool instance, if available. - string status_message = 104 [deprecated = true]; - - // Autoscaler configuration for this NodePool. Autoscaler is enabled - // only if a valid configuration is present. - NodePoolAutoscaling autoscaling = 4; - - // NodeManagement configuration for this NodePool. - NodeManagement management = 5; - - // The constraint on the maximum number of pods that can be run - // simultaneously on a node in the node pool. - MaxPodsConstraint max_pods_constraint = 6; - - // Which conditions caused the current node pool state. - repeated StatusCondition conditions = 105; - - // [Output only] The pod CIDR block size per node in this node pool. - int32 pod_ipv4_cidr_size = 7; - - // Upgrade settings control disruption and speed of the upgrade. - UpgradeSettings upgrade_settings = 107; - - // Specifies the node placement policy. - PlacementPolicy placement_policy = 108; - - // Output only. [Output only] Update info contains relevant information during - // a node pool update. - UpdateInfo update_info = 109 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // This checksum is computed by the server based on the value of node pool - // fields, and may be sent on update requests to ensure the client has an - // up-to-date value before proceeding. - string etag = 110; - - // Enable best effort provisioning for nodes - BestEffortProvisioning best_effort_provisioning = 113; -} - -// NodeManagement defines the set of node management services turned on for the -// node pool. -message NodeManagement { - // 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. - bool auto_upgrade = 1; - - // 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. - bool auto_repair = 2; - - // Specifies the Auto Upgrade knobs for the node pool. - AutoUpgradeOptions upgrade_options = 10; -} - -// Best effort provisioning. -message BestEffortProvisioning { - // When this is enabled, cluster/node pool creations will ignore non-fatal - // errors like stockout to best provision as many nodes as possible right now - // and eventually bring up all target number of nodes - bool enabled = 1; - - // Minimum number of nodes to be provisioned to be considered as succeeded, - // and the rest of nodes will be provisioned gradually and eventually when - // stockout issue has been resolved. - int32 min_provision_nodes = 2; -} - -// AutoUpgradeOptions defines the set of options for the user to control how -// the Auto Upgrades will proceed. -message AutoUpgradeOptions { - // [Output only] This field is set when upgrades are about to commence - // with the approximate start time for the upgrades, in - // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string auto_upgrade_start_time = 1; - - // [Output only] This field is set when upgrades are about to commence - // with the description of the upgrade. - string description = 2; -} - -// MaintenancePolicy defines the maintenance policy to be used for the cluster. -message MaintenancePolicy { - // Specifies the maintenance window in which maintenance may be performed. - MaintenanceWindow window = 1; - - // 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. - string resource_version = 3; -} - -// MaintenanceWindow defines the maintenance window to be used for the cluster. -message MaintenanceWindow { - oneof policy { - // DailyMaintenanceWindow specifies a daily maintenance operation window. - DailyMaintenanceWindow daily_maintenance_window = 2; - - // 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. - RecurringTimeWindow recurring_window = 3; - } - - // Exceptions to maintenance window. Non-emergency maintenance should not - // occur in these windows. - map maintenance_exclusions = 4; -} - -// Represents an arbitrary window of time. -message TimeWindow { - oneof options { - // MaintenanceExclusionOptions provides maintenance exclusion related - // options. - MaintenanceExclusionOptions maintenance_exclusion_options = 3; - } - - // The time that the window first starts. - google.protobuf.Timestamp start_time = 1; - - // The time that the window ends. The end time should take place after the - // start time. - google.protobuf.Timestamp end_time = 2; -} - -// Represents the Maintenance exclusion option. -message MaintenanceExclusionOptions { - // Scope of exclusion. - enum Scope { - // NO_UPGRADES excludes all upgrades, including patch upgrades and minor - // upgrades across control planes and nodes. This is the default exclusion - // behavior. - NO_UPGRADES = 0; - - // NO_MINOR_UPGRADES excludes all minor upgrades for the cluster, only - // patches are allowed. - NO_MINOR_UPGRADES = 1; - - // NO_MINOR_OR_NODE_UPGRADES excludes all minor upgrades for the cluster, - // and also exclude all node pool upgrades. Only control - // plane patches are allowed. - NO_MINOR_OR_NODE_UPGRADES = 2; - } - - // Scope specifies the upgrade scope which upgrades are blocked by the - // exclusion. - Scope scope = 1; -} - -// Represents an arbitrary window of time that recurs. -message RecurringTimeWindow { - // The window of the first recurrence. - TimeWindow window = 1; - - // 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. - string recurrence = 2; -} - -// Time window specified for daily maintenance operations. -message DailyMaintenanceWindow { - // Time within the maintenance window to start the maintenance operations. - // Time format should be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) - // format "HH:MM", where HH : [00-23] and MM : [00-59] GMT. - string start_time = 2; - - // [Output only] Duration of the time window, automatically chosen to be - // smallest possible in the given scenario. - // Duration will be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) - // format "PTnHnMnS". - string duration = 3; -} - -// SetNodePoolManagementRequest sets the node management properties of a node -// pool. -message SetNodePoolManagementRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to update. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Deprecated. The name of the node pool to update. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [deprecated = true]; - - // Required. NodeManagement configuration for the node pool. - NodeManagement management = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster, node pool id) of the node pool to set - // management properties. Specified in the format - // `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 7; -} - -// SetNodePoolSizeRequest sets the size of a node pool. -message SetNodePoolSizeRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to update. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Deprecated. The name of the node pool to update. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [deprecated = true]; - - // Required. The desired node count for the pool. - int32 node_count = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster, node pool id) of the node pool to set - // size. - // Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 7; -} - -// CompleteNodePoolUpgradeRequest sets the name of target node pool to complete -// upgrade. -message CompleteNodePoolUpgradeRequest { - // The name (project, location, cluster, node pool id) of the node pool to - // complete upgrade. - // Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 1; -} - -// RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed -// NodePool upgrade. This will be an no-op if the last upgrade successfully -// completed. -message RollbackNodePoolUpgradeRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to rollback. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Deprecated. The name of the node pool to rollback. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [deprecated = true]; - - // The name (project, location, cluster, node pool id) of the node poll to - // rollback upgrade. - // Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 6; - - // Option for rollback to ignore the PodDisruptionBudget. - // Default value is false. - bool respect_pdb = 7; -} - -// ListNodePoolsResponse is the result of ListNodePoolsRequest. -message ListNodePoolsResponse { - // A list of node pools for a cluster. - repeated NodePool node_pools = 1; -} - -// 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. -message ClusterAutoscaling { - // Defines possible options for autoscaling_profile field. - enum AutoscalingProfile { - // No change to autoscaling configuration. - PROFILE_UNSPECIFIED = 0; - - // Prioritize optimizing utilization of resources. - OPTIMIZE_UTILIZATION = 1; - - // Use default (balanced) autoscaling configuration. - BALANCED = 2; - } - - // Enables automatic node pool creation and deletion. - bool enable_node_autoprovisioning = 1; - - // Contains global constraints regarding minimum and maximum - // amount of resources in the cluster. - repeated ResourceLimit resource_limits = 2; - - // Defines autoscaling behaviour. - AutoscalingProfile autoscaling_profile = 3; - - // AutoprovisioningNodePoolDefaults contains defaults for a node pool - // created by NAP. - AutoprovisioningNodePoolDefaults autoprovisioning_node_pool_defaults = 4; - - // The list of Google Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) in which the - // NodePool's nodes can be created by NAP. - repeated string autoprovisioning_locations = 5; -} - -// AutoprovisioningNodePoolDefaults contains defaults for a node pool created -// by NAP. -message AutoprovisioningNodePoolDefaults { - // Scopes that are used by NAP when creating node pools. - repeated string oauth_scopes = 1; - - // The Google Cloud Platform Service Account to be used by the node VMs. - string service_account = 2; - - // Specifies the upgrade settings for NAP created node pools - NodePool.UpgradeSettings upgrade_settings = 3; - - // Specifies the node management options for NAP created node-pools. - NodeManagement management = 4; - - // Deprecated. Minimum CPU platform to be used for NAP created node pools. - // 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](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform). - // This field is deprecated, min_cpu_platform should be specified using - // `cloud.google.com/requested-min-cpu-platform` label selector on the pod. - // To unset the min cpu platform field pass "automatic" - // as field value. - string min_cpu_platform = 5 [deprecated = true]; - - // 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. - int32 disk_size_gb = 6; - - // Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or - // 'pd-balanced') - // - // If unspecified, the default disk type is 'pd-standard' - string disk_type = 7; - - // Shielded Instance options. - ShieldedInstanceConfig shielded_instance_config = 8; - - // The Customer Managed Encryption Key used to encrypt the boot disk attached - // to each node in the node pool. This should be of the form - // projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. - // For more information about protecting resources with Cloud KMS Keys please - // see: - // https://cloud.google.com/compute/docs/disks/customer-managed-encryption - string boot_disk_kms_key = 9; - - // The image type to use for NAP created node. Please see - // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for - // available image types. - string image_type = 10; -} - -// Contains information about amount of some resource in the cluster. -// For memory, value should be in GB. -message ResourceLimit { - // Resource name "cpu", "memory" or gpu-specific string. - string resource_type = 1; - - // Minimum amount of the resource in the cluster. - int64 minimum = 2; - - // Maximum amount of the resource in the cluster. - int64 maximum = 3; -} - -// NodePoolAutoscaling contains information required by cluster autoscaler to -// adjust the size of the node pool to the current cluster usage. -message NodePoolAutoscaling { - // Location policy specifies how zones are picked when scaling up the - // nodepool. - enum LocationPolicy { - // Not set. - LOCATION_POLICY_UNSPECIFIED = 0; - - // BALANCED is a best effort policy that aims to balance the sizes of - // different zones. - BALANCED = 1; - - // ANY policy picks zones that have the highest capacity available. - ANY = 2; - } - - // Is autoscaling enabled for this node pool. - bool enabled = 1; - - // Minimum number of nodes for one location in the NodePool. Must be >= 1 and - // <= max_node_count. - int32 min_node_count = 2; - - // Maximum number of nodes for one location in the NodePool. Must be >= - // min_node_count. There has to be enough quota to scale up the cluster. - int32 max_node_count = 3; - - // Can this node pool be deleted automatically. - bool autoprovisioned = 4; - - // Location policy used when scaling up a nodepool. - LocationPolicy location_policy = 5; - - // Minimum number of nodes in the node pool. Must be greater than 1 less than - // total_max_node_count. - // The total_*_node_count fields are mutually exclusive with the *_node_count - // fields. - int32 total_min_node_count = 6; - - // Maximum number of nodes in the node pool. Must be greater than - // total_min_node_count. There has to be enough quota to scale up the cluster. - // The total_*_node_count fields are mutually exclusive with the *_node_count - // fields. - int32 total_max_node_count = 7; -} - -// 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 -message SetLabelsRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Required. The labels to set for that cluster. - map resource_labels = 4 - [(google.api.field_behavior) = REQUIRED]; - - // 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. - string label_fingerprint = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster name) of the cluster to set labels. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 7; -} - -// SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for -// a cluster. -message SetLegacyAbacRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to update. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Required. Whether ABAC authorization will be enabled in the cluster. - bool enabled = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster name) of the cluster to set legacy - // abac. Specified in the format `projects/*/locations/*/clusters/*`. - string name = 6; -} - -// StartIPRotationRequest creates a new IP for the cluster and then performs -// a node upgrade on each node pool to point to the new IP. -message StartIPRotationRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // The name (project, location, cluster name) of the cluster to start IP - // rotation. Specified in the format `projects/*/locations/*/clusters/*`. - string name = 6; - - // Whether to rotate credentials during IP rotation. - bool rotate_credentials = 7; -} - -// CompleteIPRotationRequest moves the cluster master back into single-IP mode. -message CompleteIPRotationRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // The name (project, location, cluster name) of the cluster to complete IP - // rotation. Specified in the format `projects/*/locations/*/clusters/*`. - string name = 7; -} - -// AcceleratorConfig represents a Hardware Accelerator request. -message AcceleratorConfig { - // The number of the accelerator cards exposed to an instance. - int64 accelerator_count = 1; - - // The accelerator type resource name. List of supported accelerators - // [here](https://cloud.google.com/compute/docs/gpus) - string accelerator_type = 2; - - // Size of partitions to create on the GPU. Valid values are described in the - // NVIDIA [mig user - // guide](https://docs.nvidia.com/datacenter/tesla/mig-user-guide/#partitioning). - string gpu_partition_size = 3; - - // The configuration for GPU sharing options. - optional GPUSharingConfig gpu_sharing_config = 5; - - // The configuration for auto installation of GPU driver. - optional GPUDriverInstallationConfig gpu_driver_installation_config = 6; -} - -// GPUSharingConfig represents the GPU sharing configuration for Hardware -// Accelerators. -message GPUSharingConfig { - // The type of GPU sharing strategy currently provided. - enum GPUSharingStrategy { - // Default value. - GPU_SHARING_STRATEGY_UNSPECIFIED = 0; - - // GPUs are time-shared between containers. - TIME_SHARING = 1; - } - - // The max number of containers that can share a physical GPU. - int64 max_shared_clients_per_gpu = 1; - - // The type of GPU sharing strategy to enable on the GPU node. - optional GPUSharingStrategy gpu_sharing_strategy = 2; -} - -// GPUDriverInstallationConfig specifies the version of GPU driver to be auto -// installed. -message GPUDriverInstallationConfig { - // The GPU driver version to install. - enum GPUDriverVersion { - // Default value is to not install any GPU driver. - GPU_DRIVER_VERSION_UNSPECIFIED = 0; - - // Disable GPU driver auto installation and needs manual installation - INSTALLATION_DISABLED = 1; - - // "Default" GPU driver in COS and Ubuntu. - DEFAULT = 2; - - // "Latest" GPU driver in COS. - LATEST = 3; - } - - // Mode for how the GPU driver is installed. - optional GPUDriverVersion gpu_driver_version = 1; -} - -// WorkloadMetadataConfig defines the metadata configuration to expose to -// workloads on the node pool. -message WorkloadMetadataConfig { - // Mode is the configuration for how to expose metadata to workloads running - // on the node. - enum Mode { - // Not set. - MODE_UNSPECIFIED = 0; - - // Expose all Compute Engine metadata to pods. - GCE_METADATA = 1; - - // Run the GKE Metadata Server on this node. The GKE Metadata Server exposes - // a metadata API to workloads that is compatible with the V1 Compute - // Metadata APIs exposed by the Compute Engine and App Engine Metadata - // Servers. This feature can only be enabled if Workload Identity is enabled - // at the cluster level. - GKE_METADATA = 2; - } - - // Mode is the configuration for how to expose metadata to workloads running - // on the node pool. - Mode mode = 2; -} - -// SetNetworkPolicyRequest enables/disables network policy for a cluster. -message SetNetworkPolicyRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Required. Configuration options for the NetworkPolicy feature. - NetworkPolicy network_policy = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster name) of the cluster to set networking - // policy. Specified in the format `projects/*/locations/*/clusters/*`. - string name = 6; -} - -// SetMaintenancePolicyRequest sets the maintenance policy for a cluster. -message SetMaintenancePolicyRequest { - // Required. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. - string zone = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the cluster to update. - string cluster_id = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. The maintenance policy to be set for the cluster. An empty field - // clears the existing maintenance policy. - MaintenancePolicy maintenance_policy = 4 - [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster name) of the cluster to set - // maintenance policy. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 5; -} - -// StatusCondition describes why a cluster or a node pool has a certain status -// (e.g., ERROR or DEGRADED). -message StatusCondition { - // Code for each condition - enum Code { - // UNKNOWN indicates a generic condition. - UNKNOWN = 0; - - // GCE_STOCKOUT indicates that Google Compute Engine resources are - // temporarily unavailable. - GCE_STOCKOUT = 1; - - // GKE_SERVICE_ACCOUNT_DELETED indicates that the user deleted their robot - // service account. - GKE_SERVICE_ACCOUNT_DELETED = 2; - - // Google Compute Engine quota was exceeded. - GCE_QUOTA_EXCEEDED = 3; - - // Cluster state was manually changed by an SRE due to a system logic error. - SET_BY_OPERATOR = 4; - - // Unable to perform an encrypt operation against the CloudKMS key used for - // etcd level encryption. - CLOUD_KMS_KEY_ERROR = 7; - - // Cluster CA is expiring soon. - CA_EXPIRING = 9; - } - - // Machine-friendly representation of the condition - // Deprecated. Use canonical_code instead. - Code code = 1 [deprecated = true]; - - // Human-friendly representation of the condition - string message = 2; - - // Canonical code of the condition. - google.rpc.Code canonical_code = 3; -} - -// NetworkConfig reports the relative names of network & subnetwork. -message NetworkConfig { - // Configuration of network bandwidth tiers - message ClusterNetworkPerformanceConfig { - // Node network tier - enum Tier { - // Default value - TIER_UNSPECIFIED = 0; - - // Higher bandwidth, actual values based on VM size. - TIER_1 = 1; - } - - // Specifies the total network bandwidth tier for NodePools in the cluster. - optional Tier total_egress_bandwidth_tier = 1; - } - - // Output only. The relative name of the Google Compute Engine - // [network][google.container.v1.NetworkConfig.network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) - // to which the cluster is connected. Example: - // projects/my-project/global/networks/my-network - string network = 1; - - // Output only. The relative name of the Google Compute Engine - // [subnetwork](https://cloud.google.com/compute/docs/vpc) to which the - // cluster is connected. Example: - // projects/my-project/regions/us-central1/subnetworks/my-subnet - string subnetwork = 2; - - // Whether Intra-node visibility is enabled for this cluster. - // This makes same node pod to pod traffic visible for VPC network. - bool enable_intra_node_visibility = 5; - - // Whether the cluster disables default in-node sNAT rules. In-node sNAT rules - // will be disabled when default_snat_status is disabled. When disabled is set - // to false, default IP masquerade rules will be applied to the nodes to - // prevent sNAT on cluster internal traffic. - DefaultSnatStatus default_snat_status = 7; - - // Whether L4ILB Subsetting is enabled for this cluster. - bool enable_l4ilb_subsetting = 10; - - // The desired datapath provider for this cluster. By default, uses the - // IPTables-based kube-proxy implementation. - DatapathProvider datapath_provider = 11; - - // The desired state of IPv6 connectivity to Google Services. - // By default, no private IPv6 access to or from Google Services (all access - // will be via IPv4) - PrivateIPv6GoogleAccess private_ipv6_google_access = 12; - - // DNSConfig contains clusterDNS config for this cluster. - DNSConfig dns_config = 13; - - // ServiceExternalIPsConfig specifies if services with externalIPs field are - // blocked or not. - ServiceExternalIPsConfig service_external_ips_config = 15; - - // GatewayAPIConfig contains the desired config of Gateway API on this - // cluster. - GatewayAPIConfig gateway_api_config = 16; - - // Network bandwidth tier configuration. - ClusterNetworkPerformanceConfig network_performance_config = 18; - - // Whether FQDN Network Policy is enabled on this cluster. - optional bool enable_fqdn_network_policy = 19; -} - -// GatewayAPIConfig contains the desired config of Gateway API on this cluster. -message GatewayAPIConfig { - // Channel describes if/how Gateway API should be installed and implemented in - // a cluster. - enum Channel { - // Default value. - CHANNEL_UNSPECIFIED = 0; - - // Gateway API support is disabled - CHANNEL_DISABLED = 1; - - // Gateway API support is enabled, experimental CRDs are installed - CHANNEL_EXPERIMENTAL = 3; - - // Gateway API support is enabled, standard CRDs are installed - CHANNEL_STANDARD = 4; - } - - // The Gateway API release channel to use for Gateway API. - Channel channel = 1; -} - -// Config to block services with externalIPs field. -message ServiceExternalIPsConfig { - // Whether Services with ExternalIPs field are allowed or not. - bool enabled = 1; -} - -// GetOpenIDConfigRequest gets the OIDC discovery document for the -// cluster. See the OpenID Connect Discovery 1.0 specification for details. -message GetOpenIDConfigRequest { - // The cluster (project, location, cluster name) to get the discovery document - // for. Specified in the format `projects/*/locations/*/clusters/*`. - string parent = 1; -} - -// GetOpenIDConfigResponse is an OIDC discovery document for the cluster. -// See the OpenID Connect Discovery 1.0 specification for details. -message GetOpenIDConfigResponse { - // OIDC Issuer. - string issuer = 1; - - // JSON Web Key uri. - string jwks_uri = 2; - - // Supported response types. - repeated string response_types_supported = 3; - - // Supported subject types. - repeated string subject_types_supported = 4; - - // supported ID Token signing Algorithms. - repeated string id_token_signing_alg_values_supported = 5; - - // Supported claims. - repeated string claims_supported = 6; - - // Supported grant types. - repeated string grant_types = 7; -} - -// GetJSONWebKeysRequest gets the public component of the keys used by the -// cluster to sign token requests. This will be the jwks_uri for the discover -// document returned by getOpenIDConfig. See the OpenID Connect -// Discovery 1.0 specification for details. -message GetJSONWebKeysRequest { - // The cluster (project, location, cluster name) to get keys for. Specified in - // the format `projects/*/locations/*/clusters/*`. - string parent = 1; -} - -// Jwk is a JSON Web Key as specified in RFC 7517 -message Jwk { - // Key Type. - string kty = 1; - - // Algorithm. - string alg = 2; - - // Permitted uses for the public keys. - string use = 3; - - // Key ID. - string kid = 4; - - // Used for RSA keys. - string n = 5; - - // Used for RSA keys. - string e = 6; - - // Used for ECDSA keys. - string x = 7; - - // Used for ECDSA keys. - string y = 8; - - // Used for ECDSA keys. - string crv = 9; -} - -// GetJSONWebKeysResponse is a valid JSON Web Key Set as specififed in rfc 7517 -message GetJSONWebKeysResponse { - // The public component of the keys used by the cluster to sign token - // requests. - repeated Jwk keys = 1; -} - -// CheckAutopilotCompatibilityRequest requests getting the blockers for the -// given operation in the cluster. -message CheckAutopilotCompatibilityRequest { - // The name (project, location, cluster) of the cluster to retrieve. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 1; -} - -// AutopilotCompatibilityIssue contains information about a specific -// compatibility issue with Autopilot mode. -message AutopilotCompatibilityIssue { - // The type of the reported issue. - enum IssueType { - // Default value, should not be used. - UNSPECIFIED = 0; - - // Indicates that the issue is a known incompatibility between the - // cluster and Autopilot mode. - INCOMPATIBILITY = 1; - - // Indicates the issue is an incompatibility if customers take no further - // action to resolve. - ADDITIONAL_CONFIG_REQUIRED = 2; - - // Indicates the issue is not an incompatibility, but depending on the - // workloads business logic, there is a potential that they won't work on - // Autopilot. - PASSED_WITH_OPTIONAL_CONFIG = 3; - } - - // The last time when this issue was observed. - google.protobuf.Timestamp last_observation = 1; - - // The constraint type of the issue. - string constraint_type = 2; - - // The incompatibility type of this issue. - IssueType incompatibility_type = 3; - - // The name of the resources which are subject to this issue. - repeated string subjects = 4; - - // A URL to a public documnetation, which addresses resolving this issue. - string documentation_url = 5; - - // The description of the issue. - string description = 6; -} - -// CheckAutopilotCompatibilityResponse has a list of compatibility issues. -message CheckAutopilotCompatibilityResponse { - // The list of issues for the given operation. - repeated AutopilotCompatibilityIssue issues = 1; - - // The summary of the autopilot compatibility response. - string summary = 2; -} - -// ReleaseChannel indicates which release channel a cluster is -// subscribed to. Release channels are arranged in order of risk. -// -// When a cluster is subscribed to a release channel, Google maintains -// both the master version and the node version. Node auto-upgrade -// defaults to true and cannot be disabled. -message ReleaseChannel { - // Possible values for 'channel'. - enum Channel { - // No channel specified. - UNSPECIFIED = 0; - - // RAPID channel is offered on an early access basis for customers who want - // to test new releases. - // - // WARNING: Versions available in the RAPID Channel may be subject to - // unresolved issues with no known workaround and are not subject to any - // SLAs. - RAPID = 1; - - // Clusters subscribed to REGULAR receive versions that are considered GA - // quality. REGULAR is intended for production users who want to take - // advantage of new features. - REGULAR = 2; - - // Clusters subscribed to STABLE receive versions that are known to be - // stable and reliable in production. - STABLE = 3; - } - - // channel specifies which release channel the cluster is subscribed to. - Channel channel = 1; -} - -// Configuration for fine-grained cost management feature. -message CostManagementConfig { - // Whether the feature is enabled or not. - bool enabled = 1; -} - -// IntraNodeVisibilityConfig contains the desired config of the intra-node -// visibility on this cluster. -message IntraNodeVisibilityConfig { - // Enables intra node visibility for this cluster. - bool enabled = 1; -} - -// ILBSubsettingConfig contains the desired config of L4 Internal LoadBalancer -// subsetting on this cluster. -message ILBSubsettingConfig { - // Enables l4 ILB subsetting for this cluster. - bool enabled = 1; -} - -// DNSConfig contains the desired set of options for configuring clusterDNS. -message DNSConfig { - // Provider lists the various in-cluster DNS providers. - enum Provider { - // Default value - PROVIDER_UNSPECIFIED = 0; - - // Use GKE default DNS provider(kube-dns) for DNS resolution. - PLATFORM_DEFAULT = 1; - - // Use CloudDNS for DNS resolution. - CLOUD_DNS = 2; - - // Use KubeDNS for DNS resolution - KUBE_DNS = 3; - } - - // DNSScope lists the various scopes of access to cluster DNS records. - enum DNSScope { - // Default value, will be inferred as cluster scope. - DNS_SCOPE_UNSPECIFIED = 0; - - // DNS records are accessible from within the cluster. - CLUSTER_SCOPE = 1; - - // DNS records are accessible from within the VPC. - VPC_SCOPE = 2; - } - - // cluster_dns indicates which in-cluster DNS provider should be used. - Provider cluster_dns = 1; - - // cluster_dns_scope indicates the scope of access to cluster DNS records. - DNSScope cluster_dns_scope = 2; - - // cluster_dns_domain is the suffix used for all cluster service records. - string cluster_dns_domain = 3; -} - -// Constraints applied to pods. -message MaxPodsConstraint { - // Constraint enforced on the max num of pods per node. - int64 max_pods_per_node = 1; -} - -// Configuration for the use of Kubernetes Service Accounts in GCP IAM -// policies. -message WorkloadIdentityConfig { - // The workload pool to attach all Kubernetes service accounts to. - string workload_pool = 2; -} - -// IdentityServiceConfig is configuration for Identity Service which allows -// customers to use external identity providers with the K8S API -message IdentityServiceConfig { - // Whether to enable the Identity Service component - bool enabled = 1; -} - -// Configuration for issuance of mTLS keys and certificates to Kubernetes pods. -message MeshCertificates { - // enable_certificates controls issuance of workload mTLS certificates. - // - // If set, the GKE Workload Identity Certificates controller and node agent - // will be deployed in the cluster, which can then be configured by creating a - // WorkloadCertificateConfig Custom Resource. - // - // Requires Workload Identity - // ([workload_pool][google.container.v1.WorkloadIdentityConfig.workload_pool] - // must be non-empty). - google.protobuf.BoolValue enable_certificates = 1; -} - -// Configuration of etcd encryption. -message DatabaseEncryption { - // State of etcd encryption. - enum State { - // Should never be set - UNKNOWN = 0; - - // Secrets in etcd are encrypted. - ENCRYPTED = 1; - - // Secrets in etcd are stored in plain text (at etcd level) - this is - // unrelated to Compute Engine level full disk encryption. - DECRYPTED = 2; - } - - // 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 - string key_name = 1; - - // The desired state of etcd encryption. - State state = 2; -} - -// ListUsableSubnetworksRequest requests the list of usable subnetworks -// available to a user for creating clusters. -message ListUsableSubnetworksRequest { - // The parent project where subnetworks are usable. - // Specified in the format `projects/*`. - string parent = 1; - - // 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. - string filter = 2; - - // 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) - int32 page_size = 3; - - // Specifies a page token to use. Set this to the nextPageToken returned by - // previous list requests to get the next page of results. - string page_token = 4; -} - -// ListUsableSubnetworksResponse is the response of -// ListUsableSubnetworksRequest. -message ListUsableSubnetworksResponse { - // A list of usable subnetworks in the specified network project. - repeated UsableSubnetwork subnetworks = 1; - - // 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. - string next_page_token = 2; -} - -// Secondary IP range of a usable subnetwork. -message UsableSubnetworkSecondaryRange { - // Status shows the current usage of a secondary IP range. - enum Status { - // UNKNOWN is the zero value of the Status enum. It's not a valid status. - UNKNOWN = 0; - - // UNUSED denotes that this range is unclaimed by any cluster. - UNUSED = 1; - - // IN_USE_SERVICE denotes that this range is claimed by cluster(s) for - // services. User-managed services range can be shared between clusters - // within the same subnetwork. - IN_USE_SERVICE = 2; - - // 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_SHAREABLE_POD = 3; - - // IN_USE_MANAGED_POD denotes this range was created by GKE and is claimed - // for pods. It cannot be used for other clusters. - IN_USE_MANAGED_POD = 4; - } - - // The name associated with this subnetwork secondary range, used when adding - // an alias IP range to a VM instance. - string range_name = 1; - - // The range of IP addresses belonging to this subnetwork secondary range. - string ip_cidr_range = 2; - - // This field is to determine the status of the secondary range programmably. - Status status = 3; -} - -// UsableSubnetwork resource returns the subnetwork name, its associated network -// and the primary CIDR range. -message UsableSubnetwork { - // Subnetwork Name. - // Example: projects/my-project/regions/us-central1/subnetworks/my-subnet - string subnetwork = 1; - - // Network Name. - // Example: projects/my-project/global/networks/my-network - string network = 2; - - // The range of internal addresses that are owned by this subnetwork. - string ip_cidr_range = 3; - - // Secondary IP ranges. - repeated UsableSubnetworkSecondaryRange secondary_ip_ranges = 4; - - // 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. - string status_message = 5; -} - -// Configuration for exporting cluster resource usages. -message ResourceUsageExportConfig { - // Parameters for using BigQuery as the destination of resource usage export. - message BigQueryDestination { - // The ID of a BigQuery Dataset. - string dataset_id = 1; - } - - // Parameters for controlling consumption metering. - message ConsumptionMeteringConfig { - // Whether to enable consumption metering for this cluster. If enabled, a - // second BigQuery table will be created to hold resource consumption - // records. - bool enabled = 1; - } - - // Configuration to use BigQuery as usage export destination. - BigQueryDestination bigquery_destination = 1; - - // Whether to enable network egress metering for this cluster. If enabled, a - // daemonset will be created in the cluster to meter network egress traffic. - bool enable_network_egress_metering = 2; - - // Configuration to enable resource consumption metering. - ConsumptionMeteringConfig consumption_metering_config = 3; -} - -// VerticalPodAutoscaling contains global, per-cluster information -// required by Vertical Pod Autoscaler to automatically adjust -// the resources of pods controlled by it. -message VerticalPodAutoscaling { - // Enables vertical pod autoscaling. - bool enabled = 1; -} - -// DefaultSnatStatus contains the desired state of whether default sNAT should -// be disabled on the cluster. -message DefaultSnatStatus { - // Disables cluster default sNAT rules. - bool disabled = 1; -} - -// Configuration of Shielded Nodes feature. -message ShieldedNodes { - // Whether Shielded Nodes features are enabled on all nodes in this cluster. - bool enabled = 1; -} - -// Configuration of gVNIC feature. -message VirtualNIC { - // Whether gVNIC features are enabled in the node pool. - bool enabled = 1; -} - -// Configuration of Fast Socket feature. -message FastSocket { - // Whether Fast Socket features are enabled in the node pool. - bool enabled = 1; -} - -// PrivateIPv6GoogleAccess controls whether and how the pods can communicate -// with Google Services through gRPC over IPv6. -enum PrivateIPv6GoogleAccess { - // Default value. Same as DISABLED - PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0; - - // No private access to or from Google Services - PRIVATE_IPV6_GOOGLE_ACCESS_DISABLED = 1; - - // Enables private IPv6 access to Google Services from GKE - PRIVATE_IPV6_GOOGLE_ACCESS_TO_GOOGLE = 2; - - // Enables private IPv6 access to and from Google Services - PRIVATE_IPV6_GOOGLE_ACCESS_BIDIRECTIONAL = 3; -} - -// NotificationConfig is the configuration of notifications. -message NotificationConfig { - // Types of notifications currently supported. Can be used to filter what - // notifications are sent. - enum EventType { - // Not set, will be ignored. - EVENT_TYPE_UNSPECIFIED = 0; - - // Corresponds with UpgradeAvailableEvent. - UPGRADE_AVAILABLE_EVENT = 1; - - // Corresponds with UpgradeEvent. - UPGRADE_EVENT = 2; - - // Corresponds with SecurityBulletinEvent. - SECURITY_BULLETIN_EVENT = 3; - } - - // Pub/Sub specific notification config. - message PubSub { - // Enable notifications for Pub/Sub. - bool enabled = 1; - - // The desired Pub/Sub topic to which notifications will be - // sent by GKE. Format is `projects/{project}/topics/{topic}`. - string topic = 2 [ - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } - ]; - - // Allows filtering to one or more specific event types. If no filter is - // specified, or if a filter is specified with no event types, all event - // types will be sent - Filter filter = 3; - } - - // Allows filtering to one or more specific event types. If event types are - // present, those and only those event types will be transmitted to the - // cluster. Other types will be skipped. If no filter is specified, or no - // event types are present, all event types will be sent - message Filter { - // Event types to allowlist. - repeated EventType event_type = 1; - } - - // Notification config for Pub/Sub. - PubSub pubsub = 1; -} - -// ConfidentialNodes is configuration for the confidential nodes feature, which -// makes nodes run on confidential VMs. -message ConfidentialNodes { - // Whether Confidential Nodes feature is enabled. - bool enabled = 1; -} - -// UpgradeResourceType is the resource type that is upgrading. It is used -// in upgrade notifications. -enum UpgradeResourceType { - // Default value. This shouldn't be used. - UPGRADE_RESOURCE_TYPE_UNSPECIFIED = 0; - - // Master / control plane - MASTER = 1; - - // Node pool - NODE_POOL = 2; -} - -// UpgradeEvent is a notification sent to customers by the cluster server when -// a resource is upgrading. -message UpgradeEvent { - // The resource type that is upgrading. - UpgradeResourceType resource_type = 1; - - // The operation associated with this upgrade. - string operation = 2; - - // The time when the operation was started. - google.protobuf.Timestamp operation_start_time = 3; - - // The current version before the upgrade. - string current_version = 4; - - // The target version for the upgrade. - string target_version = 5; - - // Optional relative path to the resource. For example in node pool upgrades, - // the relative path of the node pool. - string resource = 6; -} - -// UpgradeAvailableEvent is a notification sent to customers when a new -// available version is released. -message UpgradeAvailableEvent { - // The release version available for upgrade. - string version = 1; - - // The resource type of the release version. - UpgradeResourceType resource_type = 2; - - // The release channel of the version. If empty, it means a non-channel - // release. - ReleaseChannel release_channel = 3; - - // Optional relative path to the resource. For example, the relative path of - // the node pool. - string resource = 4; -} - -// SecurityBulletinEvent is a notification sent to customers when a security -// bulletin has been posted that they are vulnerable to. -message SecurityBulletinEvent { - // The resource type (node/control plane) that has the vulnerability. Multiple - // notifications (1 notification per resource type) will be sent for a - // vulnerability that affects > 1 resource type. - string resource_type_affected = 1; - - // The ID of the bulletin corresponding to the vulnerability. - string bulletin_id = 2; - - // The CVEs associated with this bulletin. - repeated string cve_ids = 3; - - // The severity of this bulletin as it relates to GKE. - string severity = 4; - - // The URI link to the bulletin on the website for more information. - string bulletin_uri = 5; - - // A brief description of the bulletin. See the bulletin pointed to by the - // bulletin_uri field for an expanded description. - string brief_description = 6; - - // The GKE minor versions affected by this vulnerability. - repeated string affected_supported_minors = 7; - - // The GKE versions where this vulnerability is patched. - repeated string patched_versions = 8; - - // This represents a version selected from the patched_versions field that - // the cluster receiving this notification should most likely want to upgrade - // to based on its current version. Note that if this notification is being - // received by a given cluster, it means that this version is currently - // available as an upgrade target in that cluster's location. - string suggested_upgrade_target = 9; - - // If this field is specified, it means there are manual steps that the user - // must take to make their clusters safe. - bool manual_steps_required = 10; -} - -// Autopilot is the configuration for Autopilot settings on the cluster. -message Autopilot { - // Enable Autopilot - bool enabled = 1; - - // Workload policy configuration for Autopilot. - WorkloadPolicyConfig workload_policy_config = 2; -} - -// WorkloadPolicyConfig is the configuration of workload policy for autopilot -// clusters. -message WorkloadPolicyConfig { - // If true, workloads can use NET_ADMIN capability. - optional bool allow_net_admin = 1; -} - -// LoggingConfig is cluster logging configuration. -message LoggingConfig { - // Logging components configuration - LoggingComponentConfig component_config = 1; -} - -// LoggingComponentConfig is cluster logging component configuration. -message LoggingComponentConfig { - // GKE components exposing logs - enum Component { - // Default value. This shouldn't be used. - COMPONENT_UNSPECIFIED = 0; - - // system components - SYSTEM_COMPONENTS = 1; - - // workloads - WORKLOADS = 2; - - // kube-apiserver - APISERVER = 3; - - // kube-scheduler - SCHEDULER = 4; - - // kube-controller-manager - CONTROLLER_MANAGER = 5; - } - - // Select components to collect logs. An empty set would disable all logging. - repeated Component enable_components = 1; -} - -// MonitoringConfig is cluster monitoring configuration. -message MonitoringConfig { - // Monitoring components configuration - MonitoringComponentConfig component_config = 1; - - // Enable Google Cloud Managed Service for Prometheus - // in the cluster. - ManagedPrometheusConfig managed_prometheus_config = 2; -} - -// NodePoolLoggingConfig specifies logging configuration for nodepools. -message NodePoolLoggingConfig { - // Logging variant configuration. - LoggingVariantConfig variant_config = 1; -} - -// LoggingVariantConfig specifies the behaviour of the logging component. -message LoggingVariantConfig { - // Logging component variants. - enum Variant { - // Default value. This shouldn't be used. - VARIANT_UNSPECIFIED = 0; - - // default logging variant. - DEFAULT = 1; - - // maximum logging throughput variant. - MAX_THROUGHPUT = 2; - } - - // Logging variant deployed on nodes. - Variant variant = 1; -} - -// MonitoringComponentConfig is cluster monitoring component configuration. -message MonitoringComponentConfig { - // GKE components exposing metrics - enum Component { - // Default value. This shouldn't be used. - COMPONENT_UNSPECIFIED = 0; - - // system components - SYSTEM_COMPONENTS = 1; - - // kube-apiserver - APISERVER = 3; - - // kube-scheduler - SCHEDULER = 4; - - // kube-controller-manager - CONTROLLER_MANAGER = 5; - } - - // Select components to collect metrics. An empty set would disable all - // monitoring. - repeated Component enable_components = 1; -} - -// The datapath provider selects the implementation of the Kubernetes networking -// model for service resolution and network policy enforcement. -enum DatapathProvider { - // Default value. - DATAPATH_PROVIDER_UNSPECIFIED = 0; - - // Use the IPTables implementation based on kube-proxy. - LEGACY_DATAPATH = 1; - - // Use the eBPF based GKE Dataplane V2 with additional features. See the [GKE - // Dataplane V2 - // documentation](https://cloud.google.com/kubernetes-engine/docs/how-to/dataplane-v2) - // for more. - ADVANCED_DATAPATH = 2; -} - -// Strategy used for node pool update. -enum NodePoolUpdateStrategy { - // Default value if unset. GKE internally defaults the update strategy to - // SURGE for unspecified strategies. - NODE_POOL_UPDATE_STRATEGY_UNSPECIFIED = 0; - - // blue-green upgrade. - BLUE_GREEN = 2; - - // SURGE is the traditional way of upgrade a node pool. - // max_surge and max_unavailable determines the level of upgrade parallelism. - SURGE = 3; -} - -// ManagedPrometheusConfig defines the configuration for -// Google Cloud Managed Service for Prometheus. -message ManagedPrometheusConfig { - // Enable Managed Collection. - bool enabled = 1; -} - -// Fleet is the fleet configuration for the cluster. -message Fleet { - // The Fleet host project(project ID or project number) where this cluster - // will be registered to. This field cannot be changed after the cluster has - // been registered. - string project = 1; - - // [Output only] The full resource name of the registered fleet membership of - // the cluster, in the format - // `//gkehub.googleapis.com/projects/*/locations/*/memberships/*`. - string membership = 2; - - // [Output only] Whether the cluster has been registered through the fleet - // API. - bool pre_registered = 3; -} - -// Possible values for IP stack type -enum StackType { - // Default value, will be defaulted as IPV4 only - STACK_TYPE_UNSPECIFIED = 0; - - // Cluster is IPV4 only - IPV4 = 1; - - // Cluster can use both IPv4 and IPv6 - IPV4_IPV6 = 2; -} - -// Possible values for IPv6 access type -enum IPv6AccessType { - // Default value, will be defaulted as type external. - IPV6_ACCESS_TYPE_UNSPECIFIED = 0; - - // Access type internal (all v6 addresses are internal IPs) - INTERNAL = 1; - - // Access type external (all v6 addresses are external IPs) - EXTERNAL = 2; -} - -// LocalNvmeSsdBlockConfig contains configuration for using raw-block local -// NVMe SSD. -message LocalNvmeSsdBlockConfig { - // The number of raw-block local NVMe SSD disks to be attached to the node. - // Each local SSD is 375 GB in size. If zero, it means no raw-block local NVMe - // 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. - int32 local_ssd_count = 1; -} - -// EphemeralStorageLocalSsdConfig contains configuration for the node ephemeral -// storage using Local SSD. -message EphemeralStorageLocalSsdConfig { - // Number of local SSDs to use to back ephemeral storage. Uses NVMe - // interfaces. Each local SSD is 375 GB in size. - // If zero, it means to disable using local SSDs as ephemeral storage. - // 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. - int32 local_ssd_count = 1; -} diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.cancel_operation.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.cancel_operation.js deleted file mode 100644 index e556c2aaf76..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.cancel_operation.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_CancelOperation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, operation id) of the operation to cancel. - * Specified in the format `projects/* /locations/* /operations/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callCancelOperation() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.cancelOperation(request); - console.log(response); - } - - callCancelOperation(); - // [END container_v1_generated_ClusterManager_CancelOperation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js deleted file mode 100644 index e4d731fc2d0..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_CheckAutopilotCompatibility_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster) of the cluster to retrieve. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callCheckAutopilotCompatibility() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.checkAutopilotCompatibility(request); - console.log(response); - } - - callCheckAutopilotCompatibility(); - // [END container_v1_generated_ClusterManager_CheckAutopilotCompatibility_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_i_p_rotation.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_i_p_rotation.js deleted file mode 100644 index 82b71531860..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_i_p_rotation.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_CompleteIPRotation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster name) of the cluster to complete IP - * rotation. Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callCompleteIPRotation() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.completeIPRotation(request); - console.log(response); - } - - callCompleteIPRotation(); - // [END container_v1_generated_ClusterManager_CompleteIPRotation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js deleted file mode 100644 index 8cf74642faf..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_CompleteNodePoolUpgrade_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster, node pool id) of the node pool to - * complete upgrade. - * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callCompleteNodePoolUpgrade() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.completeNodePoolUpgrade(request); - console.log(response); - } - - callCompleteNodePoolUpgrade(); - // [END container_v1_generated_ClusterManager_CompleteNodePoolUpgrade_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_cluster.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_cluster.js deleted file mode 100644 index bc132fbb109..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_cluster.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(cluster) { - // [START container_v1_generated_ClusterManager_CreateCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. A cluster - * resource (https://cloud.google.com/container-engine/reference/rest/v1/projects.locations.clusters) - */ - // const cluster = {} - /** - * The parent (project and location) where the cluster will be created. - * Specified in the format `projects/* /locations/*`. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callCreateCluster() { - // Construct request - const request = { - cluster, - }; - - // Run request - const response = await containerClient.createCluster(request); - console.log(response); - } - - callCreateCluster(); - // [END container_v1_generated_ClusterManager_CreateCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_node_pool.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_node_pool.js deleted file mode 100644 index c2526e72425..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_node_pool.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(nodePool) { - // [START container_v1_generated_ClusterManager_CreateNodePool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The node pool to create. - */ - // const nodePool = {} - /** - * The parent (project, location, cluster name) where the node pool will be - * created. Specified in the format - * `projects/* /locations/* /clusters/*`. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callCreateNodePool() { - // Construct request - const request = { - nodePool, - }; - - // Run request - const response = await containerClient.createNodePool(request); - console.log(response); - } - - callCreateNodePool(); - // [END container_v1_generated_ClusterManager_CreateNodePool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_cluster.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_cluster.js deleted file mode 100644 index b7f789d7b80..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_cluster.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_DeleteCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster) of the cluster to delete. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callDeleteCluster() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.deleteCluster(request); - console.log(response); - } - - callDeleteCluster(); - // [END container_v1_generated_ClusterManager_DeleteCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_node_pool.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_node_pool.js deleted file mode 100644 index 1d286e9963b..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_node_pool.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_DeleteNodePool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster, node pool id) of the node pool to - * delete. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callDeleteNodePool() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.deleteNodePool(request); - console.log(response); - } - - callDeleteNodePool(); - // [END container_v1_generated_ClusterManager_DeleteNodePool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_cluster.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_cluster.js deleted file mode 100644 index 565479929b5..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_cluster.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_GetCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster) of the cluster to retrieve. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callGetCluster() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.getCluster(request); - console.log(response); - } - - callGetCluster(); - // [END container_v1_generated_ClusterManager_GetCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_j_s_o_n_web_keys.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_j_s_o_n_web_keys.js deleted file mode 100644 index ce76d378ce1..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_j_s_o_n_web_keys.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_GetJSONWebKeys_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The cluster (project, location, cluster name) to get keys for. Specified in - * the format `projects/* /locations/* /clusters/*`. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callGetJSONWebKeys() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.getJSONWebKeys(request); - console.log(response); - } - - callGetJSONWebKeys(); - // [END container_v1_generated_ClusterManager_GetJSONWebKeys_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_node_pool.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_node_pool.js deleted file mode 100644 index fb3301234b1..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_node_pool.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_GetNodePool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster, node pool id) of the node pool to - * get. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callGetNodePool() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.getNodePool(request); - console.log(response); - } - - callGetNodePool(); - // [END container_v1_generated_ClusterManager_GetNodePool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_operation.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_operation.js deleted file mode 100644 index 58a774ae645..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_operation.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_GetOperation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, operation id) of the operation to get. - * Specified in the format `projects/* /locations/* /operations/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callGetOperation() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.getOperation(request); - console.log(response); - } - - callGetOperation(); - // [END container_v1_generated_ClusterManager_GetOperation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_server_config.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_server_config.js deleted file mode 100644 index 6a1e2ef0e69..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_server_config.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_GetServerConfig_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project and location) of the server config to get, - * specified in the format `projects/* /locations/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callGetServerConfig() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.getServerConfig(request); - console.log(response); - } - - callGetServerConfig(); - // [END container_v1_generated_ClusterManager_GetServerConfig_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_clusters.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_clusters.js deleted file mode 100644 index fb7dbc835b2..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_clusters.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_ListClusters_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The parent (project and location) where the clusters will be listed. - * Specified in the format `projects/* /locations/*`. - * Location "-" matches all zones and all regions. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callListClusters() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.listClusters(request); - console.log(response); - } - - callListClusters(); - // [END container_v1_generated_ClusterManager_ListClusters_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_node_pools.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_node_pools.js deleted file mode 100644 index fa48c06009a..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_node_pools.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_ListNodePools_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The parent (project, location, cluster name) where the node pools will be - * listed. Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callListNodePools() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.listNodePools(request); - console.log(response); - } - - callListNodePools(); - // [END container_v1_generated_ClusterManager_ListNodePools_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_operations.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_operations.js deleted file mode 100644 index 69eb1730393..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_operations.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_ListOperations_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The parent (project and location) where the operations will be listed. - * Specified in the format `projects/* /locations/*`. - * Location "-" matches all zones and all regions. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callListOperations() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.listOperations(request); - console.log(response); - } - - callListOperations(); - // [END container_v1_generated_ClusterManager_ListOperations_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_usable_subnetworks.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_usable_subnetworks.js deleted file mode 100644 index a70af157bf3..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_usable_subnetworks.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_ListUsableSubnetworks_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The parent project where subnetworks are usable. - * Specified in the format `projects/*`. - */ - // const parent = 'abc123' - /** - * 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. - */ - // const filter = 'abc123' - /** - * 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) - */ - // const pageSize = 1234 - /** - * Specifies a page token to use. Set this to the nextPageToken returned by - * previous list requests to get the next page of results. - */ - // const pageToken = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callListUsableSubnetworks() { - // Construct request - const request = { - }; - - // Run request - const iterable = await containerClient.listUsableSubnetworksAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListUsableSubnetworks(); - // [END container_v1_generated_ClusterManager_ListUsableSubnetworks_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.rollback_node_pool_upgrade.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.rollback_node_pool_upgrade.js deleted file mode 100644 index 3356c397660..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.rollback_node_pool_upgrade.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_RollbackNodePoolUpgrade_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster, node pool id) of the node poll to - * rollback upgrade. - * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - /** - * Option for rollback to ignore the PodDisruptionBudget. - * Default value is false. - */ - // const respectPdb = true - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callRollbackNodePoolUpgrade() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.rollbackNodePoolUpgrade(request); - console.log(response); - } - - callRollbackNodePoolUpgrade(); - // [END container_v1_generated_ClusterManager_RollbackNodePoolUpgrade_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_addons_config.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_addons_config.js deleted file mode 100644 index c6e24e63456..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_addons_config.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(addonsConfig) { - // [START container_v1_generated_ClusterManager_SetAddonsConfig_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The desired configurations for the various addons available to - * run in the cluster. - */ - // const addonsConfig = {} - /** - * The name (project, location, cluster) of the cluster to set addons. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetAddonsConfig() { - // Construct request - const request = { - addonsConfig, - }; - - // Run request - const response = await containerClient.setAddonsConfig(request); - console.log(response); - } - - callSetAddonsConfig(); - // [END container_v1_generated_ClusterManager_SetAddonsConfig_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_labels.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_labels.js deleted file mode 100644 index dd281c82cc6..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_labels.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resourceLabels, labelFingerprint) { - // [START container_v1_generated_ClusterManager_SetLabels_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The labels to set for that cluster. - */ - // const resourceLabels = 1234 - /** - * 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. - */ - // const labelFingerprint = 'abc123' - /** - * The name (project, location, cluster name) of the cluster to set labels. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetLabels() { - // Construct request - const request = { - resourceLabels, - labelFingerprint, - }; - - // Run request - const response = await containerClient.setLabels(request); - console.log(response); - } - - callSetLabels(); - // [END container_v1_generated_ClusterManager_SetLabels_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_legacy_abac.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_legacy_abac.js deleted file mode 100644 index 9c2a450c361..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_legacy_abac.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(enabled) { - // [START container_v1_generated_ClusterManager_SetLegacyAbac_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Whether ABAC authorization will be enabled in the cluster. - */ - // const enabled = true - /** - * The name (project, location, cluster name) of the cluster to set legacy - * abac. Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetLegacyAbac() { - // Construct request - const request = { - enabled, - }; - - // Run request - const response = await containerClient.setLegacyAbac(request); - console.log(response); - } - - callSetLegacyAbac(); - // [END container_v1_generated_ClusterManager_SetLegacyAbac_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_locations.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_locations.js deleted file mode 100644 index a5f7a5f0349..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_locations.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(locations) { - // [START container_v1_generated_ClusterManager_SetLocations_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The desired list of Google Compute Engine - * zones (https://cloud.google.com/compute/docs/zones#available) 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. - */ - // const locations = 'abc123' - /** - * The name (project, location, cluster) of the cluster to set locations. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetLocations() { - // Construct request - const request = { - locations, - }; - - // Run request - const response = await containerClient.setLocations(request); - console.log(response); - } - - callSetLocations(); - // [END container_v1_generated_ClusterManager_SetLocations_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_logging_service.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_logging_service.js deleted file mode 100644 index 3333d0219c5..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_logging_service.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(loggingService) { - // [START container_v1_generated_ClusterManager_SetLoggingService_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The logging service the cluster should use to write logs. - * Currently available options: - * * `logging.googleapis.com/kubernetes` - The Cloud Logging - * service with a Kubernetes-native resource model - * * `logging.googleapis.com` - The legacy Cloud Logging service (no longer - * available as of GKE 1.15). - * * `none` - no logs will be exported from the cluster. - * If left as an empty string,`logging.googleapis.com/kubernetes` will be - * used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. - */ - // const loggingService = 'abc123' - /** - * The name (project, location, cluster) of the cluster to set logging. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetLoggingService() { - // Construct request - const request = { - loggingService, - }; - - // Run request - const response = await containerClient.setLoggingService(request); - console.log(response); - } - - callSetLoggingService(); - // [END container_v1_generated_ClusterManager_SetLoggingService_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_maintenance_policy.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_maintenance_policy.js deleted file mode 100644 index 4e675414de2..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_maintenance_policy.js +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, maintenancePolicy) { - // [START container_v1_generated_ClusterManager_SetMaintenancePolicy_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The Google Developers Console project ID or project - * number (https://cloud.google.com/resource-manager/docs/creating-managing-projects). - */ - // const projectId = 'abc123' - /** - * Required. The name of the Google Compute Engine - * zone (https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. - */ - // const zone = 'abc123' - /** - * Required. The name of the cluster to update. - */ - // const clusterId = 'abc123' - /** - * Required. The maintenance policy to be set for the cluster. An empty field - * clears the existing maintenance policy. - */ - // const maintenancePolicy = {} - /** - * The name (project, location, cluster name) of the cluster to set - * maintenance policy. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetMaintenancePolicy() { - // Construct request - const request = { - projectId, - zone, - clusterId, - maintenancePolicy, - }; - - // Run request - const response = await containerClient.setMaintenancePolicy(request); - console.log(response); - } - - callSetMaintenancePolicy(); - // [END container_v1_generated_ClusterManager_SetMaintenancePolicy_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_master_auth.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_master_auth.js deleted file mode 100644 index 4376ebb1adc..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_master_auth.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(action, update) { - // [START container_v1_generated_ClusterManager_SetMasterAuth_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The exact form of action to be taken on the master auth. - */ - // const action = {} - /** - * Required. A description of the update. - */ - // const update = {} - /** - * The name (project, location, cluster) of the cluster to set auth. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetMasterAuth() { - // Construct request - const request = { - action, - update, - }; - - // Run request - const response = await containerClient.setMasterAuth(request); - console.log(response); - } - - callSetMasterAuth(); - // [END container_v1_generated_ClusterManager_SetMasterAuth_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_monitoring_service.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_monitoring_service.js deleted file mode 100644 index 5767da6da8f..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_monitoring_service.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(monitoringService) { - // [START container_v1_generated_ClusterManager_SetMonitoringService_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The monitoring service the cluster should use to write metrics. - * Currently available options: - * * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring - * service with a Kubernetes-native resource model - * * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no - * longer available as of GKE 1.15). - * * `none` - No metrics will be exported from the cluster. - * If left as an empty string,`monitoring.googleapis.com/kubernetes` will be - * used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. - */ - // const monitoringService = 'abc123' - /** - * The name (project, location, cluster) of the cluster to set monitoring. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetMonitoringService() { - // Construct request - const request = { - monitoringService, - }; - - // Run request - const response = await containerClient.setMonitoringService(request); - console.log(response); - } - - callSetMonitoringService(); - // [END container_v1_generated_ClusterManager_SetMonitoringService_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_network_policy.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_network_policy.js deleted file mode 100644 index 70e4a954cd3..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_network_policy.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(networkPolicy) { - // [START container_v1_generated_ClusterManager_SetNetworkPolicy_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Configuration options for the NetworkPolicy feature. - */ - // const networkPolicy = {} - /** - * The name (project, location, cluster name) of the cluster to set networking - * policy. Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetNetworkPolicy() { - // Construct request - const request = { - networkPolicy, - }; - - // Run request - const response = await containerClient.setNetworkPolicy(request); - console.log(response); - } - - callSetNetworkPolicy(); - // [END container_v1_generated_ClusterManager_SetNetworkPolicy_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_autoscaling.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_autoscaling.js deleted file mode 100644 index fde99e8483c..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_autoscaling.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(autoscaling) { - // [START container_v1_generated_ClusterManager_SetNodePoolAutoscaling_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Autoscaling configuration for the node pool. - */ - // const autoscaling = {} - /** - * The name (project, location, cluster, node pool) of the node pool to set - * autoscaler settings. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetNodePoolAutoscaling() { - // Construct request - const request = { - autoscaling, - }; - - // Run request - const response = await containerClient.setNodePoolAutoscaling(request); - console.log(response); - } - - callSetNodePoolAutoscaling(); - // [END container_v1_generated_ClusterManager_SetNodePoolAutoscaling_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_management.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_management.js deleted file mode 100644 index e1ea4030588..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_management.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(management) { - // [START container_v1_generated_ClusterManager_SetNodePoolManagement_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. NodeManagement configuration for the node pool. - */ - // const management = {} - /** - * The name (project, location, cluster, node pool id) of the node pool to set - * management properties. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetNodePoolManagement() { - // Construct request - const request = { - management, - }; - - // Run request - const response = await containerClient.setNodePoolManagement(request); - console.log(response); - } - - callSetNodePoolManagement(); - // [END container_v1_generated_ClusterManager_SetNodePoolManagement_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_size.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_size.js deleted file mode 100644 index aedfdd9f71b..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_size.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(nodeCount) { - // [START container_v1_generated_ClusterManager_SetNodePoolSize_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The desired node count for the pool. - */ - // const nodeCount = 1234 - /** - * The name (project, location, cluster, node pool id) of the node pool to set - * size. - * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetNodePoolSize() { - // Construct request - const request = { - nodeCount, - }; - - // Run request - const response = await containerClient.setNodePoolSize(request); - console.log(response); - } - - callSetNodePoolSize(); - // [END container_v1_generated_ClusterManager_SetNodePoolSize_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.start_i_p_rotation.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.start_i_p_rotation.js deleted file mode 100644 index a8f65196353..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.start_i_p_rotation.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_StartIPRotation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster name) of the cluster to start IP - * rotation. Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - /** - * Whether to rotate credentials during IP rotation. - */ - // const rotateCredentials = true - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callStartIPRotation() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.startIPRotation(request); - console.log(response); - } - - callStartIPRotation(); - // [END container_v1_generated_ClusterManager_StartIPRotation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_cluster.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_cluster.js deleted file mode 100644 index b0280b7fea6..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_cluster.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(update) { - // [START container_v1_generated_ClusterManager_UpdateCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. A description of the update. - */ - // const update = {} - /** - * The name (project, location, cluster) of the cluster to update. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callUpdateCluster() { - // Construct request - const request = { - update, - }; - - // Run request - const response = await containerClient.updateCluster(request); - console.log(response); - } - - callUpdateCluster(); - // [END container_v1_generated_ClusterManager_UpdateCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_master.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_master.js deleted file mode 100644 index 37f555312f8..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_master.js +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(masterVersion) { - // [START container_v1_generated_ClusterManager_UpdateMaster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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 - */ - // const masterVersion = 'abc123' - /** - * The name (project, location, cluster) of the cluster to update. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callUpdateMaster() { - // Construct request - const request = { - masterVersion, - }; - - // Run request - const response = await containerClient.updateMaster(request); - console.log(response); - } - - callUpdateMaster(); - // [END container_v1_generated_ClusterManager_UpdateMaster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_node_pool.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_node_pool.js deleted file mode 100644 index 10715ac0d85..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_node_pool.js +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(nodeVersion, imageType) { - // [START container_v1_generated_ClusterManager_UpdateNodePool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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 - */ - // const nodeVersion = 'abc123' - /** - * Required. The desired image type for the node pool. Please see - * https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for - * available image types. - */ - // const imageType = 'abc123' - /** - * The name (project, location, cluster, node pool) of the node pool to - * update. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - /** - * The desired list of Google Compute Engine - * zones (https://cloud.google.com/compute/docs/zones#available) in which the - * node pool's nodes should be located. Changing the locations for a node pool - * will result in nodes being either created or removed from the node pool, - * depending on whether locations are being added or removed. - */ - // const locations = 'abc123' - /** - * The desired workload metadata config for the node pool. - */ - // const workloadMetadataConfig = {} - /** - * Upgrade settings control disruption and speed of the upgrade. - */ - // const upgradeSettings = {} - /** - * The desired network tags to be applied to all nodes in the node pool. - * If this field is not present, the tags will not be changed. Otherwise, - * the existing network tags will be *replaced* with the provided tags. - */ - // const tags = {} - /** - * The desired node taints to be applied to all nodes in the node pool. - * If this field is not present, the taints will not be changed. Otherwise, - * the existing node taints will be *replaced* with the provided taints. - */ - // const taints = {} - /** - * The desired node labels to be applied to all nodes in the node pool. - * If this field is not present, the labels will not be changed. Otherwise, - * the existing node labels will be *replaced* with the provided labels. - */ - // const labels = {} - /** - * Parameters that can be configured on Linux nodes. - */ - // const linuxNodeConfig = {} - /** - * Node kubelet configs. - */ - // const kubeletConfig = {} - /** - * Node network config. - */ - // const nodeNetworkConfig = {} - /** - * GCFS config. - */ - // const gcfsConfig = {} - /** - * Confidential nodes config. - * All the nodes in the node pool will be Confidential VM once enabled. - */ - // const confidentialNodes = {} - /** - * Enable or disable gvnic on the node pool. - */ - // const gvnic = {} - /** - * The current etag of the node pool. - * If an etag is provided and does not match the current etag of the node - * pool, update will be blocked and an ABORTED error will be returned. - */ - // const etag = 'abc123' - /** - * Enable or disable NCCL fast socket for the node pool. - */ - // const fastSocket = {} - /** - * Logging configuration. - */ - // const loggingConfig = {} - /** - * The resource labels for the node pool to use to annotate any related - * Google Compute Engine resources. - */ - // const resourceLabels = {} - /** - * Parameters that can be configured on Windows nodes. - */ - // const windowsNodeConfig = {} - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callUpdateNodePool() { - // Construct request - const request = { - nodeVersion, - imageType, - }; - - // Run request - const response = await containerClient.updateNodePool(request); - console.log(response); - } - - callUpdateNodePool(); - // [END container_v1_generated_ClusterManager_UpdateNodePool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/snippet_metadata.google.container.v1.json b/owl-bot-staging/google-container/v1/samples/generated/v1/snippet_metadata.google.container.v1.json deleted file mode 100644 index 66a864e5ad7..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/snippet_metadata.google.container.v1.json +++ /dev/null @@ -1,1915 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-container", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.container.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "container_v1_generated_ClusterManager_ListClusters_async", - "title": "ClusterManager listClusters Sample", - "origin": "API_DEFINITION", - "description": " Lists all clusters owned by a project in either the specified zone or all zones.", - "canonical": true, - "file": "cluster_manager.list_clusters.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListClusters", - "fullName": "google.container.v1.ClusterManager.ListClusters", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.ListClustersResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "ListClusters", - "fullName": "google.container.v1.ClusterManager.ListClusters", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_GetCluster_async", - "title": "ClusterManager getCluster Sample", - "origin": "API_DEFINITION", - "description": " Gets the details of a specific cluster.", - "canonical": true, - "file": "cluster_manager.get_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCluster", - "fullName": "google.container.v1.ClusterManager.GetCluster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Cluster", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "GetCluster", - "fullName": "google.container.v1.ClusterManager.GetCluster", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_CreateCluster_async", - "title": "ClusterManager createCluster Sample", - "origin": "API_DEFINITION", - "description": " 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](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). 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.", - "canonical": true, - "file": "cluster_manager.create_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateCluster", - "fullName": "google.container.v1.ClusterManager.CreateCluster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster", - "type": ".google.container.v1.Cluster" - }, - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "CreateCluster", - "fullName": "google.container.v1.ClusterManager.CreateCluster", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_UpdateCluster_async", - "title": "ClusterManager updateCluster Sample", - "origin": "API_DEFINITION", - "description": " Updates the settings of a specific cluster.", - "canonical": true, - "file": "cluster_manager.update_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateCluster", - "fullName": "google.container.v1.ClusterManager.UpdateCluster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "update", - "type": ".google.container.v1.ClusterUpdate" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "UpdateCluster", - "fullName": "google.container.v1.ClusterManager.UpdateCluster", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_UpdateNodePool_async", - "title": "ClusterManager updateNodePool Sample", - "origin": "API_DEFINITION", - "description": " Updates the version and/or image type for the specified node pool.", - "canonical": true, - "file": "cluster_manager.update_node_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 156, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateNodePool", - "fullName": "google.container.v1.ClusterManager.UpdateNodePool", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "node_version", - "type": "TYPE_STRING" - }, - { - "name": "image_type", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "locations", - "type": "TYPE_STRING[]" - }, - { - "name": "workload_metadata_config", - "type": ".google.container.v1.WorkloadMetadataConfig" - }, - { - "name": "upgrade_settings", - "type": ".google.container.v1.NodePool.UpgradeSettings" - }, - { - "name": "tags", - "type": ".google.container.v1.NetworkTags" - }, - { - "name": "taints", - "type": ".google.container.v1.NodeTaints" - }, - { - "name": "labels", - "type": ".google.container.v1.NodeLabels" - }, - { - "name": "linux_node_config", - "type": ".google.container.v1.LinuxNodeConfig" - }, - { - "name": "kubelet_config", - "type": ".google.container.v1.NodeKubeletConfig" - }, - { - "name": "node_network_config", - "type": ".google.container.v1.NodeNetworkConfig" - }, - { - "name": "gcfs_config", - "type": ".google.container.v1.GcfsConfig" - }, - { - "name": "confidential_nodes", - "type": ".google.container.v1.ConfidentialNodes" - }, - { - "name": "gvnic", - "type": ".google.container.v1.VirtualNIC" - }, - { - "name": "etag", - "type": "TYPE_STRING" - }, - { - "name": "fast_socket", - "type": ".google.container.v1.FastSocket" - }, - { - "name": "logging_config", - "type": ".google.container.v1.NodePoolLoggingConfig" - }, - { - "name": "resource_labels", - "type": ".google.container.v1.ResourceLabels" - }, - { - "name": "windows_node_config", - "type": ".google.container.v1.WindowsNodeConfig" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "UpdateNodePool", - "fullName": "google.container.v1.ClusterManager.UpdateNodePool", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_SetNodePoolAutoscaling_async", - "title": "ClusterManager setNodePoolAutoscaling Sample", - "origin": "API_DEFINITION", - "description": " Sets the autoscaling settings for the specified node pool.", - "canonical": true, - "file": "cluster_manager.set_node_pool_autoscaling.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetNodePoolAutoscaling", - "fullName": "google.container.v1.ClusterManager.SetNodePoolAutoscaling", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "autoscaling", - "type": ".google.container.v1.NodePoolAutoscaling" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "SetNodePoolAutoscaling", - "fullName": "google.container.v1.ClusterManager.SetNodePoolAutoscaling", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_SetLoggingService_async", - "title": "ClusterManager setLoggingService Sample", - "origin": "API_DEFINITION", - "description": " Sets the logging service for a specific cluster.", - "canonical": true, - "file": "cluster_manager.set_logging_service.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetLoggingService", - "fullName": "google.container.v1.ClusterManager.SetLoggingService", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "logging_service", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "SetLoggingService", - "fullName": "google.container.v1.ClusterManager.SetLoggingService", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_SetMonitoringService_async", - "title": "ClusterManager setMonitoringService Sample", - "origin": "API_DEFINITION", - "description": " Sets the monitoring service for a specific cluster.", - "canonical": true, - "file": "cluster_manager.set_monitoring_service.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetMonitoringService", - "fullName": "google.container.v1.ClusterManager.SetMonitoringService", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "monitoring_service", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "SetMonitoringService", - "fullName": "google.container.v1.ClusterManager.SetMonitoringService", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_SetAddonsConfig_async", - "title": "ClusterManager setAddonsConfig Sample", - "origin": "API_DEFINITION", - "description": " Sets the addons for a specific cluster.", - "canonical": true, - "file": "cluster_manager.set_addons_config.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetAddonsConfig", - "fullName": "google.container.v1.ClusterManager.SetAddonsConfig", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "addons_config", - "type": ".google.container.v1.AddonsConfig" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "SetAddonsConfig", - "fullName": "google.container.v1.ClusterManager.SetAddonsConfig", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_SetLocations_async", - "title": "ClusterManager setLocations Sample", - "origin": "API_DEFINITION", - "description": " Sets the locations for a specific cluster. Deprecated. Use [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update) instead.", - "canonical": true, - "file": "cluster_manager.set_locations.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetLocations", - "fullName": "google.container.v1.ClusterManager.SetLocations", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "locations", - "type": "TYPE_STRING[]" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "SetLocations", - "fullName": "google.container.v1.ClusterManager.SetLocations", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_UpdateMaster_async", - "title": "ClusterManager updateMaster Sample", - "origin": "API_DEFINITION", - "description": " Updates the master for a specific cluster.", - "canonical": true, - "file": "cluster_manager.update_master.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateMaster", - "fullName": "google.container.v1.ClusterManager.UpdateMaster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "master_version", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "UpdateMaster", - "fullName": "google.container.v1.ClusterManager.UpdateMaster", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_SetMasterAuth_async", - "title": "ClusterManager setMasterAuth Sample", - "origin": "API_DEFINITION", - "description": " Sets master auth materials. Currently supports changing the admin password or a specific cluster, either via password generation or explicitly setting the password.", - "canonical": true, - "file": "cluster_manager.set_master_auth.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetMasterAuth", - "fullName": "google.container.v1.ClusterManager.SetMasterAuth", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "action", - "type": ".google.container.v1.SetMasterAuthRequest.Action" - }, - { - "name": "update", - "type": ".google.container.v1.MasterAuth" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "SetMasterAuth", - "fullName": "google.container.v1.ClusterManager.SetMasterAuth", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_DeleteCluster_async", - "title": "ClusterManager deleteCluster Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "cluster_manager.delete_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteCluster", - "fullName": "google.container.v1.ClusterManager.DeleteCluster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "DeleteCluster", - "fullName": "google.container.v1.ClusterManager.DeleteCluster", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_ListOperations_async", - "title": "ClusterManager listOperations Sample", - "origin": "API_DEFINITION", - "description": " Lists all operations in a project in a specific zone or all zones.", - "canonical": true, - "file": "cluster_manager.list_operations.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListOperations", - "fullName": "google.container.v1.ClusterManager.ListOperations", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.ListOperationsResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "ListOperations", - "fullName": "google.container.v1.ClusterManager.ListOperations", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_GetOperation_async", - "title": "ClusterManager getOperation Sample", - "origin": "API_DEFINITION", - "description": " Gets the specified operation.", - "canonical": true, - "file": "cluster_manager.get_operation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetOperation", - "fullName": "google.container.v1.ClusterManager.GetOperation", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "operation_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "GetOperation", - "fullName": "google.container.v1.ClusterManager.GetOperation", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_CancelOperation_async", - "title": "ClusterManager cancelOperation Sample", - "origin": "API_DEFINITION", - "description": " Cancels the specified operation.", - "canonical": true, - "file": "cluster_manager.cancel_operation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CancelOperation", - "fullName": "google.container.v1.ClusterManager.CancelOperation", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "operation_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "CancelOperation", - "fullName": "google.container.v1.ClusterManager.CancelOperation", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_GetServerConfig_async", - "title": "ClusterManager getServerConfig Sample", - "origin": "API_DEFINITION", - "description": " Returns configuration info about the Google Kubernetes Engine service.", - "canonical": true, - "file": "cluster_manager.get_server_config.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetServerConfig", - "fullName": "google.container.v1.ClusterManager.GetServerConfig", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.ServerConfig", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "GetServerConfig", - "fullName": "google.container.v1.ClusterManager.GetServerConfig", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_GetJSONWebKeys_async", - "title": "ClusterManager getJSONWebKeys Sample", - "origin": "API_DEFINITION", - "description": " Gets the public component of the cluster signing keys in JSON Web Key format. This API is not yet intended for general use, and is not available for all clusters.", - "canonical": true, - "file": "cluster_manager.get_j_s_o_n_web_keys.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetJSONWebKeys", - "fullName": "google.container.v1.ClusterManager.GetJSONWebKeys", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.GetJSONWebKeysResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "GetJSONWebKeys", - "fullName": "google.container.v1.ClusterManager.GetJSONWebKeys", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_ListNodePools_async", - "title": "ClusterManager listNodePools Sample", - "origin": "API_DEFINITION", - "description": " Lists the node pools for a cluster.", - "canonical": true, - "file": "cluster_manager.list_node_pools.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListNodePools", - "fullName": "google.container.v1.ClusterManager.ListNodePools", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.ListNodePoolsResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "ListNodePools", - "fullName": "google.container.v1.ClusterManager.ListNodePools", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_GetNodePool_async", - "title": "ClusterManager getNodePool Sample", - "origin": "API_DEFINITION", - "description": " Retrieves the requested node pool.", - "canonical": true, - "file": "cluster_manager.get_node_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetNodePool", - "fullName": "google.container.v1.ClusterManager.GetNodePool", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.NodePool", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "GetNodePool", - "fullName": "google.container.v1.ClusterManager.GetNodePool", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_CreateNodePool_async", - "title": "ClusterManager createNodePool Sample", - "origin": "API_DEFINITION", - "description": " Creates a node pool for a cluster.", - "canonical": true, - "file": "cluster_manager.create_node_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateNodePool", - "fullName": "google.container.v1.ClusterManager.CreateNodePool", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool", - "type": ".google.container.v1.NodePool" - }, - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "CreateNodePool", - "fullName": "google.container.v1.ClusterManager.CreateNodePool", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_DeleteNodePool_async", - "title": "ClusterManager deleteNodePool Sample", - "origin": "API_DEFINITION", - "description": " Deletes a node pool from a cluster.", - "canonical": true, - "file": "cluster_manager.delete_node_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteNodePool", - "fullName": "google.container.v1.ClusterManager.DeleteNodePool", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "DeleteNodePool", - "fullName": "google.container.v1.ClusterManager.DeleteNodePool", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_CompleteNodePoolUpgrade_async", - "title": "ClusterManager completeNodePoolUpgrade Sample", - "origin": "API_DEFINITION", - "description": " CompleteNodePoolUpgrade will signal an on-going node pool upgrade to complete.", - "canonical": true, - "file": "cluster_manager.complete_node_pool_upgrade.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CompleteNodePoolUpgrade", - "fullName": "google.container.v1.ClusterManager.CompleteNodePoolUpgrade", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "CompleteNodePoolUpgrade", - "fullName": "google.container.v1.ClusterManager.CompleteNodePoolUpgrade", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_RollbackNodePoolUpgrade_async", - "title": "ClusterManager rollbackNodePoolUpgrade Sample", - "origin": "API_DEFINITION", - "description": " Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last upgrade successfully completed.", - "canonical": true, - "file": "cluster_manager.rollback_node_pool_upgrade.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RollbackNodePoolUpgrade", - "fullName": "google.container.v1.ClusterManager.RollbackNodePoolUpgrade", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "respect_pdb", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "RollbackNodePoolUpgrade", - "fullName": "google.container.v1.ClusterManager.RollbackNodePoolUpgrade", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_SetNodePoolManagement_async", - "title": "ClusterManager setNodePoolManagement Sample", - "origin": "API_DEFINITION", - "description": " Sets the NodeManagement options for a node pool.", - "canonical": true, - "file": "cluster_manager.set_node_pool_management.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetNodePoolManagement", - "fullName": "google.container.v1.ClusterManager.SetNodePoolManagement", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "management", - "type": ".google.container.v1.NodeManagement" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "SetNodePoolManagement", - "fullName": "google.container.v1.ClusterManager.SetNodePoolManagement", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_SetLabels_async", - "title": "ClusterManager setLabels Sample", - "origin": "API_DEFINITION", - "description": " Sets labels on a cluster.", - "canonical": true, - "file": "cluster_manager.set_labels.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetLabels", - "fullName": "google.container.v1.ClusterManager.SetLabels", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "resource_labels", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "label_fingerprint", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "SetLabels", - "fullName": "google.container.v1.ClusterManager.SetLabels", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_SetLegacyAbac_async", - "title": "ClusterManager setLegacyAbac Sample", - "origin": "API_DEFINITION", - "description": " Enables or disables the ABAC authorization mechanism on a cluster.", - "canonical": true, - "file": "cluster_manager.set_legacy_abac.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetLegacyAbac", - "fullName": "google.container.v1.ClusterManager.SetLegacyAbac", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "enabled", - "type": "TYPE_BOOL" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "SetLegacyAbac", - "fullName": "google.container.v1.ClusterManager.SetLegacyAbac", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_StartIPRotation_async", - "title": "ClusterManager startIPRotation Sample", - "origin": "API_DEFINITION", - "description": " Starts master IP rotation.", - "canonical": true, - "file": "cluster_manager.start_i_p_rotation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "StartIPRotation", - "fullName": "google.container.v1.ClusterManager.StartIPRotation", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "rotate_credentials", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "StartIPRotation", - "fullName": "google.container.v1.ClusterManager.StartIPRotation", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_CompleteIPRotation_async", - "title": "ClusterManager completeIPRotation Sample", - "origin": "API_DEFINITION", - "description": " Completes master IP rotation.", - "canonical": true, - "file": "cluster_manager.complete_i_p_rotation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CompleteIPRotation", - "fullName": "google.container.v1.ClusterManager.CompleteIPRotation", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "CompleteIPRotation", - "fullName": "google.container.v1.ClusterManager.CompleteIPRotation", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_SetNodePoolSize_async", - "title": "ClusterManager setNodePoolSize Sample", - "origin": "API_DEFINITION", - "description": " Sets the size for a specific node pool. The new size will be used for all replicas, including future replicas created by modifying [NodePool.locations][google.container.v1.NodePool.locations].", - "canonical": true, - "file": "cluster_manager.set_node_pool_size.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetNodePoolSize", - "fullName": "google.container.v1.ClusterManager.SetNodePoolSize", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "node_count", - "type": "TYPE_INT32" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "SetNodePoolSize", - "fullName": "google.container.v1.ClusterManager.SetNodePoolSize", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_SetNetworkPolicy_async", - "title": "ClusterManager setNetworkPolicy Sample", - "origin": "API_DEFINITION", - "description": " Enables or disables Network Policy for a cluster.", - "canonical": true, - "file": "cluster_manager.set_network_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetNetworkPolicy", - "fullName": "google.container.v1.ClusterManager.SetNetworkPolicy", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "network_policy", - "type": ".google.container.v1.NetworkPolicy" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "SetNetworkPolicy", - "fullName": "google.container.v1.ClusterManager.SetNetworkPolicy", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_SetMaintenancePolicy_async", - "title": "ClusterManager setMaintenancePolicy Sample", - "origin": "API_DEFINITION", - "description": " Sets the maintenance policy for a cluster.", - "canonical": true, - "file": "cluster_manager.set_maintenance_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 78, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetMaintenancePolicy", - "fullName": "google.container.v1.ClusterManager.SetMaintenancePolicy", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "maintenance_policy", - "type": ".google.container.v1.MaintenancePolicy" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "SetMaintenancePolicy", - "fullName": "google.container.v1.ClusterManager.SetMaintenancePolicy", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_ListUsableSubnetworks_async", - "title": "ClusterManager listUsableSubnetworks Sample", - "origin": "API_DEFINITION", - "description": " Lists subnetworks that are usable for creating clusters in a project.", - "canonical": true, - "file": "cluster_manager.list_usable_subnetworks.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 74, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListUsableSubnetworks", - "fullName": "google.container.v1.ClusterManager.ListUsableSubnetworks", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.ListUsableSubnetworksResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "ListUsableSubnetworks", - "fullName": "google.container.v1.ClusterManager.ListUsableSubnetworks", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_CheckAutopilotCompatibility_async", - "title": "ClusterManager checkAutopilotCompatibility Sample", - "origin": "API_DEFINITION", - "description": " Checks the cluster compatibility with Autopilot mode, and returns a list of compatibility issues.", - "canonical": true, - "file": "cluster_manager.check_autopilot_compatibility.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CheckAutopilotCompatibility", - "fullName": "google.container.v1.ClusterManager.CheckAutopilotCompatibility", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.CheckAutopilotCompatibilityResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "CheckAutopilotCompatibility", - "fullName": "google.container.v1.ClusterManager.CheckAutopilotCompatibility", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-container/v1/src/index.ts b/owl-bot-staging/google-container/v1/src/index.ts deleted file mode 100644 index 7f3539e2b2d..00000000000 --- a/owl-bot-staging/google-container/v1/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1 from './v1'; -const ClusterManagerClient = v1.ClusterManagerClient; -type ClusterManagerClient = v1.ClusterManagerClient; -export {v1, ClusterManagerClient}; -export default {v1, ClusterManagerClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/google-container/v1/src/v1/cluster_manager_client.ts b/owl-bot-staging/google-container/v1/src/v1/cluster_manager_client.ts deleted file mode 100644 index 6805bf5ddf2..00000000000 --- a/owl-bot-staging/google-container/v1/src/v1/cluster_manager_client.ts +++ /dev/null @@ -1,3551 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/cluster_manager_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './cluster_manager_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Google Kubernetes Engine Cluster Manager v1 - * @class - * @memberof v1 - */ -export class ClusterManagerClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - clusterManagerStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of ClusterManagerClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ClusterManagerClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof ClusterManagerClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listUsableSubnetworks: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'subnetworks') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.container.v1.ClusterManager', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.clusterManagerStub) { - return this.clusterManagerStub; - } - - // Put together the "service stub" for - // google.container.v1.ClusterManager. - this.clusterManagerStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.container.v1.ClusterManager') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.container.v1.ClusterManager, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const clusterManagerStubMethods = - ['listClusters', 'getCluster', 'createCluster', 'updateCluster', 'updateNodePool', 'setNodePoolAutoscaling', 'setLoggingService', 'setMonitoringService', 'setAddonsConfig', 'setLocations', 'updateMaster', 'setMasterAuth', 'deleteCluster', 'listOperations', 'getOperation', 'cancelOperation', 'getServerConfig', 'getJsonWebKeys', 'listNodePools', 'getNodePool', 'createNodePool', 'deleteNodePool', 'completeNodePoolUpgrade', 'rollbackNodePoolUpgrade', 'setNodePoolManagement', 'setLabels', 'setLegacyAbac', 'startIpRotation', 'completeIpRotation', 'setNodePoolSize', 'setNetworkPolicy', 'setMaintenancePolicy', 'listUsableSubnetworks', 'checkAutopilotCompatibility']; - for (const methodName of clusterManagerStubMethods) { - const callPromise = this.clusterManagerStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.clusterManagerStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'container.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'container.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Lists all clusters owned by a project in either the specified zone or all - * zones. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the parent field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides, or "-" for all zones. This field has been deprecated and - * replaced by the parent field. - * @param {string} request.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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.ListClustersResponse | ListClustersResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.list_clusters.js - * region_tag:container_v1_generated_ClusterManager_ListClusters_async - */ - listClusters( - request?: protos.google.container.v1.IListClustersRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IListClustersResponse, - protos.google.container.v1.IListClustersRequest|undefined, {}|undefined - ]>; - listClusters( - request: protos.google.container.v1.IListClustersRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IListClustersResponse, - protos.google.container.v1.IListClustersRequest|null|undefined, - {}|null|undefined>): void; - listClusters( - request: protos.google.container.v1.IListClustersRequest, - callback: Callback< - protos.google.container.v1.IListClustersResponse, - protos.google.container.v1.IListClustersRequest|null|undefined, - {}|null|undefined>): void; - listClusters( - request?: protos.google.container.v1.IListClustersRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IListClustersResponse, - protos.google.container.v1.IListClustersRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IListClustersResponse, - protos.google.container.v1.IListClustersRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IListClustersResponse, - protos.google.container.v1.IListClustersRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - }); - this.initialize(); - return this.innerApiCalls.listClusters(request, options, callback); - } -/** - * Gets the details of a specific cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to retrieve. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to retrieve. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Cluster | Cluster}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.get_cluster.js - * region_tag:container_v1_generated_ClusterManager_GetCluster_async - */ - getCluster( - request?: protos.google.container.v1.IGetClusterRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.ICluster, - protos.google.container.v1.IGetClusterRequest|undefined, {}|undefined - ]>; - getCluster( - request: protos.google.container.v1.IGetClusterRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.ICluster, - protos.google.container.v1.IGetClusterRequest|null|undefined, - {}|null|undefined>): void; - getCluster( - request: protos.google.container.v1.IGetClusterRequest, - callback: Callback< - protos.google.container.v1.ICluster, - protos.google.container.v1.IGetClusterRequest|null|undefined, - {}|null|undefined>): void; - getCluster( - request?: protos.google.container.v1.IGetClusterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.ICluster, - protos.google.container.v1.IGetClusterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.ICluster, - protos.google.container.v1.IGetClusterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.ICluster, - protos.google.container.v1.IGetClusterRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.getCluster(request, options, callback); - } -/** - * 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](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). - * - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the parent field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the parent - * field. - * @param {google.container.v1.Cluster} request.cluster - * Required. A [cluster - * resource](https://cloud.google.com/container-engine/reference/rest/v1/projects.locations.clusters) - * @param {string} request.parent - * The parent (project and location) where the cluster will be created. - * Specified in the format `projects/* /locations/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.create_cluster.js - * region_tag:container_v1_generated_ClusterManager_CreateCluster_async - */ - createCluster( - request?: protos.google.container.v1.ICreateClusterRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ICreateClusterRequest|undefined, {}|undefined - ]>; - createCluster( - request: protos.google.container.v1.ICreateClusterRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ICreateClusterRequest|null|undefined, - {}|null|undefined>): void; - createCluster( - request: protos.google.container.v1.ICreateClusterRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ICreateClusterRequest|null|undefined, - {}|null|undefined>): void; - createCluster( - request?: protos.google.container.v1.ICreateClusterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ICreateClusterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ICreateClusterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ICreateClusterRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - }); - this.initialize(); - return this.innerApiCalls.createCluster(request, options, callback); - } -/** - * Updates the settings of a specific cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {google.container.v1.ClusterUpdate} request.update - * Required. A description of the update. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to update. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.update_cluster.js - * region_tag:container_v1_generated_ClusterManager_UpdateCluster_async - */ - updateCluster( - request?: protos.google.container.v1.IUpdateClusterRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateClusterRequest|undefined, {}|undefined - ]>; - updateCluster( - request: protos.google.container.v1.IUpdateClusterRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateClusterRequest|null|undefined, - {}|null|undefined>): void; - updateCluster( - request: protos.google.container.v1.IUpdateClusterRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateClusterRequest|null|undefined, - {}|null|undefined>): void; - updateCluster( - request?: protos.google.container.v1.IUpdateClusterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateClusterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateClusterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateClusterRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateCluster(request, options, callback); - } -/** - * Updates the version and/or image type for the specified node pool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Deprecated. The name of the node pool to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodeVersion - * 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 - * @param {string} request.imageType - * Required. The desired image type for the node pool. Please see - * https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for - * available image types. - * @param {string} request.name - * The name (project, location, cluster, node pool) of the node pool to - * update. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {string[]} request.locations - * The desired list of Google Compute Engine - * [zones](https://cloud.google.com/compute/docs/zones#available) in which the - * node pool's nodes should be located. Changing the locations for a node pool - * will result in nodes being either created or removed from the node pool, - * depending on whether locations are being added or removed. - * @param {google.container.v1.WorkloadMetadataConfig} request.workloadMetadataConfig - * The desired workload metadata config for the node pool. - * @param {google.container.v1.NodePool.UpgradeSettings} request.upgradeSettings - * Upgrade settings control disruption and speed of the upgrade. - * @param {google.container.v1.NetworkTags} request.tags - * The desired network tags to be applied to all nodes in the node pool. - * If this field is not present, the tags will not be changed. Otherwise, - * the existing network tags will be *replaced* with the provided tags. - * @param {google.container.v1.NodeTaints} request.taints - * The desired node taints to be applied to all nodes in the node pool. - * If this field is not present, the taints will not be changed. Otherwise, - * the existing node taints will be *replaced* with the provided taints. - * @param {google.container.v1.NodeLabels} request.labels - * The desired node labels to be applied to all nodes in the node pool. - * If this field is not present, the labels will not be changed. Otherwise, - * the existing node labels will be *replaced* with the provided labels. - * @param {google.container.v1.LinuxNodeConfig} request.linuxNodeConfig - * Parameters that can be configured on Linux nodes. - * @param {google.container.v1.NodeKubeletConfig} request.kubeletConfig - * Node kubelet configs. - * @param {google.container.v1.NodeNetworkConfig} request.nodeNetworkConfig - * Node network config. - * @param {google.container.v1.GcfsConfig} request.gcfsConfig - * GCFS config. - * @param {google.container.v1.ConfidentialNodes} request.confidentialNodes - * Confidential nodes config. - * All the nodes in the node pool will be Confidential VM once enabled. - * @param {google.container.v1.VirtualNIC} request.gvnic - * Enable or disable gvnic on the node pool. - * @param {string} request.etag - * The current etag of the node pool. - * If an etag is provided and does not match the current etag of the node - * pool, update will be blocked and an ABORTED error will be returned. - * @param {google.container.v1.FastSocket} request.fastSocket - * Enable or disable NCCL fast socket for the node pool. - * @param {google.container.v1.NodePoolLoggingConfig} request.loggingConfig - * Logging configuration. - * @param {google.container.v1.ResourceLabels} request.resourceLabels - * The resource labels for the node pool to use to annotate any related - * Google Compute Engine resources. - * @param {google.container.v1.WindowsNodeConfig} request.windowsNodeConfig - * Parameters that can be configured on Windows nodes. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.update_node_pool.js - * region_tag:container_v1_generated_ClusterManager_UpdateNodePool_async - */ - updateNodePool( - request?: protos.google.container.v1.IUpdateNodePoolRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateNodePoolRequest|undefined, {}|undefined - ]>; - updateNodePool( - request: protos.google.container.v1.IUpdateNodePoolRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateNodePoolRequest|null|undefined, - {}|null|undefined>): void; - updateNodePool( - request: protos.google.container.v1.IUpdateNodePoolRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateNodePoolRequest|null|undefined, - {}|null|undefined>): void; - updateNodePool( - request?: protos.google.container.v1.IUpdateNodePoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateNodePoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateNodePoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateNodePoolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateNodePool(request, options, callback); - } -/** - * Sets the autoscaling settings for the specified node pool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Deprecated. The name of the node pool to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {google.container.v1.NodePoolAutoscaling} request.autoscaling - * Required. Autoscaling configuration for the node pool. - * @param {string} request.name - * The name (project, location, cluster, node pool) of the node pool to set - * autoscaler settings. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.set_node_pool_autoscaling.js - * region_tag:container_v1_generated_ClusterManager_SetNodePoolAutoscaling_async - */ - setNodePoolAutoscaling( - request?: protos.google.container.v1.ISetNodePoolAutoscalingRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolAutoscalingRequest|undefined, {}|undefined - ]>; - setNodePoolAutoscaling( - request: protos.google.container.v1.ISetNodePoolAutoscalingRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolAutoscalingRequest|null|undefined, - {}|null|undefined>): void; - setNodePoolAutoscaling( - request: protos.google.container.v1.ISetNodePoolAutoscalingRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolAutoscalingRequest|null|undefined, - {}|null|undefined>): void; - setNodePoolAutoscaling( - request?: protos.google.container.v1.ISetNodePoolAutoscalingRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolAutoscalingRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolAutoscalingRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolAutoscalingRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setNodePoolAutoscaling(request, options, callback); - } -/** - * Sets the logging service for a specific cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string} request.loggingService - * Required. The logging service the cluster should use to write logs. - * Currently available options: - * - * * `logging.googleapis.com/kubernetes` - The Cloud Logging - * service with a Kubernetes-native resource model - * * `logging.googleapis.com` - The legacy Cloud Logging service (no longer - * available as of GKE 1.15). - * * `none` - no logs will be exported from the cluster. - * - * If left as an empty string,`logging.googleapis.com/kubernetes` will be - * used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to set logging. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.set_logging_service.js - * region_tag:container_v1_generated_ClusterManager_SetLoggingService_async - */ - setLoggingService( - request?: protos.google.container.v1.ISetLoggingServiceRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLoggingServiceRequest|undefined, {}|undefined - ]>; - setLoggingService( - request: protos.google.container.v1.ISetLoggingServiceRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLoggingServiceRequest|null|undefined, - {}|null|undefined>): void; - setLoggingService( - request: protos.google.container.v1.ISetLoggingServiceRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLoggingServiceRequest|null|undefined, - {}|null|undefined>): void; - setLoggingService( - request?: protos.google.container.v1.ISetLoggingServiceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLoggingServiceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLoggingServiceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLoggingServiceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setLoggingService(request, options, callback); - } -/** - * Sets the monitoring service for a specific cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string} request.monitoringService - * Required. The monitoring service the cluster should use to write metrics. - * Currently available options: - * - * * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring - * service with a Kubernetes-native resource model - * * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no - * longer available as of GKE 1.15). - * * `none` - No metrics will be exported from the cluster. - * - * If left as an empty string,`monitoring.googleapis.com/kubernetes` will be - * used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to set monitoring. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.set_monitoring_service.js - * region_tag:container_v1_generated_ClusterManager_SetMonitoringService_async - */ - setMonitoringService( - request?: protos.google.container.v1.ISetMonitoringServiceRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMonitoringServiceRequest|undefined, {}|undefined - ]>; - setMonitoringService( - request: protos.google.container.v1.ISetMonitoringServiceRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMonitoringServiceRequest|null|undefined, - {}|null|undefined>): void; - setMonitoringService( - request: protos.google.container.v1.ISetMonitoringServiceRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMonitoringServiceRequest|null|undefined, - {}|null|undefined>): void; - setMonitoringService( - request?: protos.google.container.v1.ISetMonitoringServiceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMonitoringServiceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMonitoringServiceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMonitoringServiceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setMonitoringService(request, options, callback); - } -/** - * Sets the addons for a specific cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {google.container.v1.AddonsConfig} request.addonsConfig - * Required. The desired configurations for the various addons available to - * run in the cluster. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to set addons. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.set_addons_config.js - * region_tag:container_v1_generated_ClusterManager_SetAddonsConfig_async - */ - setAddonsConfig( - request?: protos.google.container.v1.ISetAddonsConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetAddonsConfigRequest|undefined, {}|undefined - ]>; - setAddonsConfig( - request: protos.google.container.v1.ISetAddonsConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetAddonsConfigRequest|null|undefined, - {}|null|undefined>): void; - setAddonsConfig( - request: protos.google.container.v1.ISetAddonsConfigRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetAddonsConfigRequest|null|undefined, - {}|null|undefined>): void; - setAddonsConfig( - request?: protos.google.container.v1.ISetAddonsConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetAddonsConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetAddonsConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetAddonsConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setAddonsConfig(request, options, callback); - } -/** - * Sets the locations for a specific cluster. - * Deprecated. Use - * [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update) - * instead. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string[]} request.locations - * Required. The desired list of Google Compute Engine - * [zones](https://cloud.google.com/compute/docs/zones#available) 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. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to set locations. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.set_locations.js - * region_tag:container_v1_generated_ClusterManager_SetLocations_async - * @deprecated SetLocations is deprecated and may be removed in a future version. - */ - setLocations( - request?: protos.google.container.v1.ISetLocationsRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLocationsRequest|undefined, {}|undefined - ]>; - setLocations( - request: protos.google.container.v1.ISetLocationsRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLocationsRequest|null|undefined, - {}|null|undefined>): void; - setLocations( - request: protos.google.container.v1.ISetLocationsRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLocationsRequest|null|undefined, - {}|null|undefined>): void; - setLocations( - request?: protos.google.container.v1.ISetLocationsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLocationsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLocationsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLocationsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - this.warn('DEP$ClusterManager-$SetLocations','SetLocations is deprecated and may be removed in a future version.', 'DeprecationWarning'); - return this.innerApiCalls.setLocations(request, options, callback); - } -/** - * Updates the master for a specific cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string} request.masterVersion - * 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 - * @param {string} request.name - * The name (project, location, cluster) of the cluster to update. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.update_master.js - * region_tag:container_v1_generated_ClusterManager_UpdateMaster_async - */ - updateMaster( - request?: protos.google.container.v1.IUpdateMasterRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateMasterRequest|undefined, {}|undefined - ]>; - updateMaster( - request: protos.google.container.v1.IUpdateMasterRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateMasterRequest|null|undefined, - {}|null|undefined>): void; - updateMaster( - request: protos.google.container.v1.IUpdateMasterRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateMasterRequest|null|undefined, - {}|null|undefined>): void; - updateMaster( - request?: protos.google.container.v1.IUpdateMasterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateMasterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateMasterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateMasterRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateMaster(request, options, callback); - } -/** - * Sets master auth materials. Currently supports changing the admin password - * or a specific cluster, either via password generation or explicitly setting - * the password. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {google.container.v1.SetMasterAuthRequest.Action} request.action - * Required. The exact form of action to be taken on the master auth. - * @param {google.container.v1.MasterAuth} request.update - * Required. A description of the update. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to set auth. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.set_master_auth.js - * region_tag:container_v1_generated_ClusterManager_SetMasterAuth_async - */ - setMasterAuth( - request?: protos.google.container.v1.ISetMasterAuthRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMasterAuthRequest|undefined, {}|undefined - ]>; - setMasterAuth( - request: protos.google.container.v1.ISetMasterAuthRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMasterAuthRequest|null|undefined, - {}|null|undefined>): void; - setMasterAuth( - request: protos.google.container.v1.ISetMasterAuthRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMasterAuthRequest|null|undefined, - {}|null|undefined>): void; - setMasterAuth( - request?: protos.google.container.v1.ISetMasterAuthRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMasterAuthRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMasterAuthRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMasterAuthRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setMasterAuth(request, options, callback); - } -/** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to delete. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to delete. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.delete_cluster.js - * region_tag:container_v1_generated_ClusterManager_DeleteCluster_async - */ - deleteCluster( - request?: protos.google.container.v1.IDeleteClusterRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IDeleteClusterRequest|undefined, {}|undefined - ]>; - deleteCluster( - request: protos.google.container.v1.IDeleteClusterRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IDeleteClusterRequest|null|undefined, - {}|null|undefined>): void; - deleteCluster( - request: protos.google.container.v1.IDeleteClusterRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IDeleteClusterRequest|null|undefined, - {}|null|undefined>): void; - deleteCluster( - request?: protos.google.container.v1.IDeleteClusterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IDeleteClusterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IDeleteClusterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IDeleteClusterRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteCluster(request, options, callback); - } -/** - * Lists all operations in a project in a specific zone or all zones. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the parent field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) to return - * operations for, or `-` for all zones. This field has been deprecated and - * replaced by the parent field. - * @param {string} request.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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.ListOperationsResponse | ListOperationsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.list_operations.js - * region_tag:container_v1_generated_ClusterManager_ListOperations_async - */ - listOperations( - request?: protos.google.container.v1.IListOperationsRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IListOperationsResponse, - protos.google.container.v1.IListOperationsRequest|undefined, {}|undefined - ]>; - listOperations( - request: protos.google.container.v1.IListOperationsRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IListOperationsResponse, - protos.google.container.v1.IListOperationsRequest|null|undefined, - {}|null|undefined>): void; - listOperations( - request: protos.google.container.v1.IListOperationsRequest, - callback: Callback< - protos.google.container.v1.IListOperationsResponse, - protos.google.container.v1.IListOperationsRequest|null|undefined, - {}|null|undefined>): void; - listOperations( - request?: protos.google.container.v1.IListOperationsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IListOperationsResponse, - protos.google.container.v1.IListOperationsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IListOperationsResponse, - protos.google.container.v1.IListOperationsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IListOperationsResponse, - protos.google.container.v1.IListOperationsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - }); - this.initialize(); - return this.innerApiCalls.listOperations(request, options, callback); - } -/** - * Gets the specified operation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.operationId - * Deprecated. The server-assigned `name` of the operation. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, operation id) of the operation to get. - * Specified in the format `projects/* /locations/* /operations/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.get_operation.js - * region_tag:container_v1_generated_ClusterManager_GetOperation_async - */ - getOperation( - request?: protos.google.container.v1.IGetOperationRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IGetOperationRequest|undefined, {}|undefined - ]>; - getOperation( - request: protos.google.container.v1.IGetOperationRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IGetOperationRequest|null|undefined, - {}|null|undefined>): void; - getOperation( - request: protos.google.container.v1.IGetOperationRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IGetOperationRequest|null|undefined, - {}|null|undefined>): void; - getOperation( - request?: protos.google.container.v1.IGetOperationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IGetOperationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IGetOperationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IGetOperationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'operation_id': request.operationId ?? '', - }); - this.initialize(); - return this.innerApiCalls.getOperation(request, options, callback); - } -/** - * Cancels the specified operation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * operation resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.operationId - * Deprecated. The server-assigned `name` of the operation. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, operation id) of the operation to cancel. - * Specified in the format `projects/* /locations/* /operations/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.cancel_operation.js - * region_tag:container_v1_generated_ClusterManager_CancelOperation_async - */ - cancelOperation( - request?: protos.google.container.v1.ICancelOperationRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.container.v1.ICancelOperationRequest|undefined, {}|undefined - ]>; - cancelOperation( - request: protos.google.container.v1.ICancelOperationRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1.ICancelOperationRequest|null|undefined, - {}|null|undefined>): void; - cancelOperation( - request: protos.google.container.v1.ICancelOperationRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1.ICancelOperationRequest|null|undefined, - {}|null|undefined>): void; - cancelOperation( - request?: protos.google.container.v1.ICancelOperationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1.ICancelOperationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1.ICancelOperationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.container.v1.ICancelOperationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'operation_id': request.operationId ?? '', - }); - this.initialize(); - return this.innerApiCalls.cancelOperation(request, options, callback); - } -/** - * Returns configuration info about the Google Kubernetes Engine service. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) to return - * operations for. This field has been deprecated and replaced by the name - * field. - * @param {string} request.name - * The name (project and location) of the server config to get, - * specified in the format `projects/* /locations/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.ServerConfig | ServerConfig}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.get_server_config.js - * region_tag:container_v1_generated_ClusterManager_GetServerConfig_async - */ - getServerConfig( - request?: protos.google.container.v1.IGetServerConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IServerConfig, - protos.google.container.v1.IGetServerConfigRequest|undefined, {}|undefined - ]>; - getServerConfig( - request: protos.google.container.v1.IGetServerConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IServerConfig, - protos.google.container.v1.IGetServerConfigRequest|null|undefined, - {}|null|undefined>): void; - getServerConfig( - request: protos.google.container.v1.IGetServerConfigRequest, - callback: Callback< - protos.google.container.v1.IServerConfig, - protos.google.container.v1.IGetServerConfigRequest|null|undefined, - {}|null|undefined>): void; - getServerConfig( - request?: protos.google.container.v1.IGetServerConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IServerConfig, - protos.google.container.v1.IGetServerConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IServerConfig, - protos.google.container.v1.IGetServerConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IServerConfig, - protos.google.container.v1.IGetServerConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - }); - this.initialize(); - return this.innerApiCalls.getServerConfig(request, options, callback); - } -/** - * Gets the public component of the cluster signing keys in - * JSON Web Key format. - * This API is not yet intended for general use, and is not available for all - * clusters. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The cluster (project, location, cluster name) to get keys for. Specified in - * the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.GetJSONWebKeysResponse | GetJSONWebKeysResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.get_j_s_o_n_web_keys.js - * region_tag:container_v1_generated_ClusterManager_GetJSONWebKeys_async - */ - getJSONWebKeys( - request?: protos.google.container.v1.IGetJSONWebKeysRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IGetJSONWebKeysResponse, - protos.google.container.v1.IGetJSONWebKeysRequest|undefined, {}|undefined - ]>; - getJSONWebKeys( - request: protos.google.container.v1.IGetJSONWebKeysRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IGetJSONWebKeysResponse, - protos.google.container.v1.IGetJSONWebKeysRequest|null|undefined, - {}|null|undefined>): void; - getJSONWebKeys( - request: protos.google.container.v1.IGetJSONWebKeysRequest, - callback: Callback< - protos.google.container.v1.IGetJSONWebKeysResponse, - protos.google.container.v1.IGetJSONWebKeysRequest|null|undefined, - {}|null|undefined>): void; - getJSONWebKeys( - request?: protos.google.container.v1.IGetJSONWebKeysRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IGetJSONWebKeysResponse, - protos.google.container.v1.IGetJSONWebKeysRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IGetJSONWebKeysResponse, - protos.google.container.v1.IGetJSONWebKeysRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IGetJSONWebKeysResponse, - protos.google.container.v1.IGetJSONWebKeysRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.getJsonWebKeys(request, options, callback); - } -/** - * Lists the node pools for a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the parent field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the parent - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the parent field. - * @param {string} request.parent - * The parent (project, location, cluster name) where the node pools will be - * listed. Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.ListNodePoolsResponse | ListNodePoolsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.list_node_pools.js - * region_tag:container_v1_generated_ClusterManager_ListNodePools_async - */ - listNodePools( - request?: protos.google.container.v1.IListNodePoolsRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IListNodePoolsResponse, - protos.google.container.v1.IListNodePoolsRequest|undefined, {}|undefined - ]>; - listNodePools( - request: protos.google.container.v1.IListNodePoolsRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IListNodePoolsResponse, - protos.google.container.v1.IListNodePoolsRequest|null|undefined, - {}|null|undefined>): void; - listNodePools( - request: protos.google.container.v1.IListNodePoolsRequest, - callback: Callback< - protos.google.container.v1.IListNodePoolsResponse, - protos.google.container.v1.IListNodePoolsRequest|null|undefined, - {}|null|undefined>): void; - listNodePools( - request?: protos.google.container.v1.IListNodePoolsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IListNodePoolsResponse, - protos.google.container.v1.IListNodePoolsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IListNodePoolsResponse, - protos.google.container.v1.IListNodePoolsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IListNodePoolsResponse, - protos.google.container.v1.IListNodePoolsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.listNodePools(request, options, callback); - } -/** - * Retrieves the requested node pool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Deprecated. The name of the node pool. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster, node pool id) of the node pool to - * get. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.NodePool | NodePool}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.get_node_pool.js - * region_tag:container_v1_generated_ClusterManager_GetNodePool_async - */ - getNodePool( - request?: protos.google.container.v1.IGetNodePoolRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.INodePool, - protos.google.container.v1.IGetNodePoolRequest|undefined, {}|undefined - ]>; - getNodePool( - request: protos.google.container.v1.IGetNodePoolRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.INodePool, - protos.google.container.v1.IGetNodePoolRequest|null|undefined, - {}|null|undefined>): void; - getNodePool( - request: protos.google.container.v1.IGetNodePoolRequest, - callback: Callback< - protos.google.container.v1.INodePool, - protos.google.container.v1.IGetNodePoolRequest|null|undefined, - {}|null|undefined>): void; - getNodePool( - request?: protos.google.container.v1.IGetNodePoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.INodePool, - protos.google.container.v1.IGetNodePoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.INodePool, - protos.google.container.v1.IGetNodePoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.INodePool, - protos.google.container.v1.IGetNodePoolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.getNodePool(request, options, callback); - } -/** - * Creates a node pool for a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the parent field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the parent - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the parent field. - * @param {google.container.v1.NodePool} request.nodePool - * Required. The node pool to create. - * @param {string} request.parent - * The parent (project, location, cluster name) where the node pool will be - * created. Specified in the format - * `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.create_node_pool.js - * region_tag:container_v1_generated_ClusterManager_CreateNodePool_async - */ - createNodePool( - request?: protos.google.container.v1.ICreateNodePoolRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ICreateNodePoolRequest|undefined, {}|undefined - ]>; - createNodePool( - request: protos.google.container.v1.ICreateNodePoolRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ICreateNodePoolRequest|null|undefined, - {}|null|undefined>): void; - createNodePool( - request: protos.google.container.v1.ICreateNodePoolRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ICreateNodePoolRequest|null|undefined, - {}|null|undefined>): void; - createNodePool( - request?: protos.google.container.v1.ICreateNodePoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ICreateNodePoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ICreateNodePoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ICreateNodePoolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.createNodePool(request, options, callback); - } -/** - * Deletes a node pool from a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Deprecated. The name of the node pool to delete. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster, node pool id) of the node pool to - * delete. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.delete_node_pool.js - * region_tag:container_v1_generated_ClusterManager_DeleteNodePool_async - */ - deleteNodePool( - request?: protos.google.container.v1.IDeleteNodePoolRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IDeleteNodePoolRequest|undefined, {}|undefined - ]>; - deleteNodePool( - request: protos.google.container.v1.IDeleteNodePoolRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IDeleteNodePoolRequest|null|undefined, - {}|null|undefined>): void; - deleteNodePool( - request: protos.google.container.v1.IDeleteNodePoolRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IDeleteNodePoolRequest|null|undefined, - {}|null|undefined>): void; - deleteNodePool( - request?: protos.google.container.v1.IDeleteNodePoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IDeleteNodePoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IDeleteNodePoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IDeleteNodePoolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteNodePool(request, options, callback); - } -/** - * CompleteNodePoolUpgrade will signal an on-going node pool upgrade to - * complete. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The name (project, location, cluster, node pool id) of the node pool to - * complete upgrade. - * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js - * region_tag:container_v1_generated_ClusterManager_CompleteNodePoolUpgrade_async - */ - completeNodePoolUpgrade( - request?: protos.google.container.v1.ICompleteNodePoolUpgradeRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.container.v1.ICompleteNodePoolUpgradeRequest|undefined, {}|undefined - ]>; - completeNodePoolUpgrade( - request: protos.google.container.v1.ICompleteNodePoolUpgradeRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1.ICompleteNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>): void; - completeNodePoolUpgrade( - request: protos.google.container.v1.ICompleteNodePoolUpgradeRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1.ICompleteNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>): void; - completeNodePoolUpgrade( - request?: protos.google.container.v1.ICompleteNodePoolUpgradeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1.ICompleteNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1.ICompleteNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.container.v1.ICompleteNodePoolUpgradeRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.completeNodePoolUpgrade(request, options, callback); - } -/** - * Rolls back a previously Aborted or Failed NodePool upgrade. - * This makes no changes if the last upgrade successfully completed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to rollback. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Deprecated. The name of the node pool to rollback. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster, node pool id) of the node poll to - * rollback upgrade. - * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {boolean} request.respectPdb - * Option for rollback to ignore the PodDisruptionBudget. - * Default value is false. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.rollback_node_pool_upgrade.js - * region_tag:container_v1_generated_ClusterManager_RollbackNodePoolUpgrade_async - */ - rollbackNodePoolUpgrade( - request?: protos.google.container.v1.IRollbackNodePoolUpgradeRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IRollbackNodePoolUpgradeRequest|undefined, {}|undefined - ]>; - rollbackNodePoolUpgrade( - request: protos.google.container.v1.IRollbackNodePoolUpgradeRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IRollbackNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>): void; - rollbackNodePoolUpgrade( - request: protos.google.container.v1.IRollbackNodePoolUpgradeRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IRollbackNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>): void; - rollbackNodePoolUpgrade( - request?: protos.google.container.v1.IRollbackNodePoolUpgradeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IRollbackNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IRollbackNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IRollbackNodePoolUpgradeRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.rollbackNodePoolUpgrade(request, options, callback); - } -/** - * Sets the NodeManagement options for a node pool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to update. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Deprecated. The name of the node pool to update. - * This field has been deprecated and replaced by the name field. - * @param {google.container.v1.NodeManagement} request.management - * Required. NodeManagement configuration for the node pool. - * @param {string} request.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/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.set_node_pool_management.js - * region_tag:container_v1_generated_ClusterManager_SetNodePoolManagement_async - */ - setNodePoolManagement( - request?: protos.google.container.v1.ISetNodePoolManagementRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolManagementRequest|undefined, {}|undefined - ]>; - setNodePoolManagement( - request: protos.google.container.v1.ISetNodePoolManagementRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolManagementRequest|null|undefined, - {}|null|undefined>): void; - setNodePoolManagement( - request: protos.google.container.v1.ISetNodePoolManagementRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolManagementRequest|null|undefined, - {}|null|undefined>): void; - setNodePoolManagement( - request?: protos.google.container.v1.ISetNodePoolManagementRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolManagementRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolManagementRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolManagementRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setNodePoolManagement(request, options, callback); - } -/** - * Sets labels on a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the name field. - * @param {number[]} request.resourceLabels - * Required. The labels to set for that cluster. - * @param {string} request.labelFingerprint - * 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. - * @param {string} request.name - * The name (project, location, cluster name) of the cluster to set labels. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.set_labels.js - * region_tag:container_v1_generated_ClusterManager_SetLabels_async - */ - setLabels( - request?: protos.google.container.v1.ISetLabelsRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLabelsRequest|undefined, {}|undefined - ]>; - setLabels( - request: protos.google.container.v1.ISetLabelsRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLabelsRequest|null|undefined, - {}|null|undefined>): void; - setLabels( - request: protos.google.container.v1.ISetLabelsRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLabelsRequest|null|undefined, - {}|null|undefined>): void; - setLabels( - request?: protos.google.container.v1.ISetLabelsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLabelsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLabelsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLabelsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setLabels(request, options, callback); - } -/** - * Enables or disables the ABAC authorization mechanism on a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to update. - * This field has been deprecated and replaced by the name field. - * @param {boolean} request.enabled - * Required. Whether ABAC authorization will be enabled in the cluster. - * @param {string} request.name - * The name (project, location, cluster name) of the cluster to set legacy - * abac. Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.set_legacy_abac.js - * region_tag:container_v1_generated_ClusterManager_SetLegacyAbac_async - */ - setLegacyAbac( - request?: protos.google.container.v1.ISetLegacyAbacRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLegacyAbacRequest|undefined, {}|undefined - ]>; - setLegacyAbac( - request: protos.google.container.v1.ISetLegacyAbacRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLegacyAbacRequest|null|undefined, - {}|null|undefined>): void; - setLegacyAbac( - request: protos.google.container.v1.ISetLegacyAbacRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLegacyAbacRequest|null|undefined, - {}|null|undefined>): void; - setLegacyAbac( - request?: protos.google.container.v1.ISetLegacyAbacRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLegacyAbacRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLegacyAbacRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLegacyAbacRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setLegacyAbac(request, options, callback); - } -/** - * Starts master IP rotation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster name) of the cluster to start IP - * rotation. Specified in the format `projects/* /locations/* /clusters/*`. - * @param {boolean} request.rotateCredentials - * Whether to rotate credentials during IP rotation. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.start_i_p_rotation.js - * region_tag:container_v1_generated_ClusterManager_StartIPRotation_async - */ - startIPRotation( - request?: protos.google.container.v1.IStartIPRotationRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IStartIPRotationRequest|undefined, {}|undefined - ]>; - startIPRotation( - request: protos.google.container.v1.IStartIPRotationRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IStartIPRotationRequest|null|undefined, - {}|null|undefined>): void; - startIPRotation( - request: protos.google.container.v1.IStartIPRotationRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IStartIPRotationRequest|null|undefined, - {}|null|undefined>): void; - startIPRotation( - request?: protos.google.container.v1.IStartIPRotationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IStartIPRotationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IStartIPRotationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IStartIPRotationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.startIpRotation(request, options, callback); - } -/** - * Completes master IP rotation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster name) of the cluster to complete IP - * rotation. Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.complete_i_p_rotation.js - * region_tag:container_v1_generated_ClusterManager_CompleteIPRotation_async - */ - completeIPRotation( - request?: protos.google.container.v1.ICompleteIPRotationRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ICompleteIPRotationRequest|undefined, {}|undefined - ]>; - completeIPRotation( - request: protos.google.container.v1.ICompleteIPRotationRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ICompleteIPRotationRequest|null|undefined, - {}|null|undefined>): void; - completeIPRotation( - request: protos.google.container.v1.ICompleteIPRotationRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ICompleteIPRotationRequest|null|undefined, - {}|null|undefined>): void; - completeIPRotation( - request?: protos.google.container.v1.ICompleteIPRotationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ICompleteIPRotationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ICompleteIPRotationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ICompleteIPRotationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.completeIpRotation(request, options, callback); - } -/** - * Sets the size for a specific node pool. The new size will be used for all - * replicas, including future replicas created by modifying - * {@link google.container.v1.NodePool.locations|NodePool.locations}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to update. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Deprecated. The name of the node pool to update. - * This field has been deprecated and replaced by the name field. - * @param {number} request.nodeCount - * Required. The desired node count for the pool. - * @param {string} request.name - * The name (project, location, cluster, node pool id) of the node pool to set - * size. - * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.set_node_pool_size.js - * region_tag:container_v1_generated_ClusterManager_SetNodePoolSize_async - */ - setNodePoolSize( - request?: protos.google.container.v1.ISetNodePoolSizeRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolSizeRequest|undefined, {}|undefined - ]>; - setNodePoolSize( - request: protos.google.container.v1.ISetNodePoolSizeRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolSizeRequest|null|undefined, - {}|null|undefined>): void; - setNodePoolSize( - request: protos.google.container.v1.ISetNodePoolSizeRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolSizeRequest|null|undefined, - {}|null|undefined>): void; - setNodePoolSize( - request?: protos.google.container.v1.ISetNodePoolSizeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolSizeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolSizeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolSizeRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setNodePoolSize(request, options, callback); - } -/** - * Enables or disables Network Policy for a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the name field. - * @param {google.container.v1.NetworkPolicy} request.networkPolicy - * Required. Configuration options for the NetworkPolicy feature. - * @param {string} request.name - * The name (project, location, cluster name) of the cluster to set networking - * policy. Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.set_network_policy.js - * region_tag:container_v1_generated_ClusterManager_SetNetworkPolicy_async - */ - setNetworkPolicy( - request?: protos.google.container.v1.ISetNetworkPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNetworkPolicyRequest|undefined, {}|undefined - ]>; - setNetworkPolicy( - request: protos.google.container.v1.ISetNetworkPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNetworkPolicyRequest|null|undefined, - {}|null|undefined>): void; - setNetworkPolicy( - request: protos.google.container.v1.ISetNetworkPolicyRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNetworkPolicyRequest|null|undefined, - {}|null|undefined>): void; - setNetworkPolicy( - request?: protos.google.container.v1.ISetNetworkPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNetworkPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNetworkPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNetworkPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setNetworkPolicy(request, options, callback); - } -/** - * Sets the maintenance policy for a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * @param {string} request.zone - * Required. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. - * @param {string} request.clusterId - * Required. The name of the cluster to update. - * @param {google.container.v1.MaintenancePolicy} request.maintenancePolicy - * Required. The maintenance policy to be set for the cluster. An empty field - * clears the existing maintenance policy. - * @param {string} request.name - * The name (project, location, cluster name) of the cluster to set - * maintenance policy. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.set_maintenance_policy.js - * region_tag:container_v1_generated_ClusterManager_SetMaintenancePolicy_async - */ - setMaintenancePolicy( - request?: protos.google.container.v1.ISetMaintenancePolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMaintenancePolicyRequest|undefined, {}|undefined - ]>; - setMaintenancePolicy( - request: protos.google.container.v1.ISetMaintenancePolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMaintenancePolicyRequest|null|undefined, - {}|null|undefined>): void; - setMaintenancePolicy( - request: protos.google.container.v1.ISetMaintenancePolicyRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMaintenancePolicyRequest|null|undefined, - {}|null|undefined>): void; - setMaintenancePolicy( - request?: protos.google.container.v1.ISetMaintenancePolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMaintenancePolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMaintenancePolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMaintenancePolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setMaintenancePolicy(request, options, callback); - } -/** - * Checks the cluster compatibility with Autopilot mode, and returns a list of - * compatibility issues. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to retrieve. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.CheckAutopilotCompatibilityResponse | CheckAutopilotCompatibilityResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.check_autopilot_compatibility.js - * region_tag:container_v1_generated_ClusterManager_CheckAutopilotCompatibility_async - */ - checkAutopilotCompatibility( - request?: protos.google.container.v1.ICheckAutopilotCompatibilityRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.ICheckAutopilotCompatibilityResponse, - protos.google.container.v1.ICheckAutopilotCompatibilityRequest|undefined, {}|undefined - ]>; - checkAutopilotCompatibility( - request: protos.google.container.v1.ICheckAutopilotCompatibilityRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.ICheckAutopilotCompatibilityResponse, - protos.google.container.v1.ICheckAutopilotCompatibilityRequest|null|undefined, - {}|null|undefined>): void; - checkAutopilotCompatibility( - request: protos.google.container.v1.ICheckAutopilotCompatibilityRequest, - callback: Callback< - protos.google.container.v1.ICheckAutopilotCompatibilityResponse, - protos.google.container.v1.ICheckAutopilotCompatibilityRequest|null|undefined, - {}|null|undefined>): void; - checkAutopilotCompatibility( - request?: protos.google.container.v1.ICheckAutopilotCompatibilityRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.ICheckAutopilotCompatibilityResponse, - protos.google.container.v1.ICheckAutopilotCompatibilityRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.ICheckAutopilotCompatibilityResponse, - protos.google.container.v1.ICheckAutopilotCompatibilityRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.ICheckAutopilotCompatibilityResponse, - protos.google.container.v1.ICheckAutopilotCompatibilityRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.checkAutopilotCompatibility(request, options, callback); - } - - /** - * Lists subnetworks that are usable for creating clusters in a project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The parent project where subnetworks are usable. - * Specified in the format `projects/*`. - * @param {string} request.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. - * @param {number} request.pageSize - * 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) - * @param {string} request.pageToken - * Specifies a page token to use. Set this to the nextPageToken returned by - * previous list requests to get the next page of results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link google.container.v1.UsableSubnetwork | UsableSubnetwork}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listUsableSubnetworksAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listUsableSubnetworks( - request?: protos.google.container.v1.IListUsableSubnetworksRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IUsableSubnetwork[], - protos.google.container.v1.IListUsableSubnetworksRequest|null, - protos.google.container.v1.IListUsableSubnetworksResponse - ]>; - listUsableSubnetworks( - request: protos.google.container.v1.IListUsableSubnetworksRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.container.v1.IListUsableSubnetworksRequest, - protos.google.container.v1.IListUsableSubnetworksResponse|null|undefined, - protos.google.container.v1.IUsableSubnetwork>): void; - listUsableSubnetworks( - request: protos.google.container.v1.IListUsableSubnetworksRequest, - callback: PaginationCallback< - protos.google.container.v1.IListUsableSubnetworksRequest, - protos.google.container.v1.IListUsableSubnetworksResponse|null|undefined, - protos.google.container.v1.IUsableSubnetwork>): void; - listUsableSubnetworks( - request?: protos.google.container.v1.IListUsableSubnetworksRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.container.v1.IListUsableSubnetworksRequest, - protos.google.container.v1.IListUsableSubnetworksResponse|null|undefined, - protos.google.container.v1.IUsableSubnetwork>, - callback?: PaginationCallback< - protos.google.container.v1.IListUsableSubnetworksRequest, - protos.google.container.v1.IListUsableSubnetworksResponse|null|undefined, - protos.google.container.v1.IUsableSubnetwork>): - Promise<[ - protos.google.container.v1.IUsableSubnetwork[], - protos.google.container.v1.IListUsableSubnetworksRequest|null, - protos.google.container.v1.IListUsableSubnetworksResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listUsableSubnetworks(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The parent project where subnetworks are usable. - * Specified in the format `projects/*`. - * @param {string} request.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. - * @param {number} request.pageSize - * 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) - * @param {string} request.pageToken - * Specifies a page token to use. Set this to the nextPageToken returned by - * previous list requests to get the next page of results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link google.container.v1.UsableSubnetwork | UsableSubnetwork} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listUsableSubnetworksAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listUsableSubnetworksStream( - request?: protos.google.container.v1.IListUsableSubnetworksRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listUsableSubnetworks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listUsableSubnetworks.createStream( - this.innerApiCalls.listUsableSubnetworks as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listUsableSubnetworks`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The parent project where subnetworks are usable. - * Specified in the format `projects/*`. - * @param {string} request.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. - * @param {number} request.pageSize - * 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) - * @param {string} request.pageToken - * Specifies a page token to use. Set this to the nextPageToken returned by - * previous list requests to get the next page of results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * {@link google.container.v1.UsableSubnetwork | UsableSubnetwork}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.list_usable_subnetworks.js - * region_tag:container_v1_generated_ClusterManager_ListUsableSubnetworks_async - */ - listUsableSubnetworksAsync( - request?: protos.google.container.v1.IListUsableSubnetworksRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listUsableSubnetworks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listUsableSubnetworks.asyncIterate( - this.innerApiCalls['listUsableSubnetworks'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.clusterManagerStub && !this._terminated) { - return this.clusterManagerStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-container/v1/src/v1/cluster_manager_client_config.json b/owl-bot-staging/google-container/v1/src/v1/cluster_manager_client_config.json deleted file mode 100644 index 33fb266b6bd..00000000000 --- a/owl-bot-staging/google-container/v1/src/v1/cluster_manager_client_config.json +++ /dev/null @@ -1,192 +0,0 @@ -{ - "interfaces": { - "google.container.v1.ClusterManager": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListClusters": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetCluster": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateCluster": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateCluster": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateNodePool": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetNodePoolAutoscaling": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetLoggingService": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetMonitoringService": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetAddonsConfig": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetLocations": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateMaster": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetMasterAuth": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteCluster": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListOperations": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetOperation": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CancelOperation": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetServerConfig": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetJSONWebKeys": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListNodePools": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetNodePool": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateNodePool": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteNodePool": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CompleteNodePoolUpgrade": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RollbackNodePoolUpgrade": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetNodePoolManagement": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetLabels": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetLegacyAbac": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "StartIPRotation": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CompleteIPRotation": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetNodePoolSize": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetNetworkPolicy": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetMaintenancePolicy": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListUsableSubnetworks": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CheckAutopilotCompatibility": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-container/v1/src/v1/cluster_manager_proto_list.json b/owl-bot-staging/google-container/v1/src/v1/cluster_manager_proto_list.json deleted file mode 100644 index aa69748e51b..00000000000 --- a/owl-bot-staging/google-container/v1/src/v1/cluster_manager_proto_list.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - "../../protos/google/container/v1/cluster_service.proto" -] diff --git a/owl-bot-staging/google-container/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-container/v1/src/v1/gapic_metadata.json deleted file mode 100644 index c08b06ded09..00000000000 --- a/owl-bot-staging/google-container/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,367 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.container.v1", - "libraryPackage": "@google-cloud/container", - "services": { - "ClusterManager": { - "clients": { - "grpc": { - "libraryClient": "ClusterManagerClient", - "rpcs": { - "ListClusters": { - "methods": [ - "listClusters" - ] - }, - "GetCluster": { - "methods": [ - "getCluster" - ] - }, - "CreateCluster": { - "methods": [ - "createCluster" - ] - }, - "UpdateCluster": { - "methods": [ - "updateCluster" - ] - }, - "UpdateNodePool": { - "methods": [ - "updateNodePool" - ] - }, - "SetNodePoolAutoscaling": { - "methods": [ - "setNodePoolAutoscaling" - ] - }, - "SetLoggingService": { - "methods": [ - "setLoggingService" - ] - }, - "SetMonitoringService": { - "methods": [ - "setMonitoringService" - ] - }, - "SetAddonsConfig": { - "methods": [ - "setAddonsConfig" - ] - }, - "SetLocations": { - "methods": [ - "setLocations" - ] - }, - "UpdateMaster": { - "methods": [ - "updateMaster" - ] - }, - "SetMasterAuth": { - "methods": [ - "setMasterAuth" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "ListOperations": { - "methods": [ - "listOperations" - ] - }, - "GetOperation": { - "methods": [ - "getOperation" - ] - }, - "CancelOperation": { - "methods": [ - "cancelOperation" - ] - }, - "GetServerConfig": { - "methods": [ - "getServerConfig" - ] - }, - "GetJSONWebKeys": { - "methods": [ - "getJSONWebKeys" - ] - }, - "ListNodePools": { - "methods": [ - "listNodePools" - ] - }, - "GetNodePool": { - "methods": [ - "getNodePool" - ] - }, - "CreateNodePool": { - "methods": [ - "createNodePool" - ] - }, - "DeleteNodePool": { - "methods": [ - "deleteNodePool" - ] - }, - "CompleteNodePoolUpgrade": { - "methods": [ - "completeNodePoolUpgrade" - ] - }, - "RollbackNodePoolUpgrade": { - "methods": [ - "rollbackNodePoolUpgrade" - ] - }, - "SetNodePoolManagement": { - "methods": [ - "setNodePoolManagement" - ] - }, - "SetLabels": { - "methods": [ - "setLabels" - ] - }, - "SetLegacyAbac": { - "methods": [ - "setLegacyAbac" - ] - }, - "StartIPRotation": { - "methods": [ - "startIPRotation" - ] - }, - "CompleteIPRotation": { - "methods": [ - "completeIPRotation" - ] - }, - "SetNodePoolSize": { - "methods": [ - "setNodePoolSize" - ] - }, - "SetNetworkPolicy": { - "methods": [ - "setNetworkPolicy" - ] - }, - "SetMaintenancePolicy": { - "methods": [ - "setMaintenancePolicy" - ] - }, - "CheckAutopilotCompatibility": { - "methods": [ - "checkAutopilotCompatibility" - ] - }, - "ListUsableSubnetworks": { - "methods": [ - "listUsableSubnetworks", - "listUsableSubnetworksStream", - "listUsableSubnetworksAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "ClusterManagerClient", - "rpcs": { - "ListClusters": { - "methods": [ - "listClusters" - ] - }, - "GetCluster": { - "methods": [ - "getCluster" - ] - }, - "CreateCluster": { - "methods": [ - "createCluster" - ] - }, - "UpdateCluster": { - "methods": [ - "updateCluster" - ] - }, - "UpdateNodePool": { - "methods": [ - "updateNodePool" - ] - }, - "SetNodePoolAutoscaling": { - "methods": [ - "setNodePoolAutoscaling" - ] - }, - "SetLoggingService": { - "methods": [ - "setLoggingService" - ] - }, - "SetMonitoringService": { - "methods": [ - "setMonitoringService" - ] - }, - "SetAddonsConfig": { - "methods": [ - "setAddonsConfig" - ] - }, - "SetLocations": { - "methods": [ - "setLocations" - ] - }, - "UpdateMaster": { - "methods": [ - "updateMaster" - ] - }, - "SetMasterAuth": { - "methods": [ - "setMasterAuth" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "ListOperations": { - "methods": [ - "listOperations" - ] - }, - "GetOperation": { - "methods": [ - "getOperation" - ] - }, - "CancelOperation": { - "methods": [ - "cancelOperation" - ] - }, - "GetServerConfig": { - "methods": [ - "getServerConfig" - ] - }, - "GetJSONWebKeys": { - "methods": [ - "getJSONWebKeys" - ] - }, - "ListNodePools": { - "methods": [ - "listNodePools" - ] - }, - "GetNodePool": { - "methods": [ - "getNodePool" - ] - }, - "CreateNodePool": { - "methods": [ - "createNodePool" - ] - }, - "DeleteNodePool": { - "methods": [ - "deleteNodePool" - ] - }, - "CompleteNodePoolUpgrade": { - "methods": [ - "completeNodePoolUpgrade" - ] - }, - "RollbackNodePoolUpgrade": { - "methods": [ - "rollbackNodePoolUpgrade" - ] - }, - "SetNodePoolManagement": { - "methods": [ - "setNodePoolManagement" - ] - }, - "SetLabels": { - "methods": [ - "setLabels" - ] - }, - "SetLegacyAbac": { - "methods": [ - "setLegacyAbac" - ] - }, - "StartIPRotation": { - "methods": [ - "startIPRotation" - ] - }, - "CompleteIPRotation": { - "methods": [ - "completeIPRotation" - ] - }, - "SetNodePoolSize": { - "methods": [ - "setNodePoolSize" - ] - }, - "SetNetworkPolicy": { - "methods": [ - "setNetworkPolicy" - ] - }, - "SetMaintenancePolicy": { - "methods": [ - "setMaintenancePolicy" - ] - }, - "CheckAutopilotCompatibility": { - "methods": [ - "checkAutopilotCompatibility" - ] - }, - "ListUsableSubnetworks": { - "methods": [ - "listUsableSubnetworks", - "listUsableSubnetworksStream", - "listUsableSubnetworksAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-container/v1/src/v1/index.ts b/owl-bot-staging/google-container/v1/src/v1/index.ts deleted file mode 100644 index b1b39233034..00000000000 --- a/owl-bot-staging/google-container/v1/src/v1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {ClusterManagerClient} from './cluster_manager_client'; diff --git a/owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 1101d781caa..00000000000 --- a/owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const container = require('@google-cloud/container'); - -function main() { - const clusterManagerClient = new container.ClusterManagerClient(); -} - -main(); diff --git a/owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 6685b8649e6..00000000000 --- a/owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {ClusterManagerClient} from '@google-cloud/container'; - -// check that the client class type name can be used -function doStuffWithClusterManagerClient(client: ClusterManagerClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const clusterManagerClient = new ClusterManagerClient(); - doStuffWithClusterManagerClient(clusterManagerClient); -} - -main(); diff --git a/owl-bot-staging/google-container/v1/system-test/install.ts b/owl-bot-staging/google-container/v1/system-test/install.ts deleted file mode 100644 index c8f81b25a86..00000000000 --- a/owl-bot-staging/google-container/v1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/google-container/v1/test/gapic_cluster_manager_v1.ts b/owl-bot-staging/google-container/v1/test/gapic_cluster_manager_v1.ts deleted file mode 100644 index 9632e377d3a..00000000000 --- a/owl-bot-staging/google-container/v1/test/gapic_cluster_manager_v1.ts +++ /dev/null @@ -1,5130 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as clustermanagerModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.ClusterManagerClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = clustermanagerModule.v1.ClusterManagerClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = clustermanagerModule.v1.ClusterManagerClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = clustermanagerModule.v1.ClusterManagerClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new clustermanagerModule.v1.ClusterManagerClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.clusterManagerStub, undefined); - await client.initialize(); - assert(client.clusterManagerStub); - }); - - it('has close method for the initialized client', done => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.clusterManagerStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.clusterManagerStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - }); - - describe('listClusters', () => { - it('invokes listClusters without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.ListClustersResponse() - ); - client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); - const [response] = await client.listClusters(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClusters without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.ListClustersResponse() - ); - client.innerApiCalls.listClusters = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listClusters( - request, - (err?: Error|null, result?: protos.google.container.v1.IListClustersResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClusters with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listClusters = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listClusters(request), expectedError); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClusters with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['zone']); - request.zone = defaultValue3; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.listClusters(request), expectedError); - }); - }); - - describe('getCluster', () => { - it('invokes getCluster without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Cluster() - ); - client.innerApiCalls.getCluster = stubSimpleCall(expectedResponse); - const [response] = await client.getCluster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Cluster() - ); - client.innerApiCalls.getCluster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCluster( - request, - (err?: Error|null, result?: protos.google.container.v1.ICluster|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCluster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getCluster(request), expectedError); - }); - }); - - describe('createCluster', () => { - it('invokes createCluster without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.createCluster = stubSimpleCall(expectedResponse); - const [response] = await client.createCluster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.createCluster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCluster( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCluster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['zone']); - request.zone = defaultValue3; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createCluster(request), expectedError); - }); - }); - - describe('updateCluster', () => { - it('invokes updateCluster without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.UpdateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.updateCluster = stubSimpleCall(expectedResponse); - const [response] = await client.updateCluster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.UpdateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.updateCluster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateCluster( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.UpdateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCluster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.UpdateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateCluster(request), expectedError); - }); - }); - - describe('updateNodePool', () => { - it('invokes updateNodePool without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.UpdateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.updateNodePool = stubSimpleCall(expectedResponse); - const [response] = await client.updateNodePool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateNodePool without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.UpdateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.updateNodePool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateNodePool( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateNodePool with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.UpdateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateNodePool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateNodePool(request), expectedError); - const actualRequest = (client.innerApiCalls.updateNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateNodePool with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.UpdateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateNodePool(request), expectedError); - }); - }); - - describe('setNodePoolAutoscaling', () => { - it('invokes setNodePoolAutoscaling without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNodePoolAutoscalingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCall(expectedResponse); - const [response] = await client.setNodePoolAutoscaling(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolAutoscaling without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNodePoolAutoscalingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setNodePoolAutoscaling( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolAutoscaling with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNodePoolAutoscalingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setNodePoolAutoscaling(request), expectedError); - const actualRequest = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolAutoscaling with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNodePoolAutoscalingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setNodePoolAutoscaling(request), expectedError); - }); - }); - - describe('setLoggingService', () => { - it('invokes setLoggingService without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLoggingServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setLoggingService = stubSimpleCall(expectedResponse); - const [response] = await client.setLoggingService(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLoggingService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLoggingService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLoggingService without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLoggingServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setLoggingService = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setLoggingService( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLoggingService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLoggingService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLoggingService with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLoggingServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setLoggingService = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setLoggingService(request), expectedError); - const actualRequest = (client.innerApiCalls.setLoggingService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLoggingService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLoggingService with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLoggingServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setLoggingService(request), expectedError); - }); - }); - - describe('setMonitoringService', () => { - it('invokes setMonitoringService without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetMonitoringServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setMonitoringService = stubSimpleCall(expectedResponse); - const [response] = await client.setMonitoringService(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setMonitoringService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMonitoringService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMonitoringService without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetMonitoringServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setMonitoringService = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setMonitoringService( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setMonitoringService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMonitoringService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMonitoringService with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetMonitoringServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setMonitoringService = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setMonitoringService(request), expectedError); - const actualRequest = (client.innerApiCalls.setMonitoringService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMonitoringService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMonitoringService with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetMonitoringServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setMonitoringService(request), expectedError); - }); - }); - - describe('setAddonsConfig', () => { - it('invokes setAddonsConfig without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetAddonsConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setAddonsConfig = stubSimpleCall(expectedResponse); - const [response] = await client.setAddonsConfig(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setAddonsConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setAddonsConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setAddonsConfig without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetAddonsConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setAddonsConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setAddonsConfig( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setAddonsConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setAddonsConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setAddonsConfig with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetAddonsConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setAddonsConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setAddonsConfig(request), expectedError); - const actualRequest = (client.innerApiCalls.setAddonsConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setAddonsConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setAddonsConfig with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetAddonsConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setAddonsConfig(request), expectedError); - }); - }); - - describe('setLocations', () => { - it('invokes setLocations without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLocationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setLocations = stubSimpleCall(expectedResponse); - const [response] = await client.setLocations(request); - assert(stub.calledOnce); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLocations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLocations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLocations without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLocationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setLocations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setLocations( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert(stub.calledOnce); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLocations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLocations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLocations with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLocationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setLocations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setLocations(request), expectedError); - assert(stub.calledOnce); - const actualRequest = (client.innerApiCalls.setLocations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLocations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLocations with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLocationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setLocations(request), expectedError); - assert(stub.calledOnce); - }); - }); - - describe('updateMaster', () => { - it('invokes updateMaster without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.UpdateMasterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.updateMaster = stubSimpleCall(expectedResponse); - const [response] = await client.updateMaster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateMaster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateMaster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateMaster without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.UpdateMasterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.updateMaster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateMaster( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateMaster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateMaster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateMaster with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.UpdateMasterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateMaster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateMaster(request), expectedError); - const actualRequest = (client.innerApiCalls.updateMaster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateMaster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateMaster with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.UpdateMasterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateMaster(request), expectedError); - }); - }); - - describe('setMasterAuth', () => { - it('invokes setMasterAuth without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetMasterAuthRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setMasterAuth = stubSimpleCall(expectedResponse); - const [response] = await client.setMasterAuth(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setMasterAuth as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMasterAuth as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMasterAuth without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetMasterAuthRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setMasterAuth = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setMasterAuth( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setMasterAuth as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMasterAuth as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMasterAuth with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetMasterAuthRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setMasterAuth = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setMasterAuth(request), expectedError); - const actualRequest = (client.innerApiCalls.setMasterAuth as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMasterAuth as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMasterAuth with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetMasterAuthRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setMasterAuth(request), expectedError); - }); - }); - - describe('deleteCluster', () => { - it('invokes deleteCluster without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.deleteCluster = stubSimpleCall(expectedResponse); - const [response] = await client.deleteCluster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.deleteCluster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteCluster( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCluster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteCluster(request), expectedError); - }); - }); - - describe('listOperations', () => { - it('invokes listOperations without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.ListOperationsResponse() - ); - client.innerApiCalls.listOperations = stubSimpleCall(expectedResponse); - const [response] = await client.listOperations(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listOperations without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.ListOperationsResponse() - ); - client.innerApiCalls.listOperations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listOperations( - request, - (err?: Error|null, result?: protos.google.container.v1.IListOperationsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listOperations with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listOperations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listOperations(request), expectedError); - const actualRequest = (client.innerApiCalls.listOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listOperations with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['zone']); - request.zone = defaultValue3; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.listOperations(request), expectedError); - }); - }); - - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.getOperation = stubSimpleCall(expectedResponse); - const [response] = await client.getOperation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getOperation without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.getOperation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getOperation( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getOperation with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getOperation(request), expectedError); - const actualRequest = (client.innerApiCalls.getOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getOperation with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getOperation(request), expectedError); - }); - }); - - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CancelOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.cancelOperation = stubSimpleCall(expectedResponse); - const [response] = await client.cancelOperation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelOperation without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CancelOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.cancelOperation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelOperation( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelOperation with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CancelOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelOperation(request), expectedError); - const actualRequest = (client.innerApiCalls.cancelOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelOperation with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CancelOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.cancelOperation(request), expectedError); - }); - }); - - describe('getServerConfig', () => { - it('invokes getServerConfig without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetServerConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.ServerConfig() - ); - client.innerApiCalls.getServerConfig = stubSimpleCall(expectedResponse); - const [response] = await client.getServerConfig(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getServerConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getServerConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getServerConfig without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetServerConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.ServerConfig() - ); - client.innerApiCalls.getServerConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getServerConfig( - request, - (err?: Error|null, result?: protos.google.container.v1.IServerConfig|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getServerConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getServerConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getServerConfig with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetServerConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getServerConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getServerConfig(request), expectedError); - const actualRequest = (client.innerApiCalls.getServerConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getServerConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getServerConfig with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetServerConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['zone']); - request.zone = defaultValue3; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getServerConfig(request), expectedError); - }); - }); - - describe('getJSONWebKeys', () => { - it('invokes getJSONWebKeys without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetJSONWebKeysRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetJSONWebKeysRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.GetJSONWebKeysResponse() - ); - client.innerApiCalls.getJsonWebKeys = stubSimpleCall(expectedResponse); - const [response] = await client.getJSONWebKeys(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getJsonWebKeys as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJsonWebKeys as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJSONWebKeys without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetJSONWebKeysRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetJSONWebKeysRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.GetJSONWebKeysResponse() - ); - client.innerApiCalls.getJsonWebKeys = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getJSONWebKeys( - request, - (err?: Error|null, result?: protos.google.container.v1.IGetJSONWebKeysResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getJsonWebKeys as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJsonWebKeys as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJSONWebKeys with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetJSONWebKeysRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetJSONWebKeysRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getJsonWebKeys = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getJSONWebKeys(request), expectedError); - const actualRequest = (client.innerApiCalls.getJsonWebKeys as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJsonWebKeys as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJSONWebKeys with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetJSONWebKeysRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetJSONWebKeysRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getJSONWebKeys(request), expectedError); - }); - }); - - describe('listNodePools', () => { - it('invokes listNodePools without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListNodePoolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.ListNodePoolsResponse() - ); - client.innerApiCalls.listNodePools = stubSimpleCall(expectedResponse); - const [response] = await client.listNodePools(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listNodePools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNodePools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNodePools without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListNodePoolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.ListNodePoolsResponse() - ); - client.innerApiCalls.listNodePools = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listNodePools( - request, - (err?: Error|null, result?: protos.google.container.v1.IListNodePoolsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listNodePools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNodePools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNodePools with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListNodePoolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listNodePools = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listNodePools(request), expectedError); - const actualRequest = (client.innerApiCalls.listNodePools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNodePools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNodePools with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListNodePoolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.listNodePools(request), expectedError); - }); - }); - - describe('getNodePool', () => { - it('invokes getNodePool without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.NodePool() - ); - client.innerApiCalls.getNodePool = stubSimpleCall(expectedResponse); - const [response] = await client.getNodePool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNodePool without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.NodePool() - ); - client.innerApiCalls.getNodePool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getNodePool( - request, - (err?: Error|null, result?: protos.google.container.v1.INodePool|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNodePool with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getNodePool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getNodePool(request), expectedError); - const actualRequest = (client.innerApiCalls.getNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNodePool with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getNodePool(request), expectedError); - }); - }); - - describe('createNodePool', () => { - it('invokes createNodePool without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CreateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.createNodePool = stubSimpleCall(expectedResponse); - const [response] = await client.createNodePool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createNodePool without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CreateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.createNodePool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createNodePool( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createNodePool with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CreateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createNodePool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createNodePool(request), expectedError); - const actualRequest = (client.innerApiCalls.createNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createNodePool with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CreateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createNodePool(request), expectedError); - }); - }); - - describe('deleteNodePool', () => { - it('invokes deleteNodePool without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.DeleteNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.deleteNodePool = stubSimpleCall(expectedResponse); - const [response] = await client.deleteNodePool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteNodePool without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.DeleteNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.deleteNodePool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteNodePool( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteNodePool with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.DeleteNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteNodePool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteNodePool(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteNodePool with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.DeleteNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteNodePool(request), expectedError); - }); - }); - - describe('completeNodePoolUpgrade', () => { - it('invokes completeNodePoolUpgrade without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CompleteNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CompleteNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.completeNodePoolUpgrade = stubSimpleCall(expectedResponse); - const [response] = await client.completeNodePoolUpgrade(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes completeNodePoolUpgrade without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CompleteNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CompleteNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.completeNodePoolUpgrade = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.completeNodePoolUpgrade( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes completeNodePoolUpgrade with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CompleteNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CompleteNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.completeNodePoolUpgrade = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.completeNodePoolUpgrade(request), expectedError); - const actualRequest = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes completeNodePoolUpgrade with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CompleteNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CompleteNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.completeNodePoolUpgrade(request), expectedError); - }); - }); - - describe('rollbackNodePoolUpgrade', () => { - it('invokes rollbackNodePoolUpgrade without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.RollbackNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCall(expectedResponse); - const [response] = await client.rollbackNodePoolUpgrade(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollbackNodePoolUpgrade without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.RollbackNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.rollbackNodePoolUpgrade( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollbackNodePoolUpgrade with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.RollbackNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.rollbackNodePoolUpgrade(request), expectedError); - const actualRequest = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollbackNodePoolUpgrade with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.RollbackNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.rollbackNodePoolUpgrade(request), expectedError); - }); - }); - - describe('setNodePoolManagement', () => { - it('invokes setNodePoolManagement without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNodePoolManagementRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setNodePoolManagement = stubSimpleCall(expectedResponse); - const [response] = await client.setNodePoolManagement(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNodePoolManagement as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolManagement as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolManagement without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNodePoolManagementRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setNodePoolManagement = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setNodePoolManagement( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNodePoolManagement as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolManagement as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolManagement with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNodePoolManagementRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setNodePoolManagement = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setNodePoolManagement(request), expectedError); - const actualRequest = (client.innerApiCalls.setNodePoolManagement as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolManagement as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolManagement with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNodePoolManagementRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setNodePoolManagement(request), expectedError); - }); - }); - - describe('setLabels', () => { - it('invokes setLabels without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLabelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); - const [response] = await client.setLabels(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLabels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLabels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLabels without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLabelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setLabels = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setLabels( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLabels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLabels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLabels with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLabelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setLabels = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setLabels(request), expectedError); - const actualRequest = (client.innerApiCalls.setLabels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLabels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLabels with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLabelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setLabels(request), expectedError); - }); - }); - - describe('setLegacyAbac', () => { - it('invokes setLegacyAbac without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLegacyAbacRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setLegacyAbac = stubSimpleCall(expectedResponse); - const [response] = await client.setLegacyAbac(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLegacyAbac as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLegacyAbac as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLegacyAbac without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLegacyAbacRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setLegacyAbac = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setLegacyAbac( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLegacyAbac as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLegacyAbac as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLegacyAbac with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLegacyAbacRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setLegacyAbac = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setLegacyAbac(request), expectedError); - const actualRequest = (client.innerApiCalls.setLegacyAbac as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLegacyAbac as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLegacyAbac with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLegacyAbacRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setLegacyAbac(request), expectedError); - }); - }); - - describe('startIPRotation', () => { - it('invokes startIPRotation without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.StartIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.startIpRotation = stubSimpleCall(expectedResponse); - const [response] = await client.startIPRotation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.startIpRotation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.startIpRotation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes startIPRotation without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.StartIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.startIpRotation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.startIPRotation( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.startIpRotation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.startIpRotation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes startIPRotation with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.StartIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.startIpRotation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.startIPRotation(request), expectedError); - const actualRequest = (client.innerApiCalls.startIpRotation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.startIpRotation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes startIPRotation with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.StartIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.startIPRotation(request), expectedError); - }); - }); - - describe('completeIPRotation', () => { - it('invokes completeIPRotation without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CompleteIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.completeIpRotation = stubSimpleCall(expectedResponse); - const [response] = await client.completeIPRotation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.completeIpRotation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeIpRotation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes completeIPRotation without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CompleteIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.completeIpRotation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.completeIPRotation( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.completeIpRotation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeIpRotation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes completeIPRotation with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CompleteIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.completeIpRotation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.completeIPRotation(request), expectedError); - const actualRequest = (client.innerApiCalls.completeIpRotation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeIpRotation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes completeIPRotation with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CompleteIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.completeIPRotation(request), expectedError); - }); - }); - - describe('setNodePoolSize', () => { - it('invokes setNodePoolSize without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNodePoolSizeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setNodePoolSize = stubSimpleCall(expectedResponse); - const [response] = await client.setNodePoolSize(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNodePoolSize as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolSize as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolSize without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNodePoolSizeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setNodePoolSize = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setNodePoolSize( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNodePoolSize as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolSize as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolSize with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNodePoolSizeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setNodePoolSize = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setNodePoolSize(request), expectedError); - const actualRequest = (client.innerApiCalls.setNodePoolSize as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolSize as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolSize with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNodePoolSizeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setNodePoolSize(request), expectedError); - }); - }); - - describe('setNetworkPolicy', () => { - it('invokes setNetworkPolicy without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNetworkPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setNetworkPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.setNetworkPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNetworkPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNetworkPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNetworkPolicy without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNetworkPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setNetworkPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setNetworkPolicy( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNetworkPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNetworkPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNetworkPolicy with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNetworkPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setNetworkPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setNetworkPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.setNetworkPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNetworkPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNetworkPolicy with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNetworkPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setNetworkPolicy(request), expectedError); - }); - }); - - describe('setMaintenancePolicy', () => { - it('invokes setMaintenancePolicy without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetMaintenancePolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setMaintenancePolicy = stubSimpleCall(expectedResponse); - const [response] = await client.setMaintenancePolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setMaintenancePolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMaintenancePolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMaintenancePolicy without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetMaintenancePolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setMaintenancePolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setMaintenancePolicy( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setMaintenancePolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMaintenancePolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMaintenancePolicy with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetMaintenancePolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setMaintenancePolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setMaintenancePolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.setMaintenancePolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMaintenancePolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMaintenancePolicy with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetMaintenancePolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setMaintenancePolicy(request), expectedError); - }); - }); - - describe('checkAutopilotCompatibility', () => { - it('invokes checkAutopilotCompatibility without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CheckAutopilotCompatibilityRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CheckAutopilotCompatibilityRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.CheckAutopilotCompatibilityResponse() - ); - client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCall(expectedResponse); - const [response] = await client.checkAutopilotCompatibility(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkAutopilotCompatibility without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CheckAutopilotCompatibilityRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CheckAutopilotCompatibilityRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.CheckAutopilotCompatibilityResponse() - ); - client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.checkAutopilotCompatibility( - request, - (err?: Error|null, result?: protos.google.container.v1.ICheckAutopilotCompatibilityResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkAutopilotCompatibility with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CheckAutopilotCompatibilityRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CheckAutopilotCompatibilityRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkAutopilotCompatibility(request), expectedError); - const actualRequest = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkAutopilotCompatibility with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CheckAutopilotCompatibilityRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CheckAutopilotCompatibilityRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.checkAutopilotCompatibility(request), expectedError); - }); - }); - - describe('listUsableSubnetworks', () => { - it('invokes listUsableSubnetworks without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), - ]; - client.innerApiCalls.listUsableSubnetworks = stubSimpleCall(expectedResponse); - const [response] = await client.listUsableSubnetworks(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listUsableSubnetworks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUsableSubnetworks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listUsableSubnetworks without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), - ]; - client.innerApiCalls.listUsableSubnetworks = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listUsableSubnetworks( - request, - (err?: Error|null, result?: protos.google.container.v1.IUsableSubnetwork[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listUsableSubnetworks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUsableSubnetworks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listUsableSubnetworks with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listUsableSubnetworks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listUsableSubnetworks(request), expectedError); - const actualRequest = (client.innerApiCalls.listUsableSubnetworks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUsableSubnetworks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listUsableSubnetworksStream without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), - ]; - client.descriptors.page.listUsableSubnetworks.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listUsableSubnetworksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.container.v1.UsableSubnetwork[] = []; - stream.on('data', (response: protos.google.container.v1.UsableSubnetwork) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listUsableSubnetworks, request)); - assert( - (client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listUsableSubnetworksStream with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listUsableSubnetworks.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listUsableSubnetworksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.container.v1.UsableSubnetwork[] = []; - stream.on('data', (response: protos.google.container.v1.UsableSubnetwork) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listUsableSubnetworks, request)); - assert( - (client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listUsableSubnetworks without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), - ]; - client.descriptors.page.listUsableSubnetworks.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.container.v1.IUsableSubnetwork[] = []; - const iterable = client.listUsableSubnetworksAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listUsableSubnetworks with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listUsableSubnetworks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listUsableSubnetworksAsync(request); - await assert.rejects(async () => { - const responses: protos.google.container.v1.IUsableSubnetwork[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); -}); diff --git a/owl-bot-staging/google-container/v1/tsconfig.json b/owl-bot-staging/google-container/v1/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-container/v1/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/google-container/v1/webpack.config.js b/owl-bot-staging/google-container/v1/webpack.config.js deleted file mode 100644 index 9032271af9d..00000000000 --- a/owl-bot-staging/google-container/v1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 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. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'ClusterManager', - filename: './cluster-manager.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/owl-bot-staging/google-container/v1beta1/.eslintignore b/owl-bot-staging/google-container/v1beta1/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-container/v1beta1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-container/v1beta1/.eslintrc.json b/owl-bot-staging/google-container/v1beta1/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-container/v1beta1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-container/v1beta1/.gitignore b/owl-bot-staging/google-container/v1beta1/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-container/v1beta1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -/.coverage -/coverage -/.nyc_output -/docs/ -/out/ -/build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/google-container/v1beta1/.jsdoc.js b/owl-bot-staging/google-container/v1beta1/.jsdoc.js deleted file mode 100644 index 6dc18e81193..00000000000 --- a/owl-bot-staging/google-container/v1beta1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2023 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/container', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-container/v1beta1/.mocharc.js b/owl-bot-staging/google-container/v1beta1/.mocharc.js deleted file mode 100644 index 1a38f257db7..00000000000 --- a/owl-bot-staging/google-container/v1beta1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/google-container/v1beta1/.prettierrc.js b/owl-bot-staging/google-container/v1beta1/.prettierrc.js deleted file mode 100644 index 55639e70f9e..00000000000 --- a/owl-bot-staging/google-container/v1beta1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-container/v1beta1/README.md b/owl-bot-staging/google-container/v1beta1/README.md deleted file mode 100644 index f32441d7e6b..00000000000 --- a/owl-bot-staging/google-container/v1beta1/README.md +++ /dev/null @@ -1 +0,0 @@ -Container: Nodejs Client diff --git a/owl-bot-staging/google-container/v1beta1/linkinator.config.json b/owl-bot-staging/google-container/v1beta1/linkinator.config.json deleted file mode 100644 index befd23c8633..00000000000 --- a/owl-bot-staging/google-container/v1beta1/linkinator.config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "recurse": true, - "skip": [ - "https://codecov.io/gh/googleapis/", - "www.googleapis.com", - "img.shields.io", - "https://console.cloud.google.com/cloudshell", - "https://support.google.com" - ], - "silent": true, - "concurrency": 5, - "retry": true, - "retryErrors": true, - "retryErrorsCount": 5, - "retryErrorsJitter": 3000 -} diff --git a/owl-bot-staging/google-container/v1beta1/package.json b/owl-bot-staging/google-container/v1beta1/package.json deleted file mode 100644 index 9795068794e..00000000000 --- a/owl-bot-staging/google-container/v1beta1/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@google-cloud/container", - "version": "0.1.0", - "description": "Container client for Node.js", - "repository": "googleapis/nodejs-container", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google container", - "container", - "cluster manager" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "predocs-test": "npm run docs", - "docs-test": "linkinator docs", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^3.5.7" - }, - "devDependencies": { - "@types/mocha": "^10.0.1", - "@types/node": "^18.11.18", - "@types/sinon": "^10.0.13", - "c8": "^7.12.0", - "gts": "^3.1.1", - "jsdoc": "^4.0.0", - "jsdoc-fresh": "^2.0.1", - "jsdoc-region-tag": "^2.0.1", - "linkinator": "^4.1.2", - "mocha": "^10.2.0", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^15.0.1", - "ts-loader": "^8.4.0", - "typescript": "^4.8.4", - "webpack": "^4.46.0", - "webpack-cli": "^4.10.0" - }, - "engines": { - "node": ">=v12" - } -} diff --git a/owl-bot-staging/google-container/v1beta1/protos/google/container/v1beta1/cluster_service.proto b/owl-bot-staging/google-container/v1beta1/protos/google/container/v1beta1/cluster_service.proto deleted file mode 100644 index d35034ce072..00000000000 --- a/owl-bot-staging/google-container/v1beta1/protos/google/container/v1beta1/cluster_service.proto +++ /dev/null @@ -1,5617 +0,0 @@ -// Copyright 2023 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. - -syntax = "proto3"; - -package google.container.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; -import "google/rpc/code.proto"; -import "google/rpc/status.proto"; -import "google/type/date.proto"; - -option csharp_namespace = "Google.Cloud.Container.V1Beta1"; -option go_package = "cloud.google.com/go/container/apiv1beta1/containerpb;containerpb"; -option java_multiple_files = true; -option java_outer_classname = "ClusterServiceProto"; -option java_package = "com.google.container.v1beta1"; -option php_namespace = "Google\\Cloud\\Container\\V1beta1"; -option ruby_package = "Google::Cloud::Container::V1beta1"; -option (google.api.resource_definition) = { - type: "pubsub.googleapis.com/Topic" - pattern: "projects/{project}/topics/{topic}" -}; - -// Google Kubernetes Engine Cluster Manager v1beta1 -service ClusterManager { - option (google.api.default_host) = "container.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Lists all clusters owned by a project in either the specified zone or all - // zones. - rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/clusters" - additional_bindings { - get: "/v1beta1/projects/{project_id}/zones/{zone}/clusters" - } - }; - option (google.api.method_signature) = "project_id,zone"; - } - - // Gets the details for a specific cluster. - rpc GetCluster(GetClusterRequest) returns (Cluster) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/clusters/*}" - additional_bindings { - get: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - } - - // 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](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). - // - // 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. - rpc CreateCluster(CreateClusterRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/clusters" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster"; - } - - // Updates the settings for a specific cluster. - rpc UpdateCluster(UpdateClusterRequest) returns (Operation) { - option (google.api.http) = { - put: "/v1beta1/{name=projects/*/locations/*/clusters/*}" - body: "*" - additional_bindings { - put: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id,update"; - } - - // Updates the version and/or image type of a specific node pool. - rpc UpdateNodePool(UpdateNodePoolRequest) returns (Operation) { - option (google.api.http) = { - put: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/update" - body: "*" - } - }; - } - - // Sets the autoscaling settings of a specific node pool. - rpc SetNodePoolAutoscaling(SetNodePoolAutoscalingRequest) - returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setAutoscaling" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/autoscaling" - body: "*" - } - }; - } - - // Sets the logging service for a specific cluster. - rpc SetLoggingService(SetLoggingServiceRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setLogging" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/logging" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,logging_service"; - } - - // Sets the monitoring service for a specific cluster. - rpc SetMonitoringService(SetMonitoringServiceRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setMonitoring" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/monitoring" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,monitoring_service"; - } - - // Sets the addons for a specific cluster. - rpc SetAddonsConfig(SetAddonsConfigRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setAddons" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/addons" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,addons_config"; - } - - // Sets the locations for a specific cluster. - // Deprecated. Use - // [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters/update) - // instead. - rpc SetLocations(SetLocationsRequest) returns (Operation) { - option deprecated = true; - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setLocations" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/locations" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,locations"; - } - - // Updates the master for a specific cluster. - rpc UpdateMaster(UpdateMasterRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:updateMaster" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/master" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,master_version"; - } - - // Sets master auth materials. Currently supports changing the admin password - // or a specific cluster, either via password generation or explicitly setting - // the password. - rpc SetMasterAuth(SetMasterAuthRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setMasterAuth" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setMasterAuth" - body: "*" - } - }; - } - - // 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. - rpc DeleteCluster(DeleteClusterRequest) returns (Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/clusters/*}" - additional_bindings { - delete: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - } - - // Lists all operations in a project in the specified zone or all zones. - rpc ListOperations(ListOperationsRequest) returns (ListOperationsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/operations" - additional_bindings { - get: "/v1beta1/projects/{project_id}/zones/{zone}/operations" - } - }; - option (google.api.method_signature) = "project_id,zone"; - } - - // Gets the specified operation. - rpc GetOperation(GetOperationRequest) returns (Operation) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/operations/*}" - additional_bindings { - get: "/v1beta1/projects/{project_id}/zones/{zone}/operations/{operation_id}" - } - }; - option (google.api.method_signature) = "project_id,zone,operation_id"; - } - - // Cancels the specified operation. - rpc CancelOperation(CancelOperationRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/operations/*}:cancel" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/operations/{operation_id}:cancel" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,operation_id"; - } - - // Returns configuration info about the Google Kubernetes Engine service. - rpc GetServerConfig(GetServerConfigRequest) returns (ServerConfig) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*}/serverConfig" - additional_bindings { - get: "/v1beta1/projects/{project_id}/zones/{zone}/serverconfig" - } - }; - option (google.api.method_signature) = "project_id,zone"; - } - - // Gets the public component of the cluster signing keys in - // JSON Web Key format. - // This API is not yet intended for general use, and is not available for all - // clusters. - rpc GetJSONWebKeys(GetJSONWebKeysRequest) returns (GetJSONWebKeysResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/clusters/*}/jwks" - }; - } - - // Lists the node pools for a cluster. - rpc ListNodePools(ListNodePoolsRequest) returns (ListNodePoolsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/clusters/*}/nodePools" - additional_bindings { - get: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - } - - // Retrieves the requested node pool. - rpc GetNodePool(GetNodePoolRequest) returns (NodePool) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}" - additional_bindings { - get: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,node_pool_id"; - } - - // Creates a node pool for a cluster. - rpc CreateNodePool(CreateNodePoolRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/clusters/*}/nodePools" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,node_pool"; - } - - // Deletes a node pool from a cluster. - rpc DeleteNodePool(DeleteNodePoolRequest) returns (Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}" - additional_bindings { - delete: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,node_pool_id"; - } - - // CompleteNodePoolUpgrade will signal an on-going node pool upgrade to - // complete. - rpc CompleteNodePoolUpgrade(CompleteNodePoolUpgradeRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:completeUpgrade" - body: "*" - }; - } - - // Rolls back a previously Aborted or Failed NodePool upgrade. - // This makes no changes if the last upgrade successfully completed. - rpc RollbackNodePoolUpgrade(RollbackNodePoolUpgradeRequest) - returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:rollback" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}:rollback" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,node_pool_id"; - } - - // Sets the NodeManagement options for a node pool. - rpc SetNodePoolManagement(SetNodePoolManagementRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setManagement" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/setManagement" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,node_pool_id,management"; - } - - // Sets labels on a cluster. - rpc SetLabels(SetLabelsRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setResourceLabels" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/resourceLabels" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,resource_labels,label_fingerprint"; - } - - // Enables or disables the ABAC authorization mechanism on a cluster. - rpc SetLegacyAbac(SetLegacyAbacRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setLegacyAbac" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/legacyAbac" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id,enabled"; - } - - // Starts master IP rotation. - rpc StartIPRotation(StartIPRotationRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:startIpRotation" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:startIpRotation" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - } - - // Completes master IP rotation. - rpc CompleteIPRotation(CompleteIPRotationRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:completeIpRotation" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:completeIpRotation" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - } - - // SetNodePoolSizeRequest sets the size of a node pool. The new size will be - // used for all replicas, including future replicas created by modifying - // [NodePool.locations][google.container.v1beta1.NodePool.locations]. - rpc SetNodePoolSize(SetNodePoolSizeRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setSize" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/setSize" - body: "*" - } - }; - } - - // Enables or disables Network Policy for a cluster. - rpc SetNetworkPolicy(SetNetworkPolicyRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setNetworkPolicy" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setNetworkPolicy" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,network_policy"; - } - - // Sets the maintenance policy for a cluster. - rpc SetMaintenancePolicy(SetMaintenancePolicyRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setMaintenancePolicy" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setMaintenancePolicy" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,maintenance_policy"; - } - - // Lists subnetworks that can be used for creating clusters in a project. - rpc ListUsableSubnetworks(ListUsableSubnetworksRequest) - returns (ListUsableSubnetworksResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*}/aggregated/usableSubnetworks" - }; - option (google.api.method_signature) = "parent"; - } - - // Checks the cluster compatibility with Autopilot mode, and returns a list of - // compatibility issues. - rpc CheckAutopilotCompatibility(CheckAutopilotCompatibilityRequest) - returns (CheckAutopilotCompatibilityResponse) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/clusters/*}:checkAutopilotCompatibility" - }; - } - - // Fetches locations that offer Google Kubernetes Engine. - rpc ListLocations(ListLocationsRequest) returns (ListLocationsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*}/locations" - }; - option (google.api.method_signature) = "parent"; - } -} - -// Parameters that can be configured on Linux nodes. -message LinuxNodeConfig { - // Possible cgroup modes that can be used. - enum CgroupMode { - // CGROUP_MODE_UNSPECIFIED is when unspecified cgroup configuration is used. - // The default for the GKE node OS image will be used. - CGROUP_MODE_UNSPECIFIED = 0; - - // CGROUP_MODE_V1 specifies to use cgroupv1 for the cgroup configuration on - // the node image. - CGROUP_MODE_V1 = 1; - - // CGROUP_MODE_V2 specifies to use cgroupv2 for the cgroup configuration on - // the node image. - CGROUP_MODE_V2 = 2; - } - - // The Linux kernel parameters to be applied to the nodes and all pods running - // on the nodes. - // - // The following parameters are supported. - // - // net.core.busy_poll - // net.core.busy_read - // net.core.netdev_max_backlog - // net.core.rmem_max - // net.core.wmem_default - // net.core.wmem_max - // net.core.optmem_max - // net.core.somaxconn - // net.ipv4.tcp_rmem - // net.ipv4.tcp_wmem - // net.ipv4.tcp_tw_reuse - map sysctls = 1; - - // cgroup_mode specifies the cgroup mode to be used on the node. - CgroupMode cgroup_mode = 2; -} - -// Parameters that can be configured on Windows nodes. -// Windows Node Config that define the parameters that will be used to -// configure the Windows node pool settings -message WindowsNodeConfig { - // Possible OS version that can be used. - enum OSVersion { - // When OSVersion is not specified - OS_VERSION_UNSPECIFIED = 0; - - // LTSC2019 specifies to use LTSC2019 as the Windows Servercore Base Image - OS_VERSION_LTSC2019 = 1; - - // LTSC2022 specifies to use LTSC2022 as the Windows Servercore Base Image - OS_VERSION_LTSC2022 = 2; - } - - // OSVersion specifies the Windows node config to be used on the node - OSVersion os_version = 1; -} - -// Node kubelet configs. -message NodeKubeletConfig { - // Control the CPU management policy on the node. - // See - // https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/ - // - // The following values are allowed. - // * "none": the default, which represents the existing scheduling behavior. - // * "static": allows pods with certain resource characteristics to be granted - // increased CPU affinity and exclusivity on the node. - // The default value is 'none' if unspecified. - string cpu_manager_policy = 1; - - // Enable CPU CFS quota enforcement for containers that specify CPU limits. - // - // This option is enabled by default which makes kubelet use CFS quota - // (https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt) to - // enforce container CPU limits. Otherwise, CPU limits will not be enforced at - // all. - // - // Disable this option to mitigate CPU throttling problems while still having - // your pods to be in Guaranteed QoS class by specifying the CPU limits. - // - // The default value is 'true' if unspecified. - google.protobuf.BoolValue cpu_cfs_quota = 2; - - // Set the CPU CFS quota period value 'cpu.cfs_period_us'. - // - // The string must be a sequence of decimal numbers, each with optional - // fraction and a unit suffix, such as "300ms". - // Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". - // The value must be a positive duration. - string cpu_cfs_quota_period = 3; - - // Set the Pod PID limits. See - // https://kubernetes.io/docs/concepts/policy/pid-limiting/#pod-pid-limits - // - // Controls the maximum number of processes allowed to run in a pod. The value - // must be greater than or equal to 1024 and less than 4194304. - int64 pod_pids_limit = 4; - - // Enable or disable Kubelet read only port. - optional bool insecure_kubelet_readonly_port_enabled = 7; -} - -// Parameters that describe the nodes in a cluster. -// -// GKE Autopilot clusters do not -// recognize parameters in `NodeConfig`. Use -// [AutoprovisioningNodePoolDefaults][google.container.v1beta1.AutoprovisioningNodePoolDefaults] -// instead. -message NodeConfig { - // The name of a Google Compute Engine [machine - // type](https://cloud.google.com/compute/docs/machine-types). - // - // If unspecified, the default machine type is - // `e2-medium`. - string machine_type = 1; - - // 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. - int32 disk_size_gb = 2; - - // 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](https://cloud.google.com/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. - repeated string oauth_scopes = 3; - - // The Google Cloud Platform Service Account to be used by the node VMs. - // Specify the email address of the Service Account; otherwise, if no Service - // Account is specified, the "default" service account is used. - string service_account = 9; - - // 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-oslogin" - // - "gci-ensure-gke-docker" - // - "gci-metrics-enabled" - // - "gci-update-strategy" - // - "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" - // - // 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. - map metadata = 4; - - // The image type to use for this node. Note that for a given image type, - // the latest version of it will be used. Please see - // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for - // available image types. - string image_type = 5; - - // 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/ - map labels = 6; - - // 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. - int32 local_ssd_count = 7; - - // 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. - repeated string tags = 8; - - // 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. - bool preemptible = 10; - - // 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. - repeated AcceleratorConfig accelerators = 11; - - // Sandbox configuration for this node. - SandboxConfig sandbox_config = 17; - - // Setting this field will assign instances of this - // pool to run on the specified node group. This is useful for running - // workloads on [sole tenant - // nodes](https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes). - string node_group = 18; - - // The optional reservation affinity. Setting this field will apply - // the specified [Zonal Compute - // Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources) - // to this node pool. - ReservationAffinity reservation_affinity = 19; - - // Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or - // 'pd-balanced') - // - // If unspecified, the default disk type is 'pd-standard' - string disk_type = 12; - - // 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](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform). - string min_cpu_platform = 13; - - // The workload metadata configuration for this node. - WorkloadMetadataConfig workload_metadata_config = 14; - - // 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/ - repeated NodeTaint taints = 15; - - // - // The Customer Managed Encryption Key used to encrypt the boot disk attached - // to each node in the node pool. This should be of the form - // projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. - // For more information about protecting resources with Cloud KMS Keys please - // see: - // https://cloud.google.com/compute/docs/disks/customer-managed-encryption - string boot_disk_kms_key = 23; - - // Shielded Instance options. - ShieldedInstanceConfig shielded_instance_config = 20; - - // Parameters that can be configured on Linux nodes. - LinuxNodeConfig linux_node_config = 21; - - // Node kubelet configs. - NodeKubeletConfig kubelet_config = 22; - - // Parameters for the ephemeral storage filesystem. - // If unspecified, ephemeral storage is backed by the boot disk. - EphemeralStorageConfig ephemeral_storage_config = 24; - - // GCFS (Google Container File System) configs. - GcfsConfig gcfs_config = 25; - - // Advanced features for the Compute Engine VM. - AdvancedMachineFeatures advanced_machine_features = 26; - - // Enable or disable gvnic on the node pool. - VirtualNIC gvnic = 29; - - // Spot flag for enabling Spot VM, which is a rebrand of - // the existing preemptible flag. - bool spot = 32; - - // Confidential nodes config. - // All the nodes in the node pool will be Confidential VM once enabled. - ConfidentialNodes confidential_nodes = 35; - - // Enable or disable NCCL fast socket for the node pool. - optional FastSocket fast_socket = 36; - - // The resource labels for the node pool to use to annotate any related - // Google Compute Engine resources. - map resource_labels = 37; - - // Logging configuration. - NodePoolLoggingConfig logging_config = 38; - - // Parameters that can be configured on Windows nodes. - WindowsNodeConfig windows_node_config = 39; - - // Parameters for using raw-block Local NVMe SSDs. - LocalNvmeSsdBlockConfig local_nvme_ssd_block_config = 40; - - // Parameters for the node ephemeral storage using Local SSDs. - // If unspecified, ephemeral storage is backed by the boot disk. - // This field is functionally equivalent to the ephemeral_storage_config - EphemeralStorageLocalSsdConfig ephemeral_storage_local_ssd_config = 41; - - // Parameters for node pools to be backed by shared sole tenant node groups. - SoleTenantConfig sole_tenant_config = 42; -} - -// Specifies options for controlling advanced machine features. -message AdvancedMachineFeatures { - // The number of threads per physical core. To disable simultaneous - // multithreading (SMT) set this to 1. If unset, the maximum number of threads - // supported per core by the underlying processor is assumed. - optional int64 threads_per_core = 1; -} - -// Parameters for node pool-level network config. -message NodeNetworkConfig { - // Configuration of all network bandwidth tiers - message NetworkPerformanceConfig { - // Node network tier - enum Tier { - // Default value - TIER_UNSPECIFIED = 0; - - // Higher bandwidth, actual values based on VM size. - TIER_1 = 1; - } - - // Specifies the total network bandwidth tier for the NodePool. - optional Tier total_egress_bandwidth_tier = 1; - - // Specifies the network bandwidth tier for the NodePool for traffic to - // external/public IP addresses. - optional Tier external_ip_egress_bandwidth_tier = 2; - } - - // Input only. Whether to create a new range for pod IPs in this node pool. - // Defaults are provided for `pod_range` and `pod_ipv4_cidr_block` if they - // are not specified. - // - // If neither `create_pod_range` or `pod_range` are specified, the - // cluster-level default (`ip_allocation_policy.cluster_ipv4_cidr_block`) is - // used. - // - // Only applicable if `ip_allocation_policy.use_ip_aliases` is true. - // - // This field cannot be changed after the node pool has been created. - bool create_pod_range = 4 [(google.api.field_behavior) = INPUT_ONLY]; - - // The ID of the secondary range for pod IPs. - // If `create_pod_range` is true, this ID is used for the new range. - // If `create_pod_range` is false, uses an existing secondary range with this - // ID. - // - // Only applicable if `ip_allocation_policy.use_ip_aliases` is true. - // - // This field cannot be changed after the node pool has been created. - string pod_range = 5; - - // The IP address range for pod IPs in this node pool. - // - // Only applicable if `create_pod_range` 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](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `10.96.0.0/14`) to pick a specific range to use. - // - // Only applicable if `ip_allocation_policy.use_ip_aliases` is true. - // - // This field cannot be changed after the node pool has been created. - string pod_ipv4_cidr_block = 6; - - // Whether nodes have internal IP addresses only. - // If enable_private_nodes is not specified, then the value is derived from - // [cluster.privateClusterConfig.enablePrivateNodes][google.container.v1beta1.PrivateClusterConfig.enablePrivateNodes] - optional bool enable_private_nodes = 9; - - // Network bandwidth tier configuration. - optional NetworkPerformanceConfig network_performance_config = 11; - - // [PRIVATE FIELD] - // Pod CIDR size overprovisioning config for the nodepool. - // - // Pod CIDR size per node depends on max_pods_per_node. By default, the value - // of max_pods_per_node is rounded off to next power of 2 and we then double - // that to get the size of pod CIDR block per node. - // Example: max_pods_per_node of 30 would result in 64 IPs (/26). - // - // This config can disable the doubling of IPs (we still round off to next - // power of 2) - // Example: max_pods_per_node of 30 will result in 32 IPs (/27) when - // overprovisioning is disabled. - PodCIDROverprovisionConfig pod_cidr_overprovision_config = 13; - - // Output only. [Output only] The utilization of the IPv4 range for the pod. - // The ratio is Usage/[Total number of IPs in the secondary range], - // Usage=numNodes*numZones*podIPsPerNode. - double pod_ipv4_range_utilization = 16 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A set of Shielded Instance options. -message ShieldedInstanceConfig { - // 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. - bool enable_secure_boot = 1; - - // 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. - bool enable_integrity_monitoring = 2; -} - -// SandboxConfig contains configurations of the sandbox to use for the node. -message SandboxConfig { - // Possible types of sandboxes. - enum Type { - // Default value. This should not be used. - UNSPECIFIED = 0; - - // Run sandbox using gvisor. - GVISOR = 1; - } - - // Type of the sandbox to use for the node (e.g. 'gvisor') - string sandbox_type = 1 [deprecated = true]; - - // Type of the sandbox to use for the node. - Type type = 2; -} - -// EphemeralStorageConfig contains configuration for the ephemeral storage -// filesystem. -message EphemeralStorageConfig { - // Number of local SSDs to use to back ephemeral storage. Uses NVMe - // interfaces. Each local SSD is 375 GB in size. - // If zero, it means to disable using local SSDs as ephemeral storage. - int32 local_ssd_count = 1; -} - -// LocalNvmeSsdBlockConfig contains configuration for using raw-block local -// NVMe SSDs -message LocalNvmeSsdBlockConfig { - // The number of raw-block local NVMe SSD disks to be attached to the node. - // Each local SSD is 375 GB in size. If zero, it means no raw-block local NVMe - // 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. - int32 local_ssd_count = 1; -} - -// EphemeralStorageLocalSsdConfig contains configuration for the node ephemeral -// storage using Local SSDs. -message EphemeralStorageLocalSsdConfig { - // Number of local SSDs to use to back ephemeral storage. Uses NVMe - // interfaces. Each local SSD is 375 GB in size. - // If zero, it means to disable using local SSDs as ephemeral storage. - // 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. - int32 local_ssd_count = 1; -} - -// GcfsConfig contains configurations of Google Container File System. -message GcfsConfig { - // Whether to use GCFS. - bool enabled = 1; -} - -// [ReservationAffinity](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources) -// is the configuration of desired reservation which instances could take -// capacity from. -message ReservationAffinity { - // Indicates whether to consume capacity from a reservation or not. - enum Type { - // Default value. This should not be used. - UNSPECIFIED = 0; - - // Do not consume from any reserved capacity. - NO_RESERVATION = 1; - - // Consume any reservation available. - ANY_RESERVATION = 2; - - // Must consume from a specific reservation. Must specify key value fields - // for specifying the reservations. - SPECIFIC_RESERVATION = 3; - } - - // Corresponds to the type of reservation consumption. - Type consume_reservation_type = 1; - - // Corresponds to the label key of a reservation resource. To target a - // SPECIFIC_RESERVATION by name, specify - // "compute.googleapis.com/reservation-name" as the key and specify the name - // of your reservation as its value. - string key = 2; - - // Corresponds to the label value(s) of reservation resource(s). - repeated string values = 3; -} - -// SoleTenantConfig contains the NodeAffinities to specify what shared sole -// tenant node groups should back the node pool. -message SoleTenantConfig { - // Specifies the NodeAffinity key, values, and affinity operator according to - // [shared sole tenant node group - // affinities](https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes#node_affinity_and_anti-affinity). - message NodeAffinity { - // Operator allows user to specify affinity or anti-affinity for the - // given key values. - enum Operator { - // Invalid or unspecified affinity operator. - OPERATOR_UNSPECIFIED = 0; - - // Affinity operator. - IN = 1; - - // Anti-affinity operator. - NOT_IN = 2; - } - - // Key for NodeAffinity. - string key = 1; - - // Operator for NodeAffinity. - Operator operator = 2; - - // Values for NodeAffinity. - repeated string values = 3; - } - - // NodeAffinities used to match to a shared sole tenant node group. - repeated NodeAffinity node_affinities = 1; -} - -// Kubernetes taint is composed of three fields: key, value, and effect. Effect -// can only be one of three types: NoSchedule, PreferNoSchedule or NoExecute. -// -// See -// [here](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration) -// for more information, including usage and the valid values. -message NodeTaint { - // Possible values for Effect in taint. - enum Effect { - // Not set - EFFECT_UNSPECIFIED = 0; - - // NoSchedule - NO_SCHEDULE = 1; - - // PreferNoSchedule - PREFER_NO_SCHEDULE = 2; - - // NoExecute - NO_EXECUTE = 3; - } - - // Key for taint. - string key = 1; - - // Value for taint. - string value = 2; - - // Effect for taint. - Effect effect = 3; -} - -// Collection of Kubernetes [node -// taints](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration). -message NodeTaints { - // List of node taints. - repeated NodeTaint taints = 1; -} - -// Collection of node-level [Kubernetes -// labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels). -message NodeLabels { - // Map of node label keys and node label values. - map labels = 1; -} - -// Collection of [GCP -// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). -message ResourceLabels { - // Map of node label keys and node label values. - map labels = 1; -} - -// Collection of Compute Engine network tags that can be applied to a node's -// underlying VM instance. (See `tags` field in -// [`NodeConfig`](/kubernetes-engine/docs/reference/rest/v1/NodeConfig)). -message NetworkTags { - // List of network tags. - repeated string tags = 1; -} - -// The authentication information for accessing the master endpoint. -// Authentication can be done using HTTP basic auth or using client -// certificates. -message MasterAuth { - // 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). - // - // Warning: basic authentication is deprecated, and will be removed in GKE - // control plane versions 1.19 and newer. For a list of recommended - // authentication methods, see: - // https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication - string username = 1 [deprecated = true]; - - // 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. - // - // Warning: basic authentication is deprecated, and will be removed in GKE - // control plane versions 1.19 and newer. For a list of recommended - // authentication methods, see: - // https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication - string password = 2 [deprecated = true]; - - // Configuration for client certificate authentication on the cluster. For - // clusters before v1.12, if no configuration is specified, a client - // certificate is issued. - ClientCertificateConfig client_certificate_config = 3; - - string cluster_ca_certificate = 100; - - // [Output only] Base64-encoded public certificate used by clients to - // authenticate to the cluster endpoint. - string client_certificate = 101; - - // [Output only] Base64-encoded private key used by clients to authenticate - // to the cluster endpoint. - string client_key = 102; -} - -// Configuration for client certificates on the cluster. -message ClientCertificateConfig { - // Issue a client certificate. - bool issue_client_certificate = 1; -} - -// Configuration for the addons that can be automatically spun up in the -// cluster, enabling additional functionality. -message AddonsConfig { - // Configuration for the HTTP (L7) load balancing controller addon, which - // makes it easy to set up HTTP load balancers for services in a cluster. - HttpLoadBalancing http_load_balancing = 1; - - // 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. - HorizontalPodAutoscaling horizontal_pod_autoscaling = 2; - - // 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 - KubernetesDashboard kubernetes_dashboard = 3 [deprecated = true]; - - // 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. - NetworkPolicyConfig network_policy_config = 4; - - // Configuration for Istio, an open platform to connect, manage, and secure - // microservices. - IstioConfig istio_config = 5 [deprecated = true]; - - // Configuration for the Cloud Run addon. The `IstioConfig` addon must be - // enabled in order to enable Cloud Run addon. This option can only be enabled - // at cluster creation time. - CloudRunConfig cloud_run_config = 7; - - // Configuration for NodeLocalDNS, a dns cache running on cluster nodes - DnsCacheConfig dns_cache_config = 8; - - // Configuration for the ConfigConnector add-on, a Kubernetes - // extension to manage hosted GCP services through the Kubernetes API - ConfigConnectorConfig config_connector_config = 10; - - // Configuration for the Compute Engine Persistent Disk CSI driver. - GcePersistentDiskCsiDriverConfig gce_persistent_disk_csi_driver_config = 11; - - // Configuration for the KALM addon, which manages the lifecycle of k8s - // applications. - KalmConfig kalm_config = 12 [deprecated = true]; - - // Configuration for the GCP Filestore CSI driver. - GcpFilestoreCsiDriverConfig gcp_filestore_csi_driver_config = 14; - - // Configuration for the Backup for GKE agent addon. - GkeBackupAgentConfig gke_backup_agent_config = 16; - - // Configuration for the Cloud Storage Fuse CSI driver. - GcsFuseCsiDriverConfig gcs_fuse_csi_driver_config = 17; -} - -// 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. -message HttpLoadBalancing { - // 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. - bool disabled = 1; -} - -// 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. -message HorizontalPodAutoscaling { - // Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. - // When enabled, it ensures that metrics are collected into Stackdriver - // Monitoring. - bool disabled = 1; -} - -// Configuration for the Kubernetes Dashboard. -message KubernetesDashboard { - // Whether the Kubernetes Dashboard is enabled for this cluster. - bool disabled = 1; -} - -// 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. -message NetworkPolicyConfig { - // Whether NetworkPolicy is enabled for this cluster. - bool disabled = 1; -} - -// Configuration for NodeLocal DNSCache -message DnsCacheConfig { - // Whether NodeLocal DNSCache is enabled for this cluster. - bool enabled = 1; -} - -// Configuration options for the KALM addon. -message KalmConfig { - // Whether KALM is enabled for this cluster. - bool enabled = 1 [deprecated = true]; -} - -// Configuration for the Backup for GKE Agent. -message GkeBackupAgentConfig { - // Whether the Backup for GKE agent is enabled for this cluster. - bool enabled = 1; -} - -// Configuration options for the Config Connector add-on. -message ConfigConnectorConfig { - // Whether Cloud Connector is enabled for this cluster. - bool enabled = 1; -} - -// Configuration for the Compute Engine PD CSI driver. -message GcePersistentDiskCsiDriverConfig { - // Whether the Compute Engine PD CSI driver is enabled for this cluster. - bool enabled = 1; -} - -// Configuration for the GCP Filestore CSI driver. -message GcpFilestoreCsiDriverConfig { - // Whether the GCP Filestore CSI driver is enabled for this cluster. - bool enabled = 1; -} - -// Configuration for the Cloud Storage Fuse CSI driver. -message GcsFuseCsiDriverConfig { - // Whether the Cloud Storage Fuse CSI driver is enabled for this cluster. - bool enabled = 1; -} - -// Configuration for controlling master global access settings. -message PrivateClusterMasterGlobalAccessConfig { - // Whenever master is accessible globally or not. - bool enabled = 1; -} - -// Configuration options for private clusters. -message PrivateClusterConfig { - // 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. - bool enable_private_nodes = 1; - - // Whether the master's internal IP address is used as the cluster endpoint. - bool enable_private_endpoint = 2; - - // 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. - string master_ipv4_cidr_block = 3; - - // Output only. The internal IP address of this cluster's master endpoint. - string private_endpoint = 4; - - // Output only. The external IP address of this cluster's master endpoint. - string public_endpoint = 5; - - // Output only. The peering name in the customer VPC used by this cluster. - string peering_name = 7; - - // Controls master global access settings. - PrivateClusterMasterGlobalAccessConfig master_global_access_config = 8; - - // Subnet to provision the master's private endpoint during cluster creation. - // Specified in projects/*/regions/*/subnetworks/* format. - string private_endpoint_subnetwork = 10; -} - -// Configuration options for Istio addon. -message IstioConfig { - // Istio auth mode, https://istio.io/docs/concepts/security/mutual-tls.html - enum IstioAuthMode { - // auth not enabled - AUTH_NONE = 0; - - // auth mutual TLS enabled - AUTH_MUTUAL_TLS = 1; - } - - // Whether Istio is enabled for this cluster. - bool disabled = 1 [deprecated = true]; - - // The specified Istio auth mode, either none, or mutual TLS. - IstioAuthMode auth = 2 [deprecated = true]; -} - -// Configuration options for the Cloud Run feature. -message CloudRunConfig { - // Load balancer type of ingress service of Cloud Run. - enum LoadBalancerType { - // Load balancer type for Cloud Run is unspecified. - LOAD_BALANCER_TYPE_UNSPECIFIED = 0; - - // Install external load balancer for Cloud Run. - LOAD_BALANCER_TYPE_EXTERNAL = 1; - - // Install internal load balancer for Cloud Run. - LOAD_BALANCER_TYPE_INTERNAL = 2; - } - - // Whether Cloud Run addon is enabled for this cluster. - bool disabled = 1; - - // Which load balancer type is installed for Cloud Run. - LoadBalancerType load_balancer_type = 3; -} - -// 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. -message MasterAuthorizedNetworksConfig { - // CidrBlock contains an optional name and one CIDR block. - message CidrBlock { - // display_name is an optional field for users to identify CIDR blocks. - string display_name = 1; - - // cidr_block must be specified in CIDR notation. - string cidr_block = 2; - } - - // Whether or not master authorized networks is enabled. - bool enabled = 1; - - // cidr_blocks define up to 10 external networks that could access - // Kubernetes master through HTTPS. - repeated CidrBlock cidr_blocks = 2; - - // Whether master is accessbile via Google Compute Engine Public IP addresses. - optional bool gcp_public_cidrs_access_enabled = 3; -} - -// Configuration for the legacy Attribute Based Access Control authorization -// mode. -message LegacyAbac { - // 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. - bool enabled = 1; -} - -// Configuration options for the NetworkPolicy feature. -// https://kubernetes.io/docs/concepts/services-networking/networkpolicies/ -message NetworkPolicy { - // Allowed Network Policy providers. - enum Provider { - // Not set - PROVIDER_UNSPECIFIED = 0; - - // Tigera (Calico Felix). - CALICO = 1; - } - - // The selected network policy provider. - Provider provider = 1; - - // Whether network policy is enabled on the cluster. - bool enabled = 2; -} - -// [PRIVATE FIELD] -// Config for pod CIDR size overprovisioning. -message PodCIDROverprovisionConfig { - // Whether Pod CIDR overprovisioning is disabled. - // Note: Pod CIDR overprovisioning is enabled by default. - bool disable = 1; -} - -// Configuration for controlling how IPs are allocated in the cluster. -message IPAllocationPolicy { - // Possible values for IP stack type - enum StackType { - // By default, the clusters will be IPV4 only - STACK_TYPE_UNSPECIFIED = 0; - - // The value used if the cluster is a IPV4 only - IPV4 = 1; - - // The value used if the cluster is a dual stack cluster - IPV4_IPV6 = 2; - } - - // IPv6 access type - enum IPv6AccessType { - // Default value, will be defaulted as type external. - IPV6_ACCESS_TYPE_UNSPECIFIED = 0; - - // Access type internal (all v6 addresses are internal IPs) - INTERNAL = 1; - - // Access type external (all v6 addresses are external IPs) - EXTERNAL = 2; - } - - // Whether alias IPs will be used for pod IPs in the cluster. - // This is used in conjunction with use_routes. It cannot - // be true if use_routes is true. If both use_ip_aliases and use_routes are - // false, then the server picks the default IP allocation mode - bool use_ip_aliases = 1; - - // Whether a new subnetwork will be created automatically for the cluster. - // - // This field is only applicable when `use_ip_aliases` is true. - bool create_subnetwork = 2; - - // 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. - string subnetwork_name = 3; - - // This field is deprecated, use cluster_ipv4_cidr_block. - string cluster_ipv4_cidr = 4 [deprecated = true]; - - // This field is deprecated, use node_ipv4_cidr_block. - string node_ipv4_cidr = 5 [deprecated = true]; - - // This field is deprecated, use services_ipv4_cidr_block. - string services_ipv4_cidr = 6 [deprecated = true]; - - // 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 and - // create_subnetwork is false. - string cluster_secondary_range_name = 7; - - // 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 and - // create_subnetwork is false. - string services_secondary_range_name = 8; - - // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // 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. - string cluster_ipv4_cidr_block = 9; - - // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // 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. - string node_ipv4_cidr_block = 10; - - // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // 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. - string services_ipv4_cidr_block = 11; - - // If true, allow allocation of cluster CIDR ranges that overlap with certain - // kinds of network routes. By default we do not allow cluster CIDR ranges to - // intersect with any user declared routes. With allow_route_overlap == true, - // we allow overlapping with CIDR ranges that are larger than the cluster CIDR - // range. - // - // If this field is set to true, then cluster and services CIDRs must be - // fully-specified (e.g. `10.96.0.0/14`, but not `/14`), which means: - // 1) When `use_ip_aliases` is true, `cluster_ipv4_cidr_block` and - // `services_ipv4_cidr_block` must be fully-specified. - // 2) When `use_ip_aliases` is false, `cluster.cluster_ipv4_cidr` muse be - // fully-specified. - bool allow_route_overlap = 12; - - // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // 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. - // This field is deprecated, use cluster.tpu_config.ipv4_cidr_block instead. - string tpu_ipv4_cidr_block = 13; - - // Whether routes will be used for pod IPs in the cluster. - // This is used in conjunction with use_ip_aliases. It cannot be true if - // use_ip_aliases is true. If both use_ip_aliases and use_routes are false, - // then the server picks the default IP allocation mode - bool use_routes = 15; - - // IP stack type - StackType stack_type = 16; - - // The ipv6 access type (internal or external) when create_subnetwork is true - IPv6AccessType ipv6_access_type = 17; - - // [PRIVATE FIELD] - // Pod CIDR size overprovisioning config for the cluster. - // - // Pod CIDR size per node depends on max_pods_per_node. By default, the value - // of max_pods_per_node is doubled and then rounded off to next power of 2 to - // get the size of pod CIDR block per node. - // Example: max_pods_per_node of 30 would result in 64 IPs (/26). - // - // This config can disable the doubling of IPs (we still round off to next - // power of 2) - // Example: max_pods_per_node of 30 will result in 32 IPs (/27) when - // overprovisioning is disabled. - PodCIDROverprovisionConfig pod_cidr_overprovision_config = 21; - - // Output only. [Output only] The subnet's IPv6 CIDR block used by nodes and - // pods. - string subnet_ipv6_cidr_block = 22 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. [Output only] The services IPv6 CIDR block for the cluster. - string services_ipv6_cidr_block = 23 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. [Output only] The additional pod ranges that are added to the - // cluster. These pod ranges can be used by new node pools to allocate pod IPs - // automatically. Once the range is removed it will not show up in - // IPAllocationPolicy. - AdditionalPodRangesConfig additional_pod_ranges_config = 24 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. [Output only] The utilization of the cluster default IPv4 - // range for the pod. The ratio is Usage/[Total number of IPs in the secondary - // range], Usage=numNodes*numZones*podIPsPerNode. - double default_pod_ipv4_range_utilization = 25 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Configuration for Binary Authorization. -message BinaryAuthorization { - // Binary Authorization mode of operation. - enum EvaluationMode { - // Default value - EVALUATION_MODE_UNSPECIFIED = 0; - - // Disable BinaryAuthorization - DISABLED = 1; - - // Enforce Kubernetes admission requests with BinaryAuthorization using the - // project's singleton policy. This is equivalent to setting the - // enabled boolean to true. - PROJECT_SINGLETON_POLICY_ENFORCE = 2; - } - - // This field is deprecated. Leave this unset and instead configure - // BinaryAuthorization using evaluation_mode. If evaluation_mode is set to - // anything other than EVALUATION_MODE_UNSPECIFIED, this field is ignored. - bool enabled = 1 [deprecated = true]; - - // Mode of operation for binauthz policy evaluation. If unspecified, defaults - // to DISABLED. - EvaluationMode evaluation_mode = 2; -} - -// Configuration for the PodSecurityPolicy feature. -message PodSecurityPolicyConfig { - // Enable the PodSecurityPolicy controller for this cluster. If enabled, pods - // must be valid under a PodSecurityPolicy to be created. - bool enabled = 1; -} - -// Configuration for returning group information from authenticators. -message AuthenticatorGroupsConfig { - // Whether this cluster should return group membership lookups - // during authentication using a group of security groups. - bool enabled = 1; - - // The name of the security group-of-groups to be used. Only relevant - // if enabled = true. - string security_group = 2; -} - -// Telemetry integration for the cluster. -message ClusterTelemetry { - // Type of the integration. - enum Type { - // Not set. - UNSPECIFIED = 0; - - // Monitoring integration is disabled. - DISABLED = 1; - - // Monitoring integration is enabled. - ENABLED = 2; - - // Only system components are monitored and logged. - SYSTEM_ONLY = 3; - } - - // Type of the integration. - Type type = 1; -} - -// A Google Kubernetes Engine cluster. -message Cluster { - // The current status of the cluster. - enum Status { - // Not set. - STATUS_UNSPECIFIED = 0; - - // The PROVISIONING state indicates the cluster is being created. - PROVISIONING = 1; - - // The RUNNING state indicates the cluster has been created and is fully - // usable. - RUNNING = 2; - - // 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. - RECONCILING = 3; - - // The STOPPING state indicates the cluster is being deleted. - STOPPING = 4; - - // The ERROR state indicates the cluster may be unusable. Details - // can be found in the `statusMessage` field. - ERROR = 5; - - // The DEGRADED state indicates the cluster requires user action to restore - // full functionality. Details can be found in the `statusMessage` field. - DEGRADED = 6; - } - - // 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. - string name = 1; - - // An optional description of this cluster. - string description = 2; - - // The number of nodes to create in this cluster. You must ensure that your - // 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 - // "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. - int32 initial_node_count = 3 [deprecated = true]; - - // 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. - NodeConfig node_config = 4 [deprecated = true]; - - // 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. - MasterAuth master_auth = 5; - - // The logging service the cluster should use to write logs. - // Currently available options: - // - // * `logging.googleapis.com/kubernetes` - The Cloud Logging - // service with a Kubernetes-native resource model - // * `logging.googleapis.com` - The legacy Cloud Logging service (no longer - // available as of GKE 1.15). - // * `none` - no logs will be exported from the cluster. - // - // If left as an empty string,`logging.googleapis.com/kubernetes` will be - // used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. - string logging_service = 6; - - // The monitoring service the cluster should use to write metrics. - // Currently available options: - // - // * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring - // service with a Kubernetes-native resource model - // * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no - // longer available as of GKE 1.15). - // * `none` - No metrics will be exported from the cluster. - // - // If left as an empty string,`monitoring.googleapis.com/kubernetes` will be - // used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. - string monitoring_service = 7; - - // The name of the Google Compute Engine - // [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) - // to which the cluster is connected. If left unspecified, the `default` - // network will be used. On output this shows the network ID instead of the - // name. - string network = 8; - - // The IP address range of the container pods in this cluster, in - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // 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`. - string cluster_ipv4_cidr = 9; - - // Configurations for the various addons available to run in the cluster. - AddonsConfig addons_config = 10; - - // The name of the Google Compute Engine - // [subnetwork](https://cloud.google.com/compute/docs/subnetworks) to which - // the cluster is connected. On output this shows the subnetwork ID instead of - // the name. - string subnetwork = 11; - - // The node pools associated with this cluster. - // This field should not be set if "node_config" or "initial_node_count" are - // specified. - repeated NodePool node_pools = 12; - - // The list of Google Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster's nodes should be located. - // - // This field provides a default value if - // [NodePool.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools#NodePool.FIELDS.locations) - // are not specified during node pool creation. - // - // Warning: changing cluster locations will update the - // [NodePool.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools#NodePool.FIELDS.locations) - // of all node pools and will result in nodes being added and/or removed. - repeated string locations = 13; - - // Kubernetes alpha features are enabled on this cluster. This includes alpha - // API groups (e.g. v1beta1) 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. - bool enable_kubernetes_alpha = 14; - - // Kubernetes open source beta apis enabled on the cluster. Only beta apis. - K8sBetaAPIConfig enable_k8s_beta_apis = 143; - - // The resource labels for the cluster to use to annotate any related - // Google Compute Engine resources. - map resource_labels = 15; - - // The fingerprint of the set of labels for this cluster. - string label_fingerprint = 16; - - // Configuration for the legacy ABAC authorization mode. - LegacyAbac legacy_abac = 18; - - // Configuration options for the NetworkPolicy feature. - NetworkPolicy network_policy = 19; - - // Configuration for cluster IP allocation. - IPAllocationPolicy ip_allocation_policy = 20; - - // The configuration options for master authorized networks feature. - MasterAuthorizedNetworksConfig master_authorized_networks_config = 22; - - // Configure the maintenance policy for this cluster. - MaintenancePolicy maintenance_policy = 23; - - // Configuration for Binary Authorization. - BinaryAuthorization binary_authorization = 24; - - // Configuration for the PodSecurityPolicy feature. - PodSecurityPolicyConfig pod_security_policy_config = 25; - - // Cluster-level autoscaling configuration. - ClusterAutoscaling autoscaling = 26; - - // Configuration for cluster networking. - NetworkConfig network_config = 27; - - // If this is a private cluster setup. Private clusters are clusters that, by - // default have no external IP addresses on the nodes and where nodes and the - // master communicate over private IP addresses. - // This field is deprecated, use private_cluster_config.enable_private_nodes - // instead. - bool private_cluster = 28 [deprecated = true]; - - // The IP prefix in CIDR notation to use for the hosted master network. - // This prefix will be used for assigning private IP addresses to the - // master or set of masters, as well as the ILB VIP. - // This field is deprecated, use - // private_cluster_config.master_ipv4_cidr_block instead. - string master_ipv4_cidr_block = 29 [deprecated = true]; - - // 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. - MaxPodsConstraint default_max_pods_constraint = 30; - - // Configuration for exporting resource usages. Resource usage export is - // disabled when this config unspecified. - ResourceUsageExportConfig resource_usage_export_config = 33; - - // Configuration controlling RBAC group membership information. - AuthenticatorGroupsConfig authenticator_groups_config = 34; - - // Configuration for private cluster. - PrivateClusterConfig private_cluster_config = 37; - - // Cluster-level Vertical Pod Autoscaling configuration. - VerticalPodAutoscaling vertical_pod_autoscaling = 39; - - // Shielded Nodes configuration. - ShieldedNodes shielded_nodes = 40; - - // Release channel configuration. If left unspecified on cluster creation and - // a version is specified, the cluster is enrolled in the most mature release - // channel where the version is available (first checking STABLE, then - // REGULAR, and finally RAPID). Otherwise, if no release channel - // configuration and no version is specified, the cluster is enrolled in the - // REGULAR channel with its default version. - ReleaseChannel release_channel = 41; - - // Configuration for the use of Kubernetes Service Accounts in GCP IAM - // policies. - WorkloadIdentityConfig workload_identity_config = 43; - - // Configuration for issuance of mTLS keys and certificates to Kubernetes - // pods. - WorkloadCertificates workload_certificates = 52; - - // Configuration for issuance of mTLS keys and certificates to Kubernetes - // pods. - MeshCertificates mesh_certificates = 67; - - // Configuration for direct-path (via ALTS) with workload identity. - WorkloadALTSConfig workload_alts_config = 53; - - // Configuration for the fine-grained cost management feature. - CostManagementConfig cost_management_config = 45; - - // Telemetry integration for the cluster. - ClusterTelemetry cluster_telemetry = 46; - - // Configuration for Cloud TPU support; - TpuConfig tpu_config = 47; - - // Notification configuration of the cluster. - NotificationConfig notification_config = 49; - - // Configuration of Confidential Nodes. - // All the nodes in the cluster will be Confidential VM once enabled. - ConfidentialNodes confidential_nodes = 50; - - // Configuration for Identity Service component. - IdentityServiceConfig identity_service_config = 54; - - // [Output only] Server-defined URL for the resource. - string self_link = 100; - - // [Output only] The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field is deprecated, use location instead. - string zone = 101 [deprecated = true]; - - // [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. - string endpoint = 102; - - // 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 - string initial_cluster_version = 103; - - // [Output only] The current software version of the master endpoint. - string current_master_version = 104; - - // [Output only] Deprecated, use - // [NodePool.version](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters.nodePools) - // 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. - string current_node_version = 105 [deprecated = true]; - - // [Output only] The time the cluster was created, in - // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string create_time = 106; - - // [Output only] The current status of this cluster. - Status status = 107; - - // [Output only] Deprecated. Use conditions instead. - // Additional information about the current status of this - // cluster, if available. - string status_message = 108 [deprecated = true]; - - // [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. - int32 node_ipv4_cidr_size = 109; - - // [Output only] The IP address range of the Kubernetes services in - // this cluster, in - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `1.2.3.4/29`). Service addresses are - // typically put in the last `/16` from the container CIDR. - string services_ipv4_cidr = 110; - - // Deprecated. Use node_pools.instance_group_urls. - repeated string instance_group_urls = 111 [deprecated = true]; - - // [Output only] The number of nodes currently in the cluster. Deprecated. - // Call Kubernetes API directly to retrieve node information. - int32 current_node_count = 112 [deprecated = true]; - - // [Output only] The time the cluster will be automatically - // deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string expire_time = 113; - - // [Output only] The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) - // or - // [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) - // in which the cluster resides. - string location = 114; - - // Enable the ability to use Cloud TPUs in this cluster. - // This field is deprecated, use tpu_config.enabled instead. - bool enable_tpu = 115; - - // [Output only] The IP address range of the Cloud TPUs in this cluster, in - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `1.2.3.4/29`). - string tpu_ipv4_cidr_block = 116; - - // Configuration of etcd encryption. - DatabaseEncryption database_encryption = 38; - - // Which conditions caused the current cluster state. - repeated StatusCondition conditions = 118; - - // Configuration for master components. - Master master = 124; - - // Autopilot configuration for the cluster. - Autopilot autopilot = 128; - - // Output only. Unique id for the cluster. - string id = 129 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Default NodePool settings for the entire cluster. These settings are - // overridden if specified on the specific NodePool object. - optional NodePoolDefaults node_pool_defaults = 131; - - // Logging configuration for the cluster. - LoggingConfig logging_config = 132; - - // Monitoring configuration for the cluster. - MonitoringConfig monitoring_config = 133; - - // Node pool configs that apply to all auto-provisioned node pools - // in autopilot clusters and node auto-provisioning enabled clusters. - NodePoolAutoConfig node_pool_auto_config = 136; - - // Enable/Disable Protect API features for the cluster. - optional ProtectConfig protect_config = 137; - - // This checksum is computed by the server based on the value of cluster - // fields, and may be sent on update requests to ensure the client has an - // up-to-date value before proceeding. - string etag = 139; - - // Fleet information for the cluster. - Fleet fleet = 140; - - // Enable/Disable Security Posture API features for the cluster. - SecurityPostureConfig security_posture_config = 145; -} - -// Kubernetes open source beta apis enabled on the cluster. -message K8sBetaAPIConfig { - // api name, e.g. storage.k8s.io/v1beta1/csistoragecapacities. - repeated string enabled_apis = 1; -} - -// WorkloadConfig defines the flags to enable or disable the -// workload configurations for the cluster. -message WorkloadConfig { - // Mode defines how to audit the workload configs. - enum Mode { - // Default value meaning that no mode has been specified. - MODE_UNSPECIFIED = 0; - - // This disables Workload Configuration auditing on the cluster, - // meaning that nothing is surfaced. - DISABLED = 1; - - // Applies the default set of policy auditing to a cluster's workloads. - BASIC = 4; - - // Surfaces configurations that are not in line with the - // Pod Security Standard Baseline policy. - BASELINE = 2 [deprecated = true]; - - // Surfaces configurations that are not in line with the - // Pod Security Standard Restricted policy. - RESTRICTED = 3 [deprecated = true]; - } - - // Sets which mode of auditing should be used for the cluster's workloads. - optional Mode audit_mode = 1; -} - -// ProtectConfig defines the flags needed to enable/disable features for the -// Protect API. -message ProtectConfig { - // WorkloadVulnerabilityMode defines mode to perform vulnerability scanning. - enum WorkloadVulnerabilityMode { - // Default value not specified. - WORKLOAD_VULNERABILITY_MODE_UNSPECIFIED = 0; - - // Disables Workload Vulnerability Scanning feature on the cluster. - DISABLED = 1; - - // Applies basic vulnerability scanning settings for cluster workloads. - BASIC = 2; - } - - // WorkloadConfig defines which actions are enabled for a cluster's workload - // configurations. - optional WorkloadConfig workload_config = 1; - - // Sets which mode to use for Protect workload vulnerability scanning feature. - optional WorkloadVulnerabilityMode workload_vulnerability_mode = 2; -} - -// SecurityPostureConfig defines the flags needed to enable/disable features for -// the Security Posture API. -message SecurityPostureConfig { - // Mode defines enablement mode for GKE Security posture features. - enum Mode { - // Default value not specified. - MODE_UNSPECIFIED = 0; - - // Disables Security Posture features on the cluster. - DISABLED = 1; - - // Applies Security Posture features on the cluster. - BASIC = 2; - } - - // VulnerabilityMode defines enablement mode for vulnerability scanning. - enum VulnerabilityMode { - // Default value not specified. - VULNERABILITY_MODE_UNSPECIFIED = 0; - - // Disables vulnerability scanning on the cluster. - VULNERABILITY_DISABLED = 1; - - // Applies basic vulnerability scanning on the cluster. - VULNERABILITY_BASIC = 2; - } - - // Sets which mode to use for Security Posture features. - optional Mode mode = 1; - - // Sets which mode to use for vulnerability scanning. - optional VulnerabilityMode vulnerability_mode = 2; -} - -// Subset of Nodepool message that has defaults. -message NodePoolDefaults { - // Subset of NodeConfig message that has defaults. - NodeConfigDefaults node_config_defaults = 1; -} - -// Subset of NodeConfig message that has defaults. -message NodeConfigDefaults { - // GCFS (Google Container File System, also known as Riptide) options. - GcfsConfig gcfs_config = 1; - - // Logging configuration for node pools. - NodePoolLoggingConfig logging_config = 3; -} - -// node pool configs that apply to all auto-provisioned node pools -// in autopilot clusters and node auto-provisioning enabled clusters -message NodePoolAutoConfig { - // 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 creation. Each tag within the list - // must comply with RFC1035. - NetworkTags network_tags = 1; -} - -// 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. -message ClusterUpdate { - // 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 - string desired_node_version = 4; - - // The monitoring service the cluster should use to write metrics. - // Currently available options: - // - // * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring - // service with a Kubernetes-native resource model - // * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no - // longer available as of GKE 1.15). - // * `none` - No metrics will be exported from the cluster. - // - // If left as an empty string,`monitoring.googleapis.com/kubernetes` will be - // used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. - string desired_monitoring_service = 5; - - // Configurations for the various addons available to run in the cluster. - AddonsConfig desired_addons_config = 6; - - // The node pool to be upgraded. This field is mandatory if - // "desired_node_version", "desired_image_family", - // "desired_node_pool_autoscaling", or "desired_workload_metadata_config" - // is specified and there is more than one node pool on the cluster. - string desired_node_pool_id = 7; - - // The desired image type for the node pool. - // NOTE: Set the "desired_node_pool" field as well. - string desired_image_type = 8; - - // 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. - NodePoolAutoscaling desired_node_pool_autoscaling = 9; - - // The desired list of Google Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster's nodes should be located. - // - // This list must always include the cluster's primary zone. - // - // Warning: changing cluster locations will update the locations of all node - // pools and will result in nodes being added and/or removed. - repeated string desired_locations = 10; - - // The desired configuration options for master authorized networks feature. - MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12; - - // The desired configuration options for the PodSecurityPolicy feature. - PodSecurityPolicyConfig desired_pod_security_policy_config = 14; - - // Cluster-level autoscaling configuration. - ClusterAutoscaling desired_cluster_autoscaling = 15; - - // The desired configuration options for the Binary Authorization feature. - BinaryAuthorization desired_binary_authorization = 16; - - // The logging service the cluster should use to write logs. - // Currently available options: - // - // * `logging.googleapis.com/kubernetes` - The Cloud Logging - // service with a Kubernetes-native resource model - // * `logging.googleapis.com` - The legacy Cloud Logging service (no longer - // available as of GKE 1.15). - // * `none` - no logs will be exported from the cluster. - // - // If left as an empty string,`logging.googleapis.com/kubernetes` will be - // used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. - string desired_logging_service = 19; - - // The desired configuration for exporting resource usage. - ResourceUsageExportConfig desired_resource_usage_export_config = 21; - - // Cluster-level Vertical Pod Autoscaling configuration. - VerticalPodAutoscaling desired_vertical_pod_autoscaling = 22; - - // The desired private cluster configuration. - PrivateClusterConfig desired_private_cluster_config = 25; - - // The desired config of Intra-node visibility. - IntraNodeVisibilityConfig desired_intra_node_visibility_config = 26; - - // The desired status of whether to disable default sNAT for this cluster. - DefaultSnatStatus desired_default_snat_status = 28; - - // The desired telemetry integration for the cluster. - ClusterTelemetry desired_cluster_telemetry = 30; - - // The desired release channel configuration. - ReleaseChannel desired_release_channel = 31; - - // The desired Cloud TPU configuration. - TpuConfig desired_tpu_config = 38; - - // The desired L4 Internal Load Balancer Subsetting configuration. - ILBSubsettingConfig desired_l4ilb_subsetting_config = 39; - - // The desired datapath provider for the cluster. - DatapathProvider desired_datapath_provider = 50; - - // The desired state of IPv6 connectivity to Google Services. - PrivateIPv6GoogleAccess desired_private_ipv6_google_access = 51; - - // The desired notification configuration. - NotificationConfig desired_notification_config = 55; - - // The Kubernetes version to change the master to. The only valid value is the - // latest supported version. - // - // 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 - string desired_master_version = 100; - - // The desired GCFS config for the cluster. - GcfsConfig desired_gcfs_config = 109; - - // Configuration of etcd encryption. - DatabaseEncryption desired_database_encryption = 46; - - // Configuration for Workload Identity. - WorkloadIdentityConfig desired_workload_identity_config = 47; - - // Configuration for issuance of mTLS keys and certificates to Kubernetes - // pods. - WorkloadCertificates desired_workload_certificates = 61; - - // Configuration for issuance of mTLS keys and certificates to Kubernetes - // pods. - MeshCertificates desired_mesh_certificates = 67; - - // Configuration for direct-path (via ALTS) with workload identity. - WorkloadALTSConfig desired_workload_alts_config = 62; - - // Configuration for Shielded Nodes. - ShieldedNodes desired_shielded_nodes = 48; - - // The desired configuration for the fine-grained cost management feature. - CostManagementConfig desired_cost_management_config = 49; - - // Configuration for master components. - Master desired_master = 52; - - // DNSConfig contains clusterDNS config for this cluster. - DNSConfig desired_dns_config = 53; - - // ServiceExternalIPsConfig specifies the config for the use of Services with - // ExternalIPs field. - ServiceExternalIPsConfig desired_service_external_ips_config = 60; - - // AuthenticatorGroupsConfig specifies the config for the cluster security - // groups settings. - AuthenticatorGroupsConfig desired_authenticator_groups_config = 63; - - // The desired logging configuration. - LoggingConfig desired_logging_config = 64; - - // The desired monitoring configuration. - MonitoringConfig desired_monitoring_config = 65; - - // The desired Identity Service component configuration. - IdentityServiceConfig desired_identity_service_config = 66; - - // Enable/Disable private endpoint for the cluster's master. - optional bool desired_enable_private_endpoint = 71; - - // The desired network tags that apply to all auto-provisioned node pools - // in autopilot clusters and node auto-provisioning enabled clusters. - NetworkTags desired_node_pool_auto_config_network_tags = 110; - - // Enable/Disable Protect API features for the cluster. - optional ProtectConfig desired_protect_config = 112; - - // The desired config of Gateway API on this cluster. - GatewayAPIConfig desired_gateway_api_config = 114; - - // The current etag of the cluster. - // If an etag is provided and does not match the current etag of the cluster, - // update will be blocked and an ABORTED error will be returned. - string etag = 115; - - // The desired node pool logging configuration defaults for the cluster. - NodePoolLoggingConfig desired_node_pool_logging_config = 116; - - // The desired fleet configuration for the cluster. - Fleet desired_fleet = 117; - - // The desired stack type of the cluster. - // If a stack type is provided and does not match the current stack type of - // the cluster, update will attempt to change the stack type to the new type. - StackType desired_stack_type = 119; - - // The additional pod ranges to be added to the cluster. These pod ranges - // can be used by node pools to allocate pod IPs. - AdditionalPodRangesConfig additional_pod_ranges_config = 120; - - // The additional pod ranges that are to be removed from the cluster. - // The pod ranges specified here must have been specified earlier in the - // 'additional_pod_ranges_config' argument. - AdditionalPodRangesConfig removed_additional_pod_ranges_config = 121; - - // Kubernetes open source beta apis enabled on the cluster. Only beta apis - K8sBetaAPIConfig enable_k8s_beta_apis = 122; - - // Enable/Disable Security Posture API features for the cluster. - SecurityPostureConfig desired_security_posture_config = 124; - - // The desired network performance config. - NetworkConfig.ClusterNetworkPerformanceConfig - desired_network_performance_config = 125; - - // Enable/Disable FQDN Network Policy for the cluster. - optional bool desired_enable_fqdn_network_policy = 126; - - // The desired workload policy configuration for the autopilot cluster. - WorkloadPolicyConfig desired_autopilot_workload_policy_config = 128; - - // Beta APIs enabled for cluster. - K8sBetaAPIConfig desired_k8s_beta_apis = 131; -} - -// AdditionalPodRangesConfig is the configuration for additional pod secondary -// ranges supporting the ClusterUpdate message. -message AdditionalPodRangesConfig { - // Name for pod secondary ipv4 range which has the actual range defined ahead. - repeated string pod_range_names = 1; - - // Output only. [Output only] Information for additional pod range. - repeated RangeInfo pod_range_info = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// RangeInfo contains the range name and the range utilization by this cluster. -message RangeInfo { - // Output only. [Output only] Name of a range. - string range_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. [Output only] The utilization of the range. - double utilization = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// This operation resource represents operations that may have happened or are -// happening on the cluster. All fields are output only. -message Operation { - // Current status of the operation. - enum Status { - // Not set. - STATUS_UNSPECIFIED = 0; - - // The operation has been created. - PENDING = 1; - - // The operation is currently running. - RUNNING = 2; - - // The operation is done, either cancelled or completed. - DONE = 3; - - // The operation is aborting. - ABORTING = 4; - } - - // Operation type categorizes the operation. - enum Type { - // Not set. - TYPE_UNSPECIFIED = 0; - - // The cluster is being created. The cluster should be assumed to be - // unusable until the operation finishes. - // - // In the event of the operation failing, the cluster will enter the [ERROR - // state][Cluster.Status.ERROR] and eventually be deleted. - CREATE_CLUSTER = 1; - - // The cluster is being deleted. The cluster should be assumed to be - // unusable as soon as this operation starts. - // - // In the event of the operation failing, the cluster will enter the [ERROR - // state][Cluster.Status.ERROR] and the deletion will be automatically - // retried until completed. - DELETE_CLUSTER = 2; - - // The [cluster - // version][google.container.v1beta1.ClusterUpdate.desired_master_version] - // is being updated. Note that this includes "upgrades" to the same version, - // which are simply a recreation. This also includes - // [auto-upgrades](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades#upgrading_automatically). - // For more details, see [documentation on cluster - // upgrades](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades#cluster_upgrades). - UPGRADE_MASTER = 3; - - // A node pool is being updated. Despite calling this an "upgrade", this - // includes most forms of updates to node pools. This also includes - // [auto-upgrades](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-upgrades). - // - // This operation sets the - // [progress][google.container.v1beta1.Operation.progress] field and may be - // [canceled][google.container.v1beta1.ClusterManager.CancelOperation]. - // - // The upgrade strategy depends on [node pool - // configuration](https://cloud.google.com/kubernetes-engine/docs/concepts/node-pool-upgrade-strategies). - // The nodes are generally still usable during this operation. - UPGRADE_NODES = 4; - - // A problem has been detected with the control plane and is being repaired. - // This operation type is initiated by GKE. For more details, see - // [documentation on - // repairs](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#repairs). - REPAIR_CLUSTER = 5; - - // The cluster is being updated. This is a broad category of operations and - // includes operations that only change metadata as well as those that must - // recreate the entire cluster. If the control plane must be recreated, this - // will cause temporary downtime for zonal clusters. - // - // Some features require recreating the nodes as well. Those will be - // recreated as separate operations and the update may not be completely - // functional until the node pools recreations finish. Node recreations will - // generally follow [maintenance - // policies](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions). - // - // Some GKE-initiated operations use this type. This includes certain types - // of auto-upgrades and incident mitigations. - UPDATE_CLUSTER = 6; - - // A node pool is being created. The node pool should be assumed to be - // unusable until this operation finishes. In the event of an error, the - // node pool may be partially created. - // - // If enabled, [node - // autoprovisioning](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-provisioning) - // may have automatically initiated such operations. - CREATE_NODE_POOL = 7; - - // The node pool is being deleted. The node pool should be assumed to be - // unusable as soon as this operation starts. - DELETE_NODE_POOL = 8; - - // The node pool's - // [manamagent][google.container.v1beta1.NodePool.management] field is being - // updated. These operations only update metadata and may be concurrent with - // most other operations. - SET_NODE_POOL_MANAGEMENT = 9; - - // A problem has been detected with nodes and [they are being - // repaired](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-repair). - // This operation type is initiated by GKE, typically automatically. This - // operation may be concurrent with other operations and there may be - // multiple repairs occurring on the same node pool. - AUTO_REPAIR_NODES = 10; - - // Unused. Automatic node upgrade uses - // [UPGRADE_NODES][google.container.v1beta1.Operation.Type.UPGRADE_NODES]. - AUTO_UPGRADE_NODES = 11 [deprecated = true]; - - // Unused. Updating labels uses - // [UPDATE_CLUSTER][google.container.v1beta1.Operation.Type.UPDATE_CLUSTER]. - SET_LABELS = 12 [deprecated = true]; - - // Unused. Updating master auth uses - // [UPDATE_CLUSTER][google.container.v1beta1.Operation.Type.UPDATE_CLUSTER]. - SET_MASTER_AUTH = 13 [deprecated = true]; - - // The node pool is being resized. With the exception of resizing to or from - // size zero, the node pool is generally usable during this operation. - SET_NODE_POOL_SIZE = 14; - - // Unused. Updating network policy uses - // [UPDATE_CLUSTER][google.container.v1beta1.Operation.Type.UPDATE_CLUSTER]. - SET_NETWORK_POLICY = 15 [deprecated = true]; - - // Unused. Updating maintenance policy uses - // [UPDATE_CLUSTER][google.container.v1beta1.Operation.Type.UPDATE_CLUSTER]. - SET_MAINTENANCE_POLICY = 16 [deprecated = true]; - - // The control plane is being resized. This operation type is initiated by - // GKE. These operations are often performed preemptively to ensure that the - // control plane has sufficient resources and is not typically an indication - // of issues. For more details, see - // [documentation on - // resizes](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#repairs). - RESIZE_CLUSTER = 18; - } - - // The server-assigned ID for the operation. - string name = 1; - - // The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // operation is taking place. This field is deprecated, use location instead. - string zone = 2 [deprecated = true]; - - // The operation type. - Type operation_type = 3; - - // The current status of the operation. - Status status = 4; - - // Detailed operation progress, if available. - string detail = 8; - - // Output only. If an error has occurred, a textual description of the error. - // Deprecated. Use field error instead. - string status_message = 5 - [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; - - // Server-defined URI for the operation. Example: - // `https://container.googleapis.com/v1alpha1/projects/123/locations/us-central1/operations/operation-123`. - string self_link = 6; - - // Server-defined URI for the target of the operation. The format of this is a - // URI to the resource being modified (such as a cluster, node pool, or node). - // For node pool repairs, there may be multiple nodes being repaired, but only - // one will be the target. - // - // Examples: - // - // - - // ## - // `https://container.googleapis.com/v1/projects/123/locations/us-central1/clusters/my-cluster` - // - // ## - // `https://container.googleapis.com/v1/projects/123/zones/us-central1-c/clusters/my-cluster/nodePools/my-np` - // - // `https://container.googleapis.com/v1/projects/123/zones/us-central1-c/clusters/my-cluster/nodePools/my-np/node/my-node` - string target_link = 7; - - // [Output only] The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) - // or - // [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) - // in which the cluster resides. - string location = 9; - - // [Output only] The time the operation started, in - // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string start_time = 10; - - // [Output only] The time the operation completed, in - // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string end_time = 11; - - // Output only. [Output only] Progress information for an operation. - OperationProgress progress = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Which conditions caused the current cluster state. - // Deprecated. Use field error instead. - repeated StatusCondition cluster_conditions = 13 [deprecated = true]; - - // Which conditions caused the current node pool state. - // Deprecated. Use field error instead. - repeated StatusCondition nodepool_conditions = 14 [deprecated = true]; - - // The error result of the operation in case of failure. - google.rpc.Status error = 15; -} - -// Information about operation (or operation stage) progress. -message OperationProgress { - // Progress metric is (string, int|float|string) pair. - message Metric { - // Required. Metric name, e.g., "nodes total", "percent done". - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Strictly one of the values is required. - oneof value { - // For metrics with integer value. - int64 int_value = 2; - - // For metrics with floating point value. - double double_value = 3; - - // For metrics with custom values (ratios, visual progress, etc.). - string string_value = 4; - } - } - - // A non-parameterized string describing an operation stage. - // Unset for single-stage operations. - string name = 1; - - // Status of an operation stage. - // Unset for single-stage operations. - Operation.Status status = 2; - - // Progress metric bundle, for example: - // metrics: [{name: "nodes done", int_value: 15}, - // {name: "nodes total", int_value: 32}] - // or - // metrics: [{name: "progress", double_value: 0.56}, - // {name: "progress scale", double_value: 1.0}] - repeated Metric metrics = 3; - - // Substages of an operation or a stage. - repeated OperationProgress stages = 4; -} - -// CreateClusterRequest creates a cluster. -message CreateClusterRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the parent - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. A [cluster - // resource](https://cloud.google.com/container-engine/reference/rest/v1beta1/projects.locations.clusters) - Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; - - // The parent (project and location) where the cluster will be created. - // Specified in the format `projects/*/locations/*`. - string parent = 5; -} - -// GetClusterRequest gets the settings of a cluster. -message GetClusterRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to retrieve. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to retrieve. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 5; -} - -// UpdateClusterRequest updates the settings of a cluster. -message UpdateClusterRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. A description of the update. - ClusterUpdate update = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to update. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 5; -} - -// SetNodePoolVersionRequest updates the version of a node pool. -message UpdateNodePoolRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the node pool to upgrade. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // 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 - string node_version = 5 [(google.api.field_behavior) = REQUIRED]; - - // Required. The desired image type for the node pool. Please see - // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for - // available image types. - string image_type = 6 [(google.api.field_behavior) = REQUIRED]; - - // The desired list of Google Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) in which the - // node pool's nodes should be located. Changing the locations for a node pool - // will result in nodes being either created or removed from the node pool, - // depending on whether locations are being added or removed. - repeated string locations = 13; - - // The desired workload metadata config for the node pool. - WorkloadMetadataConfig workload_metadata_config = 14; - - // The name (project, location, cluster, node pool) of the node pool to - // update. Specified in the format - // `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 8; - - // Upgrade settings control disruption and speed of the upgrade. - NodePool.UpgradeSettings upgrade_settings = 15; - - // The desired network tags to be applied to all nodes in the node pool. - // If this field is not present, the tags will not be changed. Otherwise, - // the existing network tags will be *replaced* with the provided tags. - NetworkTags tags = 16; - - // The desired node taints to be applied to all nodes in the node pool. - // If this field is not present, the taints will not be changed. Otherwise, - // the existing node taints will be *replaced* with the provided taints. - NodeTaints taints = 17; - - // The desired node labels to be applied to all nodes in the node pool. - // If this field is not present, the labels will not be changed. Otherwise, - // the existing node labels will be *replaced* with the provided labels. - NodeLabels labels = 18; - - // Parameters that can be configured on Linux nodes. - LinuxNodeConfig linux_node_config = 19; - - // Node kubelet configs. - NodeKubeletConfig kubelet_config = 20; - - // Node network config. - NodeNetworkConfig node_network_config = 21; - - // GCFS config. - GcfsConfig gcfs_config = 22; - - // Confidential nodes config. - // All the nodes in the node pool will be Confidential VM once enabled. - ConfidentialNodes confidential_nodes = 23; - - // Enable or disable gvnic on the node pool. - VirtualNIC gvnic = 29; - - // The current etag of the node pool. - // If an etag is provided and does not match the current etag of the node - // pool, update will be blocked and an ABORTED error will be returned. - string etag = 30; - - // Enable or disable NCCL fast socket for the node pool. - FastSocket fast_socket = 31; - - // Logging configuration. - NodePoolLoggingConfig logging_config = 32; - - // The resource labels for the node pool to use to annotate any related - // Google Compute Engine resources. - ResourceLabels resource_labels = 33; - - // Parameters that can be configured on Windows nodes. - WindowsNodeConfig windows_node_config = 34; -} - -// SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool. -message SetNodePoolAutoscalingRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the node pool to upgrade. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Autoscaling configuration for the node pool. - NodePoolAutoscaling autoscaling = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster, node pool) of the node pool to set - // autoscaler settings. Specified in the format - // `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 6; -} - -// SetLoggingServiceRequest sets the logging service of a cluster. -message SetLoggingServiceRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. The logging service the cluster should use to write logs. - // Currently available options: - // - // * `logging.googleapis.com/kubernetes` - The Cloud Logging - // service with a Kubernetes-native resource model - // * `logging.googleapis.com` - The legacy Cloud Logging service (no longer - // available as of GKE 1.15). - // * `none` - no logs will be exported from the cluster. - // - // If left as an empty string,`logging.googleapis.com/kubernetes` will be - // used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. - string logging_service = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set logging. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 5; -} - -// SetMonitoringServiceRequest sets the monitoring service of a cluster. -message SetMonitoringServiceRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. The monitoring service the cluster should use to write metrics. - // Currently available options: - // - // * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring - // service with a Kubernetes-native resource model - // * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no - // longer available as of GKE 1.15). - // * `none` - No metrics will be exported from the cluster. - // - // If left as an empty string,`monitoring.googleapis.com/kubernetes` will be - // used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. - string monitoring_service = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set monitoring. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 6; -} - -// SetAddonsRequest sets the addons associated with the cluster. -message SetAddonsConfigRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. The desired configurations for the various addons available to - // run in the cluster. - AddonsConfig addons_config = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set addons. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 6; -} - -// SetLocationsRequest sets the locations of the cluster. -message SetLocationsRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. The desired list of Google Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) 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. - repeated string locations = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set locations. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 6; -} - -// UpdateMasterRequest updates the master of the cluster. -message UpdateMasterRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // 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 - string master_version = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to update. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 7; -} - -// SetMasterAuthRequest updates the admin password of a cluster. -message SetMasterAuthRequest { - // Operation type: what type update to perform. - enum Action { - // Operation is unknown and will error out. - UNKNOWN = 0; - - // Set the password to a user generated value. - SET_PASSWORD = 1; - - // Generate a new password and set it to that. - GENERATE_PASSWORD = 2; - - // 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. - SET_USERNAME = 3; - } - - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. The exact form of action to be taken on the master auth. - Action action = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. A description of the update. - MasterAuth update = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set auth. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 7; -} - -// DeleteClusterRequest deletes a cluster. -message DeleteClusterRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to delete. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to delete. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 4; -} - -// ListClustersRequest lists clusters. -message ListClustersRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides, or "-" for all zones. This field has been deprecated and - // replaced by the parent field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The parent (project and location) where the clusters will be listed. - // Specified in the format `projects/*/locations/*`. - // Location "-" matches all zones and all regions. - string parent = 4; -} - -// ListClustersResponse is the result of ListClustersRequest. -message ListClustersResponse { - // A list of clusters in the project in the specified zone, or - // across all ones. - repeated Cluster clusters = 1; - - // If any zones are listed here, the list of clusters returned - // may be missing those zones. - repeated string missing_zones = 2; -} - -// GetOperationRequest gets a single operation. -message GetOperationRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The server-assigned `name` of the operation. - // This field has been deprecated and replaced by the name field. - string operation_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The name (project, location, operation id) of the operation to get. - // Specified in the format `projects/*/locations/*/operations/*`. - string name = 5; -} - -// ListOperationsRequest lists operations. -message ListOperationsRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) to return - // operations for, or `-` for all zones. This field has been deprecated and - // replaced by the parent field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The parent (project and location) where the operations will be listed. - // Specified in the format `projects/*/locations/*`. - // Location "-" matches all zones and all regions. - string parent = 4; -} - -// CancelOperationRequest cancels a single operation. -message CancelOperationRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // operation resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The server-assigned `name` of the operation. - // This field has been deprecated and replaced by the name field. - string operation_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The name (project, location, operation id) of the operation to cancel. - // Specified in the format `projects/*/locations/*/operations/*`. - string name = 4; -} - -// ListOperationsResponse is the result of ListOperationsRequest. -message ListOperationsResponse { - // A list of operations in the project in the specified zone. - repeated Operation operations = 1; - - // If any zones are listed here, the list of operations returned - // may be missing the operations from those zones. - repeated string missing_zones = 2; -} - -// Gets the current Kubernetes Engine service configuration. -message GetServerConfigRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) to return - // operations for. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The name (project and location) of the server config to get, - // specified in the format `projects/*/locations/*`. - string name = 4; -} - -// Kubernetes Engine service configuration. -message ServerConfig { - // ReleaseChannelConfig exposes configuration for a release channel. - message ReleaseChannelConfig { - // Deprecated. - message AvailableVersion { - option deprecated = true; - - // Kubernetes version. - string version = 1; - - // Reason for availability. - string reason = 2; - } - - // The release channel this configuration applies to. - ReleaseChannel.Channel channel = 1; - - // The default version for newly created clusters on the channel. - string default_version = 2; - - // Deprecated. - // This field has been deprecated and replaced with the valid_versions - // field. - repeated AvailableVersion available_versions = 3 [deprecated = true]; - - // List of valid versions for the channel. - repeated string valid_versions = 4; - } - - // Version of Kubernetes the service deploys by default. - string default_cluster_version = 1; - - // List of valid node upgrade target versions, in descending order. - repeated string valid_node_versions = 3; - - // Default image type. - string default_image_type = 4; - - // List of valid image types. - repeated string valid_image_types = 5; - - // List of valid master versions, in descending order. - repeated string valid_master_versions = 6; - - // List of release channel configurations. - repeated ReleaseChannelConfig channels = 9; - - // Maps of Kubernetes version and supported Windows server versions. - map windows_version_maps = 10; -} - -// Best effort provisioning. -message BestEffortProvisioning { - // When this is enabled, cluster/node pool creations will ignore non-fatal - // errors like stockout to best provision as many nodes as possible right now - // and eventually bring up all target number of nodes - bool enabled = 1; - - // Minimum number of nodes to be provisioned to be considered as succeeded, - // and the rest of nodes will be provisioned gradually and eventually when - // stockout issue has been resolved. - int32 min_provision_nodes = 2; -} - -// Windows server versions. -message WindowsVersions { - // Windows server version. - message WindowsVersion { - // Windows server image type - string image_type = 1; - - // Windows server build number - string os_version = 2; - - // Mainstream support end date - google.type.Date support_end_date = 3; - } - - // List of Windows server versions. - repeated WindowsVersion windows_versions = 1; -} - -// CreateNodePoolRequest creates a node pool for a cluster. -message CreateNodePoolRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the parent - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the parent field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. The node pool to create. - NodePool node_pool = 4 [(google.api.field_behavior) = REQUIRED]; - - // The parent (project, location, cluster name) where the node pool will be - // created. Specified in the format - // `projects/*/locations/*/clusters/*`. - string parent = 6; -} - -// DeleteNodePoolRequest deletes a node pool for a cluster. -message DeleteNodePoolRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the node pool to delete. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster, node pool id) of the node pool to - // delete. Specified in the format - // `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 6; -} - -// ListNodePoolsRequest lists the node pool(s) for a cluster. -message ListNodePoolsRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the parent - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the parent field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The parent (project, location, cluster name) where the node pools will be - // listed. Specified in the format `projects/*/locations/*/clusters/*`. - string parent = 5; -} - -// GetNodePoolRequest retrieves a node pool for a cluster. -message GetNodePoolRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the node pool. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster, node pool id) of the node pool to - // get. Specified in the format - // `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 6; -} - -// Settings for blue-green upgrade. -message BlueGreenSettings { - // Standard rollout policy is the default policy for blue-green. - message StandardRolloutPolicy { - // Blue pool size to drain in a batch. - oneof update_batch_size { - // Percentage of the blue pool nodes to drain in a batch. - // The range of this field should be (0.0, 1.0]. - float batch_percentage = 1; - - // Number of blue nodes to drain in a batch. - int32 batch_node_count = 2; - } - - // Soak time after each batch gets drained. Default to zero. - optional google.protobuf.Duration batch_soak_duration = 3; - } - - // The rollout policy controls the general rollout progress of blue-green. - oneof rollout_policy { - // Standard policy for the blue-green upgrade. - StandardRolloutPolicy standard_rollout_policy = 1; - } - - // Time needed after draining entire blue pool. After this period, blue pool - // will be cleaned up. - optional google.protobuf.Duration node_pool_soak_duration = 2; -} - -// 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. -// These upgrade settings control the level of parallelism and the level of -// disruption caused by an upgrade. -// -// maxUnavailable controls the number of nodes that can be simultaneously -// unavailable. -// -// maxSurge controls the number of additional nodes that can be added to the -// node pool temporarily for the time of the upgrade to increase the number of -// available nodes. -// -// (maxUnavailable + maxSurge) determines the level of parallelism (how many -// nodes are being upgraded at the same time). -// -// Note: upgrades inevitably introduce some disruption since workloads need to -// be moved from old nodes to new, upgraded ones. Even if maxUnavailable=0, -// this holds true. (Disruption stays within the limits of -// PodDisruptionBudget, if it is configured.) -// -// Consider a hypothetical node pool with 5 nodes having maxSurge=2, -// maxUnavailable=1. This means the upgrade process upgrades 3 nodes -// simultaneously. It creates 2 additional (upgraded) nodes, then it brings -// down 3 old (not yet upgraded) nodes at the same time. This ensures that -// there are always at least 4 nodes available. -message NodePool { - // These upgrade settings configure the upgrade strategy for the node pool. - // Use strategy to switch between the strategies applied to the node pool. - // - // If the strategy is SURGE, use max_surge and max_unavailable to control - // the level of parallelism and the level of disruption caused by upgrade. - // 1. maxSurge controls the number of additional nodes that can be added to - // the node pool temporarily for the time of the upgrade to increase the - // number of available nodes. - // 2. maxUnavailable controls the number of nodes that can be simultaneously - // unavailable. - // 3. (maxUnavailable + maxSurge) determines the level of parallelism (how - // many nodes are being upgraded at the same time). - // - // If the strategy is BLUE_GREEN, use blue_green_settings to configure the - // blue-green upgrade related settings. - // 1. standard_rollout_policy is the default policy. The policy is used to - // control the way blue pool gets drained. The draining is executed in the - // batch mode. The batch size could be specified as either percentage of the - // node pool size or the number of nodes. batch_soak_duration is the soak - // time after each batch gets drained. - // 2. node_pool_soak_duration is the soak time after all blue nodes are - // drained. After this period, the blue pool nodes will be deleted. - message UpgradeSettings { - // The maximum number of nodes that can be created beyond the current size - // of the node pool during the upgrade process. - int32 max_surge = 1; - - // The maximum number of nodes that can be simultaneously unavailable during - // the upgrade process. A node is considered available if its status is - // Ready. - int32 max_unavailable = 2; - - // Update strategy of the node pool. - optional NodePoolUpdateStrategy strategy = 3; - - // Settings for blue-green upgrade strategy. - optional BlueGreenSettings blue_green_settings = 4; - } - - // UpdateInfo contains resource (instance groups, etc), status and other - // intermediate information relevant to a node pool upgrade. - message UpdateInfo { - // Information relevant to blue-green upgrade. - message BlueGreenInfo { - // Phase represents the different stages blue-green upgrade is running in. - enum Phase { - // Unspecified phase. - PHASE_UNSPECIFIED = 0; - - // blue-green upgrade has been initiated. - UPDATE_STARTED = 1; - - // Start creating green pool nodes. - CREATING_GREEN_POOL = 2; - - // Start cordoning blue pool nodes. - CORDONING_BLUE_POOL = 3; - - // Start draining blue pool nodes. - DRAINING_BLUE_POOL = 4; - - // Start soaking time after draining entire blue pool. - NODE_POOL_SOAKING = 5; - - // Start deleting blue nodes. - DELETING_BLUE_POOL = 6; - - // Rollback has been initiated. - ROLLBACK_STARTED = 7; - } - - // Current blue-green upgrade phase. - Phase phase = 1; - - // The resource URLs of the [managed instance groups] - // (/compute/docs/instance-groups/creating-groups-of-managed-instances) - // associated with blue pool. - repeated string blue_instance_group_urls = 2; - - // The resource URLs of the [managed instance groups] - // (/compute/docs/instance-groups/creating-groups-of-managed-instances) - // associated with green pool. - repeated string green_instance_group_urls = 3; - - // Time to start deleting blue pool to complete blue-green upgrade, - // in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string blue_pool_deletion_start_time = 4; - - // Version of green pool. - string green_pool_version = 5; - } - - // Information of a blue-green upgrade. - BlueGreenInfo blue_green_info = 1; - } - - // The current status of the node pool instance. - enum Status { - // Not set. - STATUS_UNSPECIFIED = 0; - - // The PROVISIONING state indicates the node pool is being created. - PROVISIONING = 1; - - // The RUNNING state indicates the node pool has been created - // and is fully usable. - RUNNING = 2; - - // 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. - RUNNING_WITH_ERROR = 3; - - // 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. - RECONCILING = 4; - - // The STOPPING state indicates the node pool is being deleted. - STOPPING = 5; - - // The ERROR state indicates the node pool may be unusable. Details - // can be found in the `statusMessage` field. - ERROR = 6; - } - - // PlacementPolicy defines the placement policy used by the node pool. - message PlacementPolicy { - // Type defines the type of placement policy. - enum Type { - // TYPE_UNSPECIFIED specifies no requirements on nodes - // placement. - TYPE_UNSPECIFIED = 0; - - // COMPACT specifies node placement in the same availability domain to - // ensure low communication latency. - COMPACT = 1; - } - - // The type of placement. - Type type = 1; - - // TPU placement topology for pod slice node pool. - // https://cloud.google.com/tpu/docs/types-topologies#tpu_topologies - string tpu_topology = 2; - } - - // The name of the node pool. - string name = 1; - - // The node configuration of the pool. - NodeConfig config = 2; - - // The initial node count for the pool. You must ensure that your - // 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; - - // The list of Google Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) in which the - // NodePool's nodes should be located. - // - // If this value is unspecified during node pool creation, the - // [Cluster.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters#Cluster.FIELDS.locations) - // value will be used, instead. - // - // Warning: changing node pool locations will result in nodes being added - // and/or removed. - repeated string locations = 13; - - // Networking configuration for this NodePool. If specified, it overrides the - // cluster-level defaults. - NodeNetworkConfig network_config = 14; - - // [Output only] Server-defined URL for the resource. - string self_link = 100; - - // The version of Kubernetes running on this NodePool's nodes. If unspecified, - // it defaults as described - // [here](https://cloud.google.com/kubernetes-engine/versioning#specifying_node_version). - string version = 101; - - // [Output only] The resource URLs of the [managed instance - // groups](https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-managed-instances) - // associated with this node pool. - // During the node pool blue-green upgrade operation, the URLs contain both - // blue and green resources. - repeated string instance_group_urls = 102; - - // [Output only] The status of the nodes in this pool instance. - Status status = 103; - - // [Output only] Deprecated. Use conditions instead. - // Additional information about the current status of this - // node pool instance, if available. - string status_message = 104 [deprecated = true]; - - // Autoscaler configuration for this NodePool. Autoscaler is enabled - // only if a valid configuration is present. - NodePoolAutoscaling autoscaling = 4; - - // NodeManagement configuration for this NodePool. - NodeManagement management = 5; - - // The constraint on the maximum number of pods that can be run - // simultaneously on a node in the node pool. - MaxPodsConstraint max_pods_constraint = 6; - - // Which conditions caused the current node pool state. - repeated StatusCondition conditions = 105; - - // [Output only] The pod CIDR block size per node in this node pool. - int32 pod_ipv4_cidr_size = 7; - - // Upgrade settings control disruption and speed of the upgrade. - UpgradeSettings upgrade_settings = 107; - - // Specifies the node placement policy. - PlacementPolicy placement_policy = 108; - - // Output only. [Output only] Update info contains relevant information during - // a node pool update. - UpdateInfo update_info = 109 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // This checksum is computed by the server based on the value of node pool - // fields, and may be sent on update requests to ensure the client has an - // up-to-date value before proceeding. - string etag = 110; - - // Enable best effort provisioning for nodes - BestEffortProvisioning best_effort_provisioning = 113; -} - -// NodeManagement defines the set of node management services turned on for the -// node pool. -message NodeManagement { - // Whether the nodes will be automatically upgraded. - bool auto_upgrade = 1; - - // Whether the nodes will be automatically repaired. - bool auto_repair = 2; - - // Specifies the Auto Upgrade knobs for the node pool. - AutoUpgradeOptions upgrade_options = 10; -} - -// AutoUpgradeOptions defines the set of options for the user to control how -// the Auto Upgrades will proceed. -message AutoUpgradeOptions { - // [Output only] This field is set when upgrades are about to commence - // with the approximate start time for the upgrades, in - // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string auto_upgrade_start_time = 1; - - // [Output only] This field is set when upgrades are about to commence - // with the description of the upgrade. - string description = 2; -} - -// MaintenancePolicy defines the maintenance policy to be used for the cluster. -message MaintenancePolicy { - // Specifies the maintenance window in which maintenance may be performed. - MaintenanceWindow window = 1; - - // 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. - string resource_version = 3; -} - -// MaintenanceWindow defines the maintenance window to be used for the cluster. -message MaintenanceWindow { - // Unimplemented, reserved for future use. - // HourlyMaintenanceWindow hourly_maintenance_window = 1; - oneof policy { - // DailyMaintenanceWindow specifies a daily maintenance operation window. - DailyMaintenanceWindow daily_maintenance_window = 2; - - // 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. - RecurringTimeWindow recurring_window = 3; - } - - // Exceptions to maintenance window. Non-emergency maintenance should not - // occur in these windows. - map maintenance_exclusions = 4; -} - -// Represents an arbitrary window of time. -message TimeWindow { - oneof options { - // MaintenanceExclusionOptions provides maintenance exclusion related - // options. - MaintenanceExclusionOptions maintenance_exclusion_options = 3; - } - - // The time that the window first starts. - google.protobuf.Timestamp start_time = 1; - - // The time that the window ends. The end time should take place after the - // start time. - google.protobuf.Timestamp end_time = 2; -} - -// Represents the Maintenance exclusion option. -message MaintenanceExclusionOptions { - // Scope of exclusion. - enum Scope { - // NO_UPGRADES excludes all upgrades, including patch upgrades and minor - // upgrades across control planes and nodes. This is the default exclusion - // behavior. - NO_UPGRADES = 0; - - // NO_MINOR_UPGRADES excludes all minor upgrades for the cluster, only - // patches are allowed. - NO_MINOR_UPGRADES = 1; - - // NO_MINOR_OR_NODE_UPGRADES excludes all minor upgrades for the cluster, - // and also exclude all node pool upgrades. Only control - // plane patches are allowed. - NO_MINOR_OR_NODE_UPGRADES = 2; - } - - // Scope specifies the upgrade scope which upgrades are blocked by the - // exclusion. - Scope scope = 1; -} - -// Represents an arbitrary window of time that recurs. -message RecurringTimeWindow { - // The window of the first recurrence. - TimeWindow window = 1; - - // 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. - string recurrence = 2; -} - -// Time window specified for daily maintenance operations. -message DailyMaintenanceWindow { - // Time within the maintenance window to start the maintenance operations. - // It must be in format "HH:MM", where HH : [00-23] and MM : [00-59] GMT. - string start_time = 2; - - // [Output only] Duration of the time window, automatically chosen to be - // smallest possible in the given scenario. - string duration = 3; -} - -// SetNodePoolManagementRequest sets the node management properties of a node -// pool. -message SetNodePoolManagementRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to update. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the node pool to update. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. NodeManagement configuration for the node pool. - NodeManagement management = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster, node pool id) of the node pool to set - // management properties. Specified in the format - // `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 7; -} - -// SetNodePoolSizeRequest sets the size of a node pool. -message SetNodePoolSizeRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to update. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the node pool to update. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. The desired node count for the pool. - int32 node_count = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster, node pool id) of the node pool to set - // size. - // Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 7; -} - -// CompleteNodePoolUpgradeRequest sets the name of target node pool to complete -// upgrade. -message CompleteNodePoolUpgradeRequest { - // The name (project, location, cluster, node pool id) of the node pool to - // complete upgrade. - // Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 1; -} - -// RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed -// NodePool upgrade. This will be an no-op if the last upgrade successfully -// completed. -message RollbackNodePoolUpgradeRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to rollback. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the node pool to rollback. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster, node pool id) of the node poll to - // rollback upgrade. - // Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 6; - - // Option for rollback to ignore the PodDisruptionBudget. - // Default value is false. - bool respect_pdb = 7; -} - -// ListNodePoolsResponse is the result of ListNodePoolsRequest. -message ListNodePoolsResponse { - // A list of node pools for a cluster. - repeated NodePool node_pools = 1; -} - -// 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. -message ClusterAutoscaling { - // Defines possible options for autoscaling_profile field. - enum AutoscalingProfile { - // No change to autoscaling configuration. - PROFILE_UNSPECIFIED = 0; - - // Prioritize optimizing utilization of resources. - OPTIMIZE_UTILIZATION = 1; - - // Use default (balanced) autoscaling configuration. - BALANCED = 2; - } - - // Enables automatic node pool creation and deletion. - bool enable_node_autoprovisioning = 1; - - // Contains global constraints regarding minimum and maximum - // amount of resources in the cluster. - repeated ResourceLimit resource_limits = 2; - - // Defines autoscaling behaviour. - AutoscalingProfile autoscaling_profile = 3; - - // AutoprovisioningNodePoolDefaults contains defaults for a node pool - // created by NAP. - AutoprovisioningNodePoolDefaults autoprovisioning_node_pool_defaults = 4; - - // The list of Google Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) in which the - // NodePool's nodes can be created by NAP. - repeated string autoprovisioning_locations = 5; -} - -// AutoprovisioningNodePoolDefaults contains defaults for a node pool created -// by NAP. -message AutoprovisioningNodePoolDefaults { - // 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](https://cloud.google.com/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. - repeated string oauth_scopes = 1; - - // The Google Cloud Platform Service Account to be used by the node VMs. - // Specify the email address of the Service Account; otherwise, if no Service - // Account is specified, the "default" service account is used. - string service_account = 2; - - // Upgrade settings control disruption and speed of the upgrade. - NodePool.UpgradeSettings upgrade_settings = 3; - - // NodeManagement configuration for this NodePool. - NodeManagement management = 4; - - // Deprecated. Minimum CPU platform to be used for NAP created node pools. - // 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](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform). - // This field is deprecated, min_cpu_platform should be specified using - // `cloud.google.com/requested-min-cpu-platform` label selector on the pod. - // To unset the min cpu platform field pass "automatic" - // as field value. - string min_cpu_platform = 5 [deprecated = true]; - - // 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. - int32 disk_size_gb = 6; - - // Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or - // 'pd-balanced') - // - // If unspecified, the default disk type is 'pd-standard' - string disk_type = 7; - - // Shielded Instance options. - ShieldedInstanceConfig shielded_instance_config = 8; - - // - // The Customer Managed Encryption Key used to encrypt the boot disk attached - // to each node in the node pool. This should be of the form - // projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. - // For more information about protecting resources with Cloud KMS Keys please - // see: - // https://cloud.google.com/compute/docs/disks/customer-managed-encryption - string boot_disk_kms_key = 9; - - // The image type to use for NAP created node. Please see - // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for - // available image types. - string image_type = 10; - - // Enable or disable Kubelet read only port. - optional bool insecure_kubelet_readonly_port_enabled = 13; -} - -// Contains information about amount of some resource in the cluster. -// For memory, value should be in GB. -message ResourceLimit { - // Resource name "cpu", "memory" or gpu-specific string. - string resource_type = 1; - - // Minimum amount of the resource in the cluster. - int64 minimum = 2; - - // Maximum amount of the resource in the cluster. - int64 maximum = 3; -} - -// NodePoolAutoscaling contains information required by cluster autoscaler to -// adjust the size of the node pool to the current cluster usage. -message NodePoolAutoscaling { - // Location policy specifies how zones are picked when scaling up the - // nodepool. - enum LocationPolicy { - // Not set. - LOCATION_POLICY_UNSPECIFIED = 0; - - // BALANCED is a best effort policy that aims to balance the sizes of - // different zones. - BALANCED = 1; - - // ANY policy picks zones that have the highest capacity available. - ANY = 2; - } - - // Is autoscaling enabled for this node pool. - bool enabled = 1; - - // Minimum number of nodes for one location in the NodePool. Must be >= 1 and - // <= max_node_count. - int32 min_node_count = 2; - - // Maximum number of nodes for one location in the NodePool. Must be >= - // min_node_count. There has to be enough quota to scale up the cluster. - int32 max_node_count = 3; - - // Can this node pool be deleted automatically. - bool autoprovisioned = 4; - - // Location policy used when scaling up a nodepool. - LocationPolicy location_policy = 5; - - // Minimum number of nodes in the node pool. Must be greater than 1 less than - // total_max_node_count. - // The total_*_node_count fields are mutually exclusive with the *_node_count - // fields. - int32 total_min_node_count = 6; - - // Maximum number of nodes in the node pool. Must be greater than - // total_min_node_count. There has to be enough quota to scale up the cluster. - // The total_*_node_count fields are mutually exclusive with the *_node_count - // fields. - int32 total_max_node_count = 7; -} - -// 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 -message SetLabelsRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. The labels to set for that cluster. - map resource_labels = 4 - [(google.api.field_behavior) = REQUIRED]; - - // 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. - string label_fingerprint = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster name) of the cluster to set labels. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 7; -} - -// SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for -// a cluster. -message SetLegacyAbacRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to update. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Whether ABAC authorization will be enabled in the cluster. - bool enabled = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster name) of the cluster to set legacy - // abac. Specified in the format `projects/*/locations/*/clusters/*`. - string name = 6; -} - -// StartIPRotationRequest creates a new IP for the cluster and then performs -// a node upgrade on each node pool to point to the new IP. -message StartIPRotationRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster name) of the cluster to start IP - // rotation. Specified in the format `projects/*/locations/*/clusters/*`. - string name = 6; - - // Whether to rotate credentials during IP rotation. - bool rotate_credentials = 7; -} - -// CompleteIPRotationRequest moves the cluster master back into single-IP mode. -message CompleteIPRotationRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster name) of the cluster to complete IP - // rotation. Specified in the format `projects/*/locations/*/clusters/*`. - string name = 7; -} - -// AcceleratorConfig represents a Hardware Accelerator request. -message AcceleratorConfig { - // The number of the accelerator cards exposed to an instance. - int64 accelerator_count = 1; - - // The accelerator type resource name. List of supported accelerators - // [here](https://cloud.google.com/compute/docs/gpus) - string accelerator_type = 2; - - // Size of partitions to create on the GPU. Valid values are described in the - // NVIDIA [mig user - // guide](https://docs.nvidia.com/datacenter/tesla/mig-user-guide/#partitioning). - string gpu_partition_size = 3; - - // The number of time-shared GPU resources to expose for each physical GPU. - int64 max_time_shared_clients_per_gpu = 4 [deprecated = true]; - - // The configuration for GPU sharing options. - optional GPUSharingConfig gpu_sharing_config = 5; - - // The configuration for auto installation of GPU driver. - optional GPUDriverInstallationConfig gpu_driver_installation_config = 6; -} - -// GPUSharingConfig represents the GPU sharing configuration for Hardware -// Accelerators. -message GPUSharingConfig { - // The type of GPU sharing strategy currently provided. - enum GPUSharingStrategy { - // Default value. - GPU_SHARING_STRATEGY_UNSPECIFIED = 0; - - // GPUs are time-shared between containers. - TIME_SHARING = 1; - } - - // The max number of containers that can share a physical GPU. - int64 max_shared_clients_per_gpu = 1; - - // The type of GPU sharing strategy to enable on the GPU node. - optional GPUSharingStrategy gpu_sharing_strategy = 2; -} - -// GPUDriverInstallationConfig specifies the version of GPU driver to be auto -// installed. -message GPUDriverInstallationConfig { - // The GPU driver version to install. - enum GPUDriverVersion { - // Default value is to not install any GPU driver. - GPU_DRIVER_VERSION_UNSPECIFIED = 0; - - // Disable GPU driver auto installation and needs manual installation - INSTALLATION_DISABLED = 1; - - // "Default" GPU driver in COS and Ubuntu. - DEFAULT = 2; - - // "Latest" GPU driver in COS. - LATEST = 3; - } - - // Mode for how the GPU driver is installed. - optional GPUDriverVersion gpu_driver_version = 1; -} - -// ManagedPrometheusConfig defines the configuration for -// Google Cloud Managed Service for Prometheus. -message ManagedPrometheusConfig { - // Enable Managed Collection. - bool enabled = 1; -} - -// WorkloadMetadataConfig defines the metadata configuration to expose to -// workloads on the node pool. -message WorkloadMetadataConfig { - // NodeMetadata is the configuration for if and how to expose the node - // metadata to the workload running on the node. - enum NodeMetadata { - // Not set. - UNSPECIFIED = 0; - - // Prevent workloads not in hostNetwork from accessing certain VM metadata, - // specifically kube-env, which contains Kubelet credentials, and the - // instance identity token. - // - // Metadata concealment is a temporary security solution available while the - // bootstrapping process for cluster nodes is being redesigned with - // significant security improvements. This feature is scheduled to be - // deprecated in the future and later removed. - SECURE = 1; - - // Expose all VM metadata to pods. - EXPOSE = 2; - - // Run the GKE Metadata Server on this node. The GKE Metadata Server exposes - // a metadata API to workloads that is compatible with the V1 Compute - // Metadata APIs exposed by the Compute Engine and App Engine Metadata - // Servers. This feature can only be enabled if Workload Identity is enabled - // at the cluster level. - GKE_METADATA_SERVER = 3; - } - - // Mode is the configuration for how to expose metadata to workloads running - // on the node. - enum Mode { - // Not set. - MODE_UNSPECIFIED = 0; - - // Expose all Compute Engine metadata to pods. - GCE_METADATA = 1; - - // Run the GKE Metadata Server on this node. The GKE Metadata Server exposes - // a metadata API to workloads that is compatible with the V1 Compute - // Metadata APIs exposed by the Compute Engine and App Engine Metadata - // Servers. This feature can only be enabled if Workload Identity is enabled - // at the cluster level. - GKE_METADATA = 2; - } - - // NodeMetadata is the configuration for how to expose metadata to the - // workloads running on the node. - NodeMetadata node_metadata = 1 [deprecated = true]; - - // Mode is the configuration for how to expose metadata to workloads running - // on the node pool. - Mode mode = 2; -} - -// SetNetworkPolicyRequest enables/disables network policy for a cluster. -message SetNetworkPolicyRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Configuration options for the NetworkPolicy feature. - NetworkPolicy network_policy = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster name) of the cluster to set networking - // policy. Specified in the format `projects/*/locations/*/clusters/*`. - string name = 6; -} - -// SetMaintenancePolicyRequest sets the maintenance policy for a cluster. -message SetMaintenancePolicyRequest { - // Required. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. - string zone = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the cluster to update. - string cluster_id = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. The maintenance policy to be set for the cluster. An empty field - // clears the existing maintenance policy. - MaintenancePolicy maintenance_policy = 4 - [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster name) of the cluster to set - // maintenance policy. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 5; -} - -// ListLocationsRequest is used to request the locations that offer GKE. -message ListLocationsRequest { - // Required. Contains the name of the resource requested. - // Specified in the format `projects/*`. - string parent = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// ListLocationsResponse returns the list of all GKE locations and their -// recommendation state. -message ListLocationsResponse { - // A full list of GKE locations. - repeated Location locations = 1; - - // Only return ListLocationsResponse that occur after the page_token. This - // value should be populated from the ListLocationsResponse.next_page_token if - // that response token was set (which happens when listing more Locations than - // fit in a single ListLocationsResponse). - string next_page_token = 2; -} - -// Location returns the location name, and if the location is recommended -// for GKE cluster scheduling. -message Location { - // LocationType is the type of GKE location, regional or zonal. - enum LocationType { - // LOCATION_TYPE_UNSPECIFIED means the location type was not determined. - LOCATION_TYPE_UNSPECIFIED = 0; - - // A GKE Location where Zonal clusters can be created. - ZONE = 1; - - // A GKE Location where Regional clusters can be created. - REGION = 2; - } - - // Contains the type of location this Location is for. - // Regional or Zonal. - LocationType type = 1; - - // Contains the name of the resource requested. - // Specified in the format `projects/*/locations/*`. - string name = 2; - - // Whether the location is recommended for GKE cluster scheduling. - bool recommended = 3; -} - -// StatusCondition describes why a cluster or a node pool has a certain status -// (e.g., ERROR or DEGRADED). -message StatusCondition { - // Code for each condition - enum Code { - option deprecated = true; - - // UNKNOWN indicates a generic condition. - UNKNOWN = 0; - - // GCE_STOCKOUT indicates that Google Compute Engine resources are - // temporarily unavailable. - GCE_STOCKOUT = 1; - - // GKE_SERVICE_ACCOUNT_DELETED indicates that the user deleted their robot - // service account. - GKE_SERVICE_ACCOUNT_DELETED = 2; - - // Google Compute Engine quota was exceeded. - GCE_QUOTA_EXCEEDED = 3; - - // Cluster state was manually changed by an SRE due to a system logic error. - SET_BY_OPERATOR = 4; - - // Unable to perform an encrypt operation against the CloudKMS key used for - // etcd level encryption. - CLOUD_KMS_KEY_ERROR = 7; - - // Cluster CA is expiring soon. - // More codes TBA - CA_EXPIRING = 9; - } - - // Machine-friendly representation of the condition - // Deprecated. Use canonical_code instead. - Code code = 1 [deprecated = true]; - - // Human-friendly representation of the condition - string message = 2; - - // Canonical code of the condition. - google.rpc.Code canonical_code = 3; -} - -// NetworkConfig reports the relative names of network & subnetwork. -message NetworkConfig { - // Configuration of all network bandwidth tiers - message ClusterNetworkPerformanceConfig { - // Node network tier - enum Tier { - // Default value - TIER_UNSPECIFIED = 0; - - // Higher bandwidth, actual values based on VM size. - TIER_1 = 1; - } - - // Specifies the total network bandwidth tier for the NodePool. - optional Tier total_egress_bandwidth_tier = 1; - } - - // Output only. The relative name of the Google Compute Engine - // [network][google.container.v1beta1.NetworkConfig.network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) - // to which the cluster is connected. Example: - // projects/my-project/global/networks/my-network - string network = 1; - - // Output only. The relative name of the Google Compute Engine - // [subnetwork](https://cloud.google.com/compute/docs/vpc) to which the - // cluster is connected. Example: - // projects/my-project/regions/us-central1/subnetworks/my-subnet - string subnetwork = 2; - - // Whether Intra-node visibility is enabled for this cluster. - // This makes same node pod to pod traffic visible for VPC network. - bool enable_intra_node_visibility = 5; - - // Whether the cluster disables default in-node sNAT rules. In-node sNAT rules - // will be disabled when default_snat_status is disabled. When disabled is set - // to false, default IP masquerade rules will be applied to the nodes to - // prevent sNAT on cluster internal traffic. - DefaultSnatStatus default_snat_status = 7; - - // Whether L4ILB Subsetting is enabled for this cluster. - bool enable_l4ilb_subsetting = 10; - - // The desired datapath provider for this cluster. By default, uses the - // IPTables-based kube-proxy implementation. - DatapathProvider datapath_provider = 11; - - // The desired state of IPv6 connectivity to Google Services. - // By default, no private IPv6 access to or from Google Services (all access - // will be via IPv4) - PrivateIPv6GoogleAccess private_ipv6_google_access = 12; - - // DNSConfig contains clusterDNS config for this cluster. - DNSConfig dns_config = 13; - - // ServiceExternalIPsConfig specifies if services with externalIPs field are - // blocked or not. - ServiceExternalIPsConfig service_external_ips_config = 15; - - // GatewayAPIConfig contains the desired config of Gateway API on this - // cluster. - GatewayAPIConfig gateway_api_config = 16; - - // Network bandwidth tier configuration. - ClusterNetworkPerformanceConfig network_performance_config = 18; - - // Whether FQDN Network Policy is enabled on this cluster. - optional bool enable_fqdn_network_policy = 19; -} - -// GatewayAPIConfig contains the desired config of Gateway API on this cluster. -message GatewayAPIConfig { - // Channel describes if/how Gateway API should be installed and implemented in - // a cluster. - enum Channel { - // Default value. - CHANNEL_UNSPECIFIED = 0; - - // Gateway API support is disabled - CHANNEL_DISABLED = 1; - - // Gateway API support is enabled, experimental CRDs are installed - CHANNEL_EXPERIMENTAL = 3; - - // Gateway API support is enabled, standard CRDs are installed - CHANNEL_STANDARD = 4; - } - - // The Gateway API release channel to use for Gateway API. - Channel channel = 1; -} - -// Config to block services with externalIPs field. -message ServiceExternalIPsConfig { - // Whether Services with ExternalIPs field are allowed or not. - bool enabled = 1; -} - -// ListUsableSubnetworksRequest requests the list of usable subnetworks. -// available to a user for creating clusters. -message ListUsableSubnetworksRequest { - // Required. The parent project where subnetworks are usable. - // Specified in the format `projects/*`. - string parent = 1 [(google.api.field_behavior) = REQUIRED]; - - // 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. - string filter = 2; - - // 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) - int32 page_size = 3; - - // Specifies a page token to use. Set this to the nextPageToken returned by - // previous list requests to get the next page of results. - string page_token = 4; -} - -// ListUsableSubnetworksResponse is the response of -// ListUsableSubnetworksRequest. -message ListUsableSubnetworksResponse { - // A list of usable subnetworks in the specified network project. - repeated UsableSubnetwork subnetworks = 1; - - // 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. - string next_page_token = 2; -} - -// Secondary IP range of a usable subnetwork. -message UsableSubnetworkSecondaryRange { - // Status shows the current usage of a secondary IP range. - enum Status { - // UNKNOWN is the zero value of the Status enum. It's not a valid status. - UNKNOWN = 0; - - // UNUSED denotes that this range is unclaimed by any cluster. - UNUSED = 1; - - // IN_USE_SERVICE denotes that this range is claimed by a cluster for - // services. It cannot be used for other clusters. - IN_USE_SERVICE = 2; - - // 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_SHAREABLE_POD = 3; - - // IN_USE_MANAGED_POD denotes this range was created by GKE and is claimed - // for pods. It cannot be used for other clusters. - IN_USE_MANAGED_POD = 4; - } - - // The name associated with this subnetwork secondary range, used when adding - // an alias IP range to a VM instance. - string range_name = 1; - - // The range of IP addresses belonging to this subnetwork secondary range. - string ip_cidr_range = 2; - - // This field is to determine the status of the secondary range programmably. - Status status = 3; -} - -// UsableSubnetwork resource returns the subnetwork name, its associated network -// and the primary CIDR range. -message UsableSubnetwork { - // Subnetwork Name. - // Example: projects/my-project/regions/us-central1/subnetworks/my-subnet - string subnetwork = 1; - - // Network Name. - // Example: projects/my-project/global/networks/my-network - string network = 2; - - // The range of internal addresses that are owned by this subnetwork. - string ip_cidr_range = 3; - - // Secondary IP ranges. - repeated UsableSubnetworkSecondaryRange secondary_ip_ranges = 4; - - // 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. - string status_message = 5; -} - -// VerticalPodAutoscaling contains global, per-cluster information -// required by Vertical Pod Autoscaler to automatically adjust -// the resources of pods controlled by it. -message VerticalPodAutoscaling { - // Enables vertical pod autoscaling. - bool enabled = 1; -} - -// DefaultSnatStatus contains the desired state of whether default sNAT should -// be disabled on the cluster. -message DefaultSnatStatus { - // Disables cluster default sNAT rules. - bool disabled = 1; -} - -// IntraNodeVisibilityConfig contains the desired config of the intra-node -// visibility on this cluster. -message IntraNodeVisibilityConfig { - // Enables intra node visibility for this cluster. - bool enabled = 1; -} - -// ILBSubsettingConfig contains the desired config of L4 Internal LoadBalancer -// subsetting on this cluster. -message ILBSubsettingConfig { - // Enables l4 ILB subsetting for this cluster - bool enabled = 1; -} - -// DNSConfig contains the desired set of options for configuring clusterDNS. -message DNSConfig { - // Provider lists the various in-cluster DNS providers. - enum Provider { - // Default value - PROVIDER_UNSPECIFIED = 0; - - // Use GKE default DNS provider(kube-dns) for DNS resolution. - PLATFORM_DEFAULT = 1; - - // Use CloudDNS for DNS resolution. - CLOUD_DNS = 2; - - // Use KubeDNS for DNS resolution. - KUBE_DNS = 3; - } - - // DNSScope lists the various scopes of access to cluster DNS records. - enum DNSScope { - // Default value, will be inferred as cluster scope. - DNS_SCOPE_UNSPECIFIED = 0; - - // DNS records are accessible from within the cluster. - CLUSTER_SCOPE = 1; - - // DNS records are accessible from within the VPC. - VPC_SCOPE = 2; - } - - // cluster_dns indicates which in-cluster DNS provider should be used. - Provider cluster_dns = 1; - - // cluster_dns_scope indicates the scope of access to cluster DNS records. - DNSScope cluster_dns_scope = 2; - - // cluster_dns_domain is the suffix used for all cluster service records. - string cluster_dns_domain = 3; -} - -// Constraints applied to pods. -message MaxPodsConstraint { - // Constraint enforced on the max num of pods per node. - int64 max_pods_per_node = 1; -} - -// Configuration for the use of Kubernetes Service Accounts in GCP IAM -// policies. -message WorkloadIdentityConfig { - // IAM Identity Namespace to attach all Kubernetes Service Accounts to. - string identity_namespace = 1 [deprecated = true]; - - // The workload pool to attach all Kubernetes service accounts to. - string workload_pool = 2; - - // identity provider is the third party identity provider. - string identity_provider = 3; -} - -// Configuration for direct-path (via ALTS) with workload identity. -message WorkloadALTSConfig { - // enable_alts controls whether the alts handshaker should be enabled or not - // for direct-path. - // - // Requires Workload Identity - // ([workload_pool][google.container.v1beta1.WorkloadIdentityConfig.workload_pool] - // must be non-empty). - google.protobuf.BoolValue enable_alts = 1; -} - -// Configuration for issuance of mTLS keys and certificates to Kubernetes pods. -message WorkloadCertificates { - // enable_certificates controls issuance of workload mTLS certificates. - // - // If set, the GKE Workload Identity Certificates controller and node agent - // will be deployed in the cluster, which can then be configured by creating a - // WorkloadCertificateConfig Custom Resource. - // - // Requires Workload Identity - // ([workload_pool][google.container.v1beta1.WorkloadIdentityConfig.workload_pool] - // must be non-empty). - google.protobuf.BoolValue enable_certificates = 1; -} - -// Configuration for issuance of mTLS keys and certificates to Kubernetes pods. -message MeshCertificates { - // enable_certificates controls issuance of workload mTLS certificates. - // - // If set, the GKE Workload Identity Certificates controller and node agent - // will be deployed in the cluster, which can then be configured by creating a - // WorkloadCertificateConfig Custom Resource. - // - // Requires Workload Identity - // ([workload_pool][google.container.v1alpha1.WorkloadIdentityConfig.workload_pool] - // must be non-empty). - google.protobuf.BoolValue enable_certificates = 1; -} - -// Configuration of etcd encryption. -message DatabaseEncryption { - // State of etcd encryption. - enum State { - // Should never be set - UNKNOWN = 0; - - // Secrets in etcd are encrypted. - ENCRYPTED = 1; - - // Secrets in etcd are stored in plain text (at etcd level) - this is - // unrelated to Compute Engine level full disk encryption. - DECRYPTED = 2; - } - - // 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 - string key_name = 1; - - // The desired state of etcd encryption. - State state = 2; -} - -// Configuration for exporting cluster resource usages. -message ResourceUsageExportConfig { - // Parameters for using BigQuery as the destination of resource usage export. - message BigQueryDestination { - // The ID of a BigQuery Dataset. - string dataset_id = 1; - } - - // Parameters for controlling consumption metering. - message ConsumptionMeteringConfig { - // Whether to enable consumption metering for this cluster. If enabled, a - // second BigQuery table will be created to hold resource consumption - // records. - bool enabled = 1; - } - - // Configuration to use BigQuery as usage export destination. - BigQueryDestination bigquery_destination = 1; - - // Whether to enable network egress metering for this cluster. If enabled, a - // daemonset will be created in the cluster to meter network egress traffic. - bool enable_network_egress_metering = 2; - - // Configuration to enable resource consumption metering. - ConsumptionMeteringConfig consumption_metering_config = 3; -} - -// Configuration of Shielded Nodes feature. -message ShieldedNodes { - // Whether Shielded Nodes features are enabled on all nodes in this cluster. - bool enabled = 1; -} - -// Configuration of gVNIC feature. -message VirtualNIC { - // Whether gVNIC features are enabled in the node pool. - bool enabled = 1; -} - -// Configuration of Fast Socket feature. -message FastSocket { - // Whether Fast Socket features are enabled in the node pool. - bool enabled = 1; -} - -// GetOpenIDConfigRequest gets the OIDC discovery document for the -// cluster. See the OpenID Connect Discovery 1.0 specification for details. -message GetOpenIDConfigRequest { - // The cluster (project, location, cluster name) to get the discovery document - // for. Specified in the format `projects/*/locations/*/clusters/*`. - string parent = 1; -} - -// GetOpenIDConfigResponse is an OIDC discovery document for the cluster. -// See the OpenID Connect Discovery 1.0 specification for details. -message GetOpenIDConfigResponse { - // OIDC Issuer. - string issuer = 1; - - // JSON Web Key uri. - string jwks_uri = 2; - - // Supported response types. - repeated string response_types_supported = 3; - - // Supported subject types. - repeated string subject_types_supported = 4; - - // supported ID Token signing Algorithms. - repeated string id_token_signing_alg_values_supported = 5; - - // Supported claims. - repeated string claims_supported = 6; - - // Supported grant types. - repeated string grant_types = 7; -} - -// GetJSONWebKeysRequest gets the public component of the keys used by the -// cluster to sign token requests. This will be the jwks_uri for the discover -// document returned by getOpenIDConfig. See the OpenID Connect -// Discovery 1.0 specification for details. -message GetJSONWebKeysRequest { - // The cluster (project, location, cluster name) to get keys for. Specified in - // the format `projects/*/locations/*/clusters/*`. - string parent = 1; -} - -// Jwk is a JSON Web Key as specified in RFC 7517 -message Jwk { - // Key Type. - string kty = 1; - - // Algorithm. - string alg = 2; - - // Permitted uses for the public keys. - string use = 3; - - // Key ID. - string kid = 4; - - // Used for RSA keys. - string n = 5; - - // Used for RSA keys. - string e = 6; - - // Used for ECDSA keys. - string x = 7; - - // Used for ECDSA keys. - string y = 8; - - // Used for ECDSA keys. - string crv = 9; -} - -// GetJSONWebKeysResponse is a valid JSON Web Key Set as specififed in rfc 7517 -message GetJSONWebKeysResponse { - // The public component of the keys used by the cluster to sign token - // requests. - repeated Jwk keys = 1; -} - -// CheckAutopilotCompatibilityRequest requests getting the blockers for the -// given operation in the cluster. -message CheckAutopilotCompatibilityRequest { - // The name (project, location, cluster) of the cluster to retrieve. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 1; -} - -// AutopilotCompatibilityIssue contains information about a specific -// compatibility issue with Autopilot mode. -message AutopilotCompatibilityIssue { - // The type of the reported issue. - enum IssueType { - // Default value, should not be used. - UNSPECIFIED = 0; - - // Indicates that the issue is a known incompatibility between the - // cluster and Autopilot mode. - INCOMPATIBILITY = 1; - - // Indicates the issue is an incompatibility if customers take no further - // action to resolve. - ADDITIONAL_CONFIG_REQUIRED = 2; - - // Indicates the issue is not an incompatibility, but depending on the - // workloads business logic, there is a potential that they won't work on - // Autopilot. - PASSED_WITH_OPTIONAL_CONFIG = 3; - } - - // The last time when this issue was observed. - google.protobuf.Timestamp last_observation = 1; - - // The constraint type of the issue. - string constraint_type = 2; - - // The incompatibility type of this issue. - IssueType incompatibility_type = 3; - - // The name of the resources which are subject to this issue. - repeated string subjects = 4; - - // A URL to a public documnetation, which addresses resolving this issue. - string documentation_url = 5; - - // The description of the issue. - string description = 6; -} - -// CheckAutopilotCompatibilityResponse has a list of compatibility issues. -message CheckAutopilotCompatibilityResponse { - // The list of issues for the given operation. - repeated AutopilotCompatibilityIssue issues = 1; - - // The summary of the autopilot compatibility response. - string summary = 2; -} - -// ReleaseChannel indicates which release channel a cluster is -// subscribed to. Release channels are arranged in order of risk. -// -// When a cluster is subscribed to a release channel, Google maintains -// both the master version and the node version. Node auto-upgrade -// defaults to true and cannot be disabled. -message ReleaseChannel { - // Possible values for 'channel'. - enum Channel { - // No channel specified. - UNSPECIFIED = 0; - - // RAPID channel is offered on an early access basis for customers who want - // to test new releases. - // - // WARNING: Versions available in the RAPID Channel may be subject to - // unresolved issues with no known workaround and are not subject to any - // SLAs. - RAPID = 1; - - // Clusters subscribed to REGULAR receive versions that are considered GA - // quality. REGULAR is intended for production users who want to take - // advantage of new features. - REGULAR = 2; - - // Clusters subscribed to STABLE receive versions that are known to be - // stable and reliable in production. - STABLE = 3; - } - - // channel specifies which release channel the cluster is subscribed to. - Channel channel = 1; -} - -// Configuration for fine-grained cost management feature. -message CostManagementConfig { - // Whether the feature is enabled or not. - bool enabled = 1; -} - -// Configuration for Cloud TPU. -message TpuConfig { - // Whether Cloud TPU integration is enabled or not. - bool enabled = 1; - - // Whether to use service networking for Cloud TPU or not. - bool use_service_networking = 2; - - // IPv4 CIDR block reserved for Cloud TPU in the VPC. - string ipv4_cidr_block = 3; -} - -// PrivateIPv6GoogleAccess controls whether and how the pods can communicate -// with Google Services through gRPC over IPv6. -enum PrivateIPv6GoogleAccess { - // Default value. Same as DISABLED - PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0; - - // No private access to or from Google Services - PRIVATE_IPV6_GOOGLE_ACCESS_DISABLED = 1; - - // Enables private IPv6 access to Google Services from GKE - PRIVATE_IPV6_GOOGLE_ACCESS_TO_GOOGLE = 2; - - // Enables private IPv6 access to and from Google Services - PRIVATE_IPV6_GOOGLE_ACCESS_BIDIRECTIONAL = 3; -} - -// Master is the configuration for components on master. -message Master {} - -// Autopilot is the configuration for Autopilot settings on the cluster. -message Autopilot { - // Enable Autopilot - bool enabled = 1; - - // Workload policy configuration for Autopilot. - WorkloadPolicyConfig workload_policy_config = 2; -} - -// WorkloadPolicyConfig is the configuration of workload policy for autopilot -// clusters. -message WorkloadPolicyConfig { - // If true, workloads can use NET_ADMIN capability. - optional bool allow_net_admin = 1; -} - -// NotificationConfig is the configuration of notifications. -message NotificationConfig { - // Types of notifications currently supported. Can be used to filter what - // notifications are sent. - enum EventType { - // Not set, will be ignored. - EVENT_TYPE_UNSPECIFIED = 0; - - // Corresponds with UpgradeAvailableEvent. - UPGRADE_AVAILABLE_EVENT = 1; - - // Corresponds with UpgradeEvent. - UPGRADE_EVENT = 2; - - // Corresponds with SecurityBulletinEvent. - SECURITY_BULLETIN_EVENT = 3; - } - - // Pub/Sub specific notification config. - message PubSub { - // Enable notifications for Pub/Sub. - bool enabled = 1; - - // The desired Pub/Sub topic to which notifications will be - // sent by GKE. Format is `projects/{project}/topics/{topic}`. - string topic = 2 [ - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } - ]; - - // Allows filtering to one or more specific event types. If no filter is - // specified, or if a filter is specified with no event types, all event - // types will be sent - Filter filter = 3; - } - - // Allows filtering to one or more specific event types. If event types are - // present, those and only those event types will be transmitted to the - // cluster. Other types will be skipped. If no filter is specified, or no - // event types are present, all event types will be sent - message Filter { - // Event types to allowlist. - repeated EventType event_type = 1; - } - - // Notification config for Pub/Sub. - PubSub pubsub = 1; -} - -// ConfidentialNodes is configuration for the confidential nodes feature, which -// makes nodes run on confidential VMs. -message ConfidentialNodes { - // Whether Confidential Nodes feature is enabled. - bool enabled = 1; -} - -// UpgradeResourceType is the resource type that is upgrading. It is used -// in upgrade notifications. -enum UpgradeResourceType { - // Default value. This shouldn't be used. - UPGRADE_RESOURCE_TYPE_UNSPECIFIED = 0; - - // Master / control plane - MASTER = 1; - - // Node pool - NODE_POOL = 2; -} - -// UpgradeEvent is a notification sent to customers by the cluster server when -// a resource is upgrading. -message UpgradeEvent { - // The resource type that is upgrading. - UpgradeResourceType resource_type = 1; - - // The operation associated with this upgrade. - string operation = 2; - - // The time when the operation was started. - google.protobuf.Timestamp operation_start_time = 3; - - // The current version before the upgrade. - string current_version = 4; - - // The target version for the upgrade. - string target_version = 5; - - // Optional relative path to the resource. For example in node pool upgrades, - // the relative path of the node pool. - string resource = 6; -} - -// UpgradeAvailableEvent is a notification sent to customers when a new -// available version is released. -message UpgradeAvailableEvent { - // The release version available for upgrade. - string version = 1; - - // The resource type of the release version. - UpgradeResourceType resource_type = 2; - - // The release channel of the version. If empty, it means a non-channel - // release. - ReleaseChannel release_channel = 3; - - // Optional relative path to the resource. For example, the relative path of - // the node pool. - string resource = 4; - - // Windows node versions info. - WindowsVersions windows_versions = 5; -} - -// SecurityBulletinEvent is a notification sent to customers when a security -// bulletin has been posted that they are vulnerable to. -message SecurityBulletinEvent { - // The resource type (node/control plane) that has the vulnerability. Multiple - // notifications (1 notification per resource type) will be sent for a - // vulnerability that affects > 1 resource type. - string resource_type_affected = 1; - - // The ID of the bulletin corresponding to the vulnerability. - string bulletin_id = 2; - - // The CVEs associated with this bulletin. - repeated string cve_ids = 3; - - // The severity of this bulletin as it relates to GKE. - string severity = 4; - - // The URI link to the bulletin on the website for more information. - string bulletin_uri = 5; - - // A brief description of the bulletin. See the bulletin pointed to by the - // bulletin_uri field for an expanded description. - string brief_description = 6; - - // The GKE minor versions affected by this vulnerability. - repeated string affected_supported_minors = 7; - - // The GKE versions where this vulnerability is patched. - repeated string patched_versions = 8; - - // This represents a version selected from the patched_versions field that - // the cluster receiving this notification should most likely want to upgrade - // to based on its current version. Note that if this notification is being - // received by a given cluster, it means that this version is currently - // available as an upgrade target in that cluster's location. - string suggested_upgrade_target = 9; - - // If this field is specified, it means there are manual steps that the user - // must take to make their clusters safe. - bool manual_steps_required = 10; -} - -// IdentityServiceConfig is configuration for Identity Service which allows -// customers to use external identity providers with the K8S API -message IdentityServiceConfig { - // Whether to enable the Identity Service component - bool enabled = 1; -} - -// Strategy used for node pool update. -enum NodePoolUpdateStrategy { - // Default value if unset. GKE internally defaults the update strategy to - // SURGE for unspecified strategies. - NODE_POOL_UPDATE_STRATEGY_UNSPECIFIED = 0; - - // blue-green upgrade. - BLUE_GREEN = 2; - - // SURGE is the traditional way of upgrading a node pool. - // max_surge and max_unavailable determines the level of upgrade parallelism. - SURGE = 3; -} - -// LoggingConfig is cluster logging configuration. -message LoggingConfig { - // Logging components configuration - LoggingComponentConfig component_config = 1; -} - -// LoggingComponentConfig is cluster logging component configuration. -message LoggingComponentConfig { - // GKE components exposing logs - enum Component { - // Default value. This shouldn't be used. - COMPONENT_UNSPECIFIED = 0; - - // system components - SYSTEM_COMPONENTS = 1; - - // workloads - WORKLOADS = 2; - - // kube-apiserver - APISERVER = 3; - - // kube-scheduler - SCHEDULER = 4; - - // kube-controller-manager - CONTROLLER_MANAGER = 5; - } - - // Select components to collect logs. An empty set would disable all logging. - repeated Component enable_components = 1; -} - -// MonitoringConfig is cluster monitoring configuration. -message MonitoringConfig { - // Monitoring components configuration - MonitoringComponentConfig component_config = 1; - - // Enable Google Cloud Managed Service for Prometheus - // in the cluster. - ManagedPrometheusConfig managed_prometheus_config = 2; - - // Configuration of Advanced Datapath Observability features. - AdvancedDatapathObservabilityConfig advanced_datapath_observability_config = - 3; -} - -// AdvancedDatapathObservabilityConfig specifies configuration of observability -// features of advanced datapath. -message AdvancedDatapathObservabilityConfig { - // Supported Relay modes - enum RelayMode { - // Default value. This shouldn't be used. - RELAY_MODE_UNSPECIFIED = 0; - - // disabled - DISABLED = 1; - - // exposed via internal load balancer - INTERNAL_VPC_LB = 3; - - // exposed via external load balancer - EXTERNAL_LB = 4; - } - - // Expose flow metrics on nodes - bool enable_metrics = 1; - - // Method used to make Relay available - RelayMode relay_mode = 2; -} - -// NodePoolLoggingConfig specifies logging configuration for nodepools. -message NodePoolLoggingConfig { - // Logging variant configuration. - LoggingVariantConfig variant_config = 1; -} - -// LoggingVariantConfig specifies the behaviour of the logging component. -message LoggingVariantConfig { - // Logging component variants. - enum Variant { - // Default value. This shouldn't be used. - VARIANT_UNSPECIFIED = 0; - - // default logging variant. - DEFAULT = 1; - - // maximum logging throughput variant. - MAX_THROUGHPUT = 2; - } - - // Logging variant deployed on nodes. - Variant variant = 1; -} - -// MonitoringComponentConfig is cluster monitoring component configuration. -message MonitoringComponentConfig { - // GKE components exposing metrics - enum Component { - // Default value. This shouldn't be used. - COMPONENT_UNSPECIFIED = 0; - - // system components - SYSTEM_COMPONENTS = 1; - - // Deprecated: Use Google Cloud Managed Service for Prometheus. - WORKLOADS = 2 [deprecated = true]; - - // kube-apiserver - APISERVER = 3; - - // kube-scheduler - SCHEDULER = 4; - - // kube-controller-manager - CONTROLLER_MANAGER = 5; - } - - // Select components to collect metrics. An empty set would disable all - // monitoring. - repeated Component enable_components = 1; -} - -// The datapath provider selects the implementation of the Kubernetes networking -// model for service resolution and network policy enforcement. -enum DatapathProvider { - // Default value. - DATAPATH_PROVIDER_UNSPECIFIED = 0; - - // Use the IPTables implementation based on kube-proxy. - LEGACY_DATAPATH = 1; - - // Use the eBPF based GKE Dataplane V2 with additional features. See the [GKE - // Dataplane V2 - // documentation](https://cloud.google.com/kubernetes-engine/docs/how-to/dataplane-v2) - // for more. - ADVANCED_DATAPATH = 2; -} - -// Fleet is the fleet configuration for the cluster. -message Fleet { - // The Fleet host project(project ID or project number) where this cluster - // will be registered to. This field cannot be changed after the cluster has - // been registered. - string project = 1; - - // [Output only] The full resource name of the registered fleet membership of - // the cluster, in the format - // `//gkehub.googleapis.com/projects/*/locations/*/memberships/*`. - string membership = 2; - - // [Output only] Whether the cluster has been registered through the fleet - // API. - bool pre_registered = 3; -} - -// Possible values for IP stack type -enum StackType { - // By default, the clusters will be IPV4 only - STACK_TYPE_UNSPECIFIED = 0; - - // The value used if the cluster is a IPV4 only - IPV4 = 1; - - // The value used if the cluster is a dual stack cluster - IPV4_IPV6 = 2; -} diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.cancel_operation.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.cancel_operation.js deleted file mode 100644 index 939c8c4aaca..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.cancel_operation.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, operationId) { - // [START container_v1beta1_generated_ClusterManager_CancelOperation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, operation id) of the operation to cancel. - * Specified in the format `projects/* /locations/* /operations/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callCancelOperation() { - // Construct request - const request = { - projectId, - zone, - operationId, - }; - - // Run request - const response = await containerClient.cancelOperation(request); - console.log(response); - } - - callCancelOperation(); - // [END container_v1beta1_generated_ClusterManager_CancelOperation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js deleted file mode 100644 index 4511c66ce17..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1beta1_generated_ClusterManager_CheckAutopilotCompatibility_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster) of the cluster to retrieve. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callCheckAutopilotCompatibility() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.checkAutopilotCompatibility(request); - console.log(response); - } - - callCheckAutopilotCompatibility(); - // [END container_v1beta1_generated_ClusterManager_CheckAutopilotCompatibility_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_i_p_rotation.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_i_p_rotation.js deleted file mode 100644 index 57cb300a08f..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_i_p_rotation.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId) { - // [START container_v1beta1_generated_ClusterManager_CompleteIPRotation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster name) of the cluster to complete IP - * rotation. Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callCompleteIPRotation() { - // Construct request - const request = { - projectId, - zone, - clusterId, - }; - - // Run request - const response = await containerClient.completeIPRotation(request); - console.log(response); - } - - callCompleteIPRotation(); - // [END container_v1beta1_generated_ClusterManager_CompleteIPRotation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_node_pool_upgrade.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_node_pool_upgrade.js deleted file mode 100644 index 152c6971b1b..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_node_pool_upgrade.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1beta1_generated_ClusterManager_CompleteNodePoolUpgrade_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster, node pool id) of the node pool to - * complete upgrade. - * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callCompleteNodePoolUpgrade() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.completeNodePoolUpgrade(request); - console.log(response); - } - - callCompleteNodePoolUpgrade(); - // [END container_v1beta1_generated_ClusterManager_CompleteNodePoolUpgrade_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_cluster.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_cluster.js deleted file mode 100644 index 4414e1ca9d3..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_cluster.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, cluster) { - // [START container_v1beta1_generated_ClusterManager_CreateCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. A cluster - * resource (https://cloud.google.com/container-engine/reference/rest/v1beta1/projects.locations.clusters) - */ - // const cluster = {} - /** - * The parent (project and location) where the cluster will be created. - * Specified in the format `projects/* /locations/*`. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callCreateCluster() { - // Construct request - const request = { - projectId, - zone, - cluster, - }; - - // Run request - const response = await containerClient.createCluster(request); - console.log(response); - } - - callCreateCluster(); - // [END container_v1beta1_generated_ClusterManager_CreateCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_node_pool.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_node_pool.js deleted file mode 100644 index 9d53c6be79e..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_node_pool.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, nodePool) { - // [START container_v1beta1_generated_ClusterManager_CreateNodePool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The node pool to create. - */ - // const nodePool = {} - /** - * The parent (project, location, cluster name) where the node pool will be - * created. Specified in the format - * `projects/* /locations/* /clusters/*`. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callCreateNodePool() { - // Construct request - const request = { - projectId, - zone, - clusterId, - nodePool, - }; - - // Run request - const response = await containerClient.createNodePool(request); - console.log(response); - } - - callCreateNodePool(); - // [END container_v1beta1_generated_ClusterManager_CreateNodePool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_cluster.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_cluster.js deleted file mode 100644 index d387c456166..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_cluster.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId) { - // [START container_v1beta1_generated_ClusterManager_DeleteCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster) of the cluster to delete. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callDeleteCluster() { - // Construct request - const request = { - projectId, - zone, - clusterId, - }; - - // Run request - const response = await containerClient.deleteCluster(request); - console.log(response); - } - - callDeleteCluster(); - // [END container_v1beta1_generated_ClusterManager_DeleteCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_node_pool.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_node_pool.js deleted file mode 100644 index d406bb8686c..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_node_pool.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, nodePoolId) { - // [START container_v1beta1_generated_ClusterManager_DeleteNodePool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster, node pool id) of the node pool to - * delete. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callDeleteNodePool() { - // Construct request - const request = { - projectId, - zone, - clusterId, - nodePoolId, - }; - - // Run request - const response = await containerClient.deleteNodePool(request); - console.log(response); - } - - callDeleteNodePool(); - // [END container_v1beta1_generated_ClusterManager_DeleteNodePool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_cluster.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_cluster.js deleted file mode 100644 index 0e388e69226..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_cluster.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId) { - // [START container_v1beta1_generated_ClusterManager_GetCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster) of the cluster to retrieve. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callGetCluster() { - // Construct request - const request = { - projectId, - zone, - clusterId, - }; - - // Run request - const response = await containerClient.getCluster(request); - console.log(response); - } - - callGetCluster(); - // [END container_v1beta1_generated_ClusterManager_GetCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_j_s_o_n_web_keys.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_j_s_o_n_web_keys.js deleted file mode 100644 index f48cfa5316d..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_j_s_o_n_web_keys.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1beta1_generated_ClusterManager_GetJSONWebKeys_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The cluster (project, location, cluster name) to get keys for. Specified in - * the format `projects/* /locations/* /clusters/*`. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callGetJSONWebKeys() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.getJSONWebKeys(request); - console.log(response); - } - - callGetJSONWebKeys(); - // [END container_v1beta1_generated_ClusterManager_GetJSONWebKeys_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_node_pool.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_node_pool.js deleted file mode 100644 index 21f384189f6..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_node_pool.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, nodePoolId) { - // [START container_v1beta1_generated_ClusterManager_GetNodePool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster, node pool id) of the node pool to - * get. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callGetNodePool() { - // Construct request - const request = { - projectId, - zone, - clusterId, - nodePoolId, - }; - - // Run request - const response = await containerClient.getNodePool(request); - console.log(response); - } - - callGetNodePool(); - // [END container_v1beta1_generated_ClusterManager_GetNodePool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_operation.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_operation.js deleted file mode 100644 index f693d6982e6..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_operation.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, operationId) { - // [START container_v1beta1_generated_ClusterManager_GetOperation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, operation id) of the operation to get. - * Specified in the format `projects/* /locations/* /operations/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callGetOperation() { - // Construct request - const request = { - projectId, - zone, - operationId, - }; - - // Run request - const response = await containerClient.getOperation(request); - console.log(response); - } - - callGetOperation(); - // [END container_v1beta1_generated_ClusterManager_GetOperation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_server_config.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_server_config.js deleted file mode 100644 index 147c03feb39..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_server_config.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone) { - // [START container_v1beta1_generated_ClusterManager_GetServerConfig_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project and location) of the server config to get, - * specified in the format `projects/* /locations/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callGetServerConfig() { - // Construct request - const request = { - projectId, - zone, - }; - - // Run request - const response = await containerClient.getServerConfig(request); - console.log(response); - } - - callGetServerConfig(); - // [END container_v1beta1_generated_ClusterManager_GetServerConfig_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_clusters.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_clusters.js deleted file mode 100644 index 3a468a6e586..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_clusters.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone) { - // [START container_v1beta1_generated_ClusterManager_ListClusters_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The parent (project and location) where the clusters will be listed. - * Specified in the format `projects/* /locations/*`. - * Location "-" matches all zones and all regions. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callListClusters() { - // Construct request - const request = { - projectId, - zone, - }; - - // Run request - const response = await containerClient.listClusters(request); - console.log(response); - } - - callListClusters(); - // [END container_v1beta1_generated_ClusterManager_ListClusters_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_locations.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_locations.js deleted file mode 100644 index 62e86afb204..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_locations.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START container_v1beta1_generated_ClusterManager_ListLocations_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Contains the name of the resource requested. - * Specified in the format `projects/*`. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callListLocations() { - // Construct request - const request = { - parent, - }; - - // Run request - const response = await containerClient.listLocations(request); - console.log(response); - } - - callListLocations(); - // [END container_v1beta1_generated_ClusterManager_ListLocations_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_node_pools.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_node_pools.js deleted file mode 100644 index 6c5aaa855e4..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_node_pools.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId) { - // [START container_v1beta1_generated_ClusterManager_ListNodePools_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The parent (project, location, cluster name) where the node pools will be - * listed. Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callListNodePools() { - // Construct request - const request = { - projectId, - zone, - clusterId, - }; - - // Run request - const response = await containerClient.listNodePools(request); - console.log(response); - } - - callListNodePools(); - // [END container_v1beta1_generated_ClusterManager_ListNodePools_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_operations.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_operations.js deleted file mode 100644 index adaf08f3129..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_operations.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone) { - // [START container_v1beta1_generated_ClusterManager_ListOperations_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The parent (project and location) where the operations will be listed. - * Specified in the format `projects/* /locations/*`. - * Location "-" matches all zones and all regions. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callListOperations() { - // Construct request - const request = { - projectId, - zone, - }; - - // Run request - const response = await containerClient.listOperations(request); - console.log(response); - } - - callListOperations(); - // [END container_v1beta1_generated_ClusterManager_ListOperations_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_usable_subnetworks.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_usable_subnetworks.js deleted file mode 100644 index 400d21f447c..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_usable_subnetworks.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START container_v1beta1_generated_ClusterManager_ListUsableSubnetworks_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent project where subnetworks are usable. - * Specified in the format `projects/*`. - */ - // const parent = 'abc123' - /** - * 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. - */ - // const filter = 'abc123' - /** - * 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) - */ - // const pageSize = 1234 - /** - * Specifies a page token to use. Set this to the nextPageToken returned by - * previous list requests to get the next page of results. - */ - // const pageToken = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callListUsableSubnetworks() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await containerClient.listUsableSubnetworksAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListUsableSubnetworks(); - // [END container_v1beta1_generated_ClusterManager_ListUsableSubnetworks_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.rollback_node_pool_upgrade.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.rollback_node_pool_upgrade.js deleted file mode 100644 index fd127925ad0..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.rollback_node_pool_upgrade.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, nodePoolId) { - // [START container_v1beta1_generated_ClusterManager_RollbackNodePoolUpgrade_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster, node pool id) of the node poll to - * rollback upgrade. - * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - /** - * Option for rollback to ignore the PodDisruptionBudget. - * Default value is false. - */ - // const respectPdb = true - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callRollbackNodePoolUpgrade() { - // Construct request - const request = { - projectId, - zone, - clusterId, - nodePoolId, - }; - - // Run request - const response = await containerClient.rollbackNodePoolUpgrade(request); - console.log(response); - } - - callRollbackNodePoolUpgrade(); - // [END container_v1beta1_generated_ClusterManager_RollbackNodePoolUpgrade_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_addons_config.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_addons_config.js deleted file mode 100644 index 575a4bf0e5f..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_addons_config.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, addonsConfig) { - // [START container_v1beta1_generated_ClusterManager_SetAddonsConfig_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The desired configurations for the various addons available to - * run in the cluster. - */ - // const addonsConfig = {} - /** - * The name (project, location, cluster) of the cluster to set addons. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetAddonsConfig() { - // Construct request - const request = { - projectId, - zone, - clusterId, - addonsConfig, - }; - - // Run request - const response = await containerClient.setAddonsConfig(request); - console.log(response); - } - - callSetAddonsConfig(); - // [END container_v1beta1_generated_ClusterManager_SetAddonsConfig_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_labels.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_labels.js deleted file mode 100644 index 9690ae6d011..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_labels.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, resourceLabels, labelFingerprint) { - // [START container_v1beta1_generated_ClusterManager_SetLabels_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The labels to set for that cluster. - */ - // const resourceLabels = 1234 - /** - * 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. - */ - // const labelFingerprint = 'abc123' - /** - * The name (project, location, cluster name) of the cluster to set labels. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetLabels() { - // Construct request - const request = { - projectId, - zone, - clusterId, - resourceLabels, - labelFingerprint, - }; - - // Run request - const response = await containerClient.setLabels(request); - console.log(response); - } - - callSetLabels(); - // [END container_v1beta1_generated_ClusterManager_SetLabels_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_legacy_abac.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_legacy_abac.js deleted file mode 100644 index c59d4c74879..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_legacy_abac.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, enabled) { - // [START container_v1beta1_generated_ClusterManager_SetLegacyAbac_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Whether ABAC authorization will be enabled in the cluster. - */ - // const enabled = true - /** - * The name (project, location, cluster name) of the cluster to set legacy - * abac. Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetLegacyAbac() { - // Construct request - const request = { - projectId, - zone, - clusterId, - enabled, - }; - - // Run request - const response = await containerClient.setLegacyAbac(request); - console.log(response); - } - - callSetLegacyAbac(); - // [END container_v1beta1_generated_ClusterManager_SetLegacyAbac_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_locations.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_locations.js deleted file mode 100644 index 7a830f08e75..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_locations.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, locations) { - // [START container_v1beta1_generated_ClusterManager_SetLocations_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The desired list of Google Compute Engine - * zones (https://cloud.google.com/compute/docs/zones#available) 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. - */ - // const locations = 'abc123' - /** - * The name (project, location, cluster) of the cluster to set locations. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetLocations() { - // Construct request - const request = { - projectId, - zone, - clusterId, - locations, - }; - - // Run request - const response = await containerClient.setLocations(request); - console.log(response); - } - - callSetLocations(); - // [END container_v1beta1_generated_ClusterManager_SetLocations_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_logging_service.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_logging_service.js deleted file mode 100644 index e6cd4a0d7f1..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_logging_service.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, loggingService) { - // [START container_v1beta1_generated_ClusterManager_SetLoggingService_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The logging service the cluster should use to write logs. - * Currently available options: - * * `logging.googleapis.com/kubernetes` - The Cloud Logging - * service with a Kubernetes-native resource model - * * `logging.googleapis.com` - The legacy Cloud Logging service (no longer - * available as of GKE 1.15). - * * `none` - no logs will be exported from the cluster. - * If left as an empty string,`logging.googleapis.com/kubernetes` will be - * used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. - */ - // const loggingService = 'abc123' - /** - * The name (project, location, cluster) of the cluster to set logging. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetLoggingService() { - // Construct request - const request = { - projectId, - zone, - clusterId, - loggingService, - }; - - // Run request - const response = await containerClient.setLoggingService(request); - console.log(response); - } - - callSetLoggingService(); - // [END container_v1beta1_generated_ClusterManager_SetLoggingService_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_maintenance_policy.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_maintenance_policy.js deleted file mode 100644 index fa688eb7520..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_maintenance_policy.js +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, maintenancePolicy) { - // [START container_v1beta1_generated_ClusterManager_SetMaintenancePolicy_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The Google Developers Console project ID or project - * number (https://cloud.google.com/resource-manager/docs/creating-managing-projects). - */ - // const projectId = 'abc123' - /** - * Required. The name of the Google Compute Engine - * zone (https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. - */ - // const zone = 'abc123' - /** - * Required. The name of the cluster to update. - */ - // const clusterId = 'abc123' - /** - * Required. The maintenance policy to be set for the cluster. An empty field - * clears the existing maintenance policy. - */ - // const maintenancePolicy = {} - /** - * The name (project, location, cluster name) of the cluster to set - * maintenance policy. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetMaintenancePolicy() { - // Construct request - const request = { - projectId, - zone, - clusterId, - maintenancePolicy, - }; - - // Run request - const response = await containerClient.setMaintenancePolicy(request); - console.log(response); - } - - callSetMaintenancePolicy(); - // [END container_v1beta1_generated_ClusterManager_SetMaintenancePolicy_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_master_auth.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_master_auth.js deleted file mode 100644 index f39467e7cab..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_master_auth.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, action, update) { - // [START container_v1beta1_generated_ClusterManager_SetMasterAuth_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The exact form of action to be taken on the master auth. - */ - // const action = {} - /** - * Required. A description of the update. - */ - // const update = {} - /** - * The name (project, location, cluster) of the cluster to set auth. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetMasterAuth() { - // Construct request - const request = { - projectId, - zone, - clusterId, - action, - update, - }; - - // Run request - const response = await containerClient.setMasterAuth(request); - console.log(response); - } - - callSetMasterAuth(); - // [END container_v1beta1_generated_ClusterManager_SetMasterAuth_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_monitoring_service.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_monitoring_service.js deleted file mode 100644 index a7fe3208d49..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_monitoring_service.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, monitoringService) { - // [START container_v1beta1_generated_ClusterManager_SetMonitoringService_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The monitoring service the cluster should use to write metrics. - * Currently available options: - * * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring - * service with a Kubernetes-native resource model - * * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no - * longer available as of GKE 1.15). - * * `none` - No metrics will be exported from the cluster. - * If left as an empty string,`monitoring.googleapis.com/kubernetes` will be - * used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. - */ - // const monitoringService = 'abc123' - /** - * The name (project, location, cluster) of the cluster to set monitoring. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetMonitoringService() { - // Construct request - const request = { - projectId, - zone, - clusterId, - monitoringService, - }; - - // Run request - const response = await containerClient.setMonitoringService(request); - console.log(response); - } - - callSetMonitoringService(); - // [END container_v1beta1_generated_ClusterManager_SetMonitoringService_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_network_policy.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_network_policy.js deleted file mode 100644 index 08f2bd01e43..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_network_policy.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, networkPolicy) { - // [START container_v1beta1_generated_ClusterManager_SetNetworkPolicy_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Configuration options for the NetworkPolicy feature. - */ - // const networkPolicy = {} - /** - * The name (project, location, cluster name) of the cluster to set networking - * policy. Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetNetworkPolicy() { - // Construct request - const request = { - projectId, - zone, - clusterId, - networkPolicy, - }; - - // Run request - const response = await containerClient.setNetworkPolicy(request); - console.log(response); - } - - callSetNetworkPolicy(); - // [END container_v1beta1_generated_ClusterManager_SetNetworkPolicy_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_autoscaling.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_autoscaling.js deleted file mode 100644 index 48045be1f16..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_autoscaling.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, nodePoolId, autoscaling) { - // [START container_v1beta1_generated_ClusterManager_SetNodePoolAutoscaling_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Autoscaling configuration for the node pool. - */ - // const autoscaling = {} - /** - * The name (project, location, cluster, node pool) of the node pool to set - * autoscaler settings. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetNodePoolAutoscaling() { - // Construct request - const request = { - projectId, - zone, - clusterId, - nodePoolId, - autoscaling, - }; - - // Run request - const response = await containerClient.setNodePoolAutoscaling(request); - console.log(response); - } - - callSetNodePoolAutoscaling(); - // [END container_v1beta1_generated_ClusterManager_SetNodePoolAutoscaling_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_management.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_management.js deleted file mode 100644 index 904e07be6c2..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_management.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, nodePoolId, management) { - // [START container_v1beta1_generated_ClusterManager_SetNodePoolManagement_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. NodeManagement configuration for the node pool. - */ - // const management = {} - /** - * The name (project, location, cluster, node pool id) of the node pool to set - * management properties. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetNodePoolManagement() { - // Construct request - const request = { - projectId, - zone, - clusterId, - nodePoolId, - management, - }; - - // Run request - const response = await containerClient.setNodePoolManagement(request); - console.log(response); - } - - callSetNodePoolManagement(); - // [END container_v1beta1_generated_ClusterManager_SetNodePoolManagement_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_size.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_size.js deleted file mode 100644 index 3903f3ff656..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_size.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, nodePoolId, nodeCount) { - // [START container_v1beta1_generated_ClusterManager_SetNodePoolSize_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The desired node count for the pool. - */ - // const nodeCount = 1234 - /** - * The name (project, location, cluster, node pool id) of the node pool to set - * size. - * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetNodePoolSize() { - // Construct request - const request = { - projectId, - zone, - clusterId, - nodePoolId, - nodeCount, - }; - - // Run request - const response = await containerClient.setNodePoolSize(request); - console.log(response); - } - - callSetNodePoolSize(); - // [END container_v1beta1_generated_ClusterManager_SetNodePoolSize_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.start_i_p_rotation.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.start_i_p_rotation.js deleted file mode 100644 index 181752cb53f..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.start_i_p_rotation.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId) { - // [START container_v1beta1_generated_ClusterManager_StartIPRotation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster name) of the cluster to start IP - * rotation. Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - /** - * Whether to rotate credentials during IP rotation. - */ - // const rotateCredentials = true - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callStartIPRotation() { - // Construct request - const request = { - projectId, - zone, - clusterId, - }; - - // Run request - const response = await containerClient.startIPRotation(request); - console.log(response); - } - - callStartIPRotation(); - // [END container_v1beta1_generated_ClusterManager_StartIPRotation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_cluster.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_cluster.js deleted file mode 100644 index 23c5ff8b0c8..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_cluster.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, update) { - // [START container_v1beta1_generated_ClusterManager_UpdateCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. A description of the update. - */ - // const update = {} - /** - * The name (project, location, cluster) of the cluster to update. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callUpdateCluster() { - // Construct request - const request = { - projectId, - zone, - clusterId, - update, - }; - - // Run request - const response = await containerClient.updateCluster(request); - console.log(response); - } - - callUpdateCluster(); - // [END container_v1beta1_generated_ClusterManager_UpdateCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_master.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_master.js deleted file mode 100644 index d76efa7a362..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_master.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, masterVersion) { - // [START container_v1beta1_generated_ClusterManager_UpdateMaster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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 - */ - // const masterVersion = 'abc123' - /** - * The name (project, location, cluster) of the cluster to update. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callUpdateMaster() { - // Construct request - const request = { - projectId, - zone, - clusterId, - masterVersion, - }; - - // Run request - const response = await containerClient.updateMaster(request); - console.log(response); - } - - callUpdateMaster(); - // [END container_v1beta1_generated_ClusterManager_UpdateMaster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_node_pool.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_node_pool.js deleted file mode 100644 index 8f5b298a36e..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_node_pool.js +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, nodePoolId, nodeVersion, imageType) { - // [START container_v1beta1_generated_ClusterManager_UpdateNodePool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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 - */ - // const nodeVersion = 'abc123' - /** - * Required. The desired image type for the node pool. Please see - * https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for - * available image types. - */ - // const imageType = 'abc123' - /** - * The desired list of Google Compute Engine - * zones (https://cloud.google.com/compute/docs/zones#available) in which the - * node pool's nodes should be located. Changing the locations for a node pool - * will result in nodes being either created or removed from the node pool, - * depending on whether locations are being added or removed. - */ - // const locations = 'abc123' - /** - * The desired workload metadata config for the node pool. - */ - // const workloadMetadataConfig = {} - /** - * The name (project, location, cluster, node pool) of the node pool to - * update. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - /** - * Upgrade settings control disruption and speed of the upgrade. - */ - // const upgradeSettings = {} - /** - * The desired network tags to be applied to all nodes in the node pool. - * If this field is not present, the tags will not be changed. Otherwise, - * the existing network tags will be *replaced* with the provided tags. - */ - // const tags = {} - /** - * The desired node taints to be applied to all nodes in the node pool. - * If this field is not present, the taints will not be changed. Otherwise, - * the existing node taints will be *replaced* with the provided taints. - */ - // const taints = {} - /** - * The desired node labels to be applied to all nodes in the node pool. - * If this field is not present, the labels will not be changed. Otherwise, - * the existing node labels will be *replaced* with the provided labels. - */ - // const labels = {} - /** - * Parameters that can be configured on Linux nodes. - */ - // const linuxNodeConfig = {} - /** - * Node kubelet configs. - */ - // const kubeletConfig = {} - /** - * Node network config. - */ - // const nodeNetworkConfig = {} - /** - * GCFS config. - */ - // const gcfsConfig = {} - /** - * Confidential nodes config. - * All the nodes in the node pool will be Confidential VM once enabled. - */ - // const confidentialNodes = {} - /** - * Enable or disable gvnic on the node pool. - */ - // const gvnic = {} - /** - * The current etag of the node pool. - * If an etag is provided and does not match the current etag of the node - * pool, update will be blocked and an ABORTED error will be returned. - */ - // const etag = 'abc123' - /** - * Enable or disable NCCL fast socket for the node pool. - */ - // const fastSocket = {} - /** - * Logging configuration. - */ - // const loggingConfig = {} - /** - * The resource labels for the node pool to use to annotate any related - * Google Compute Engine resources. - */ - // const resourceLabels = {} - /** - * Parameters that can be configured on Windows nodes. - */ - // const windowsNodeConfig = {} - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callUpdateNodePool() { - // Construct request - const request = { - projectId, - zone, - clusterId, - nodePoolId, - nodeVersion, - imageType, - }; - - // Run request - const response = await containerClient.updateNodePool(request); - console.log(response); - } - - callUpdateNodePool(); - // [END container_v1beta1_generated_ClusterManager_UpdateNodePool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json deleted file mode 100644 index 5e5c05ee1ca..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json +++ /dev/null @@ -1,1955 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-container", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.container.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "regionTag": "container_v1beta1_generated_ClusterManager_ListClusters_async", - "title": "ClusterManager listClusters Sample", - "origin": "API_DEFINITION", - "description": " Lists all clusters owned by a project in either the specified zone or all zones.", - "canonical": true, - "file": "cluster_manager.list_clusters.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListClusters", - "fullName": "google.container.v1beta1.ClusterManager.ListClusters", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.ListClustersResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "ListClusters", - "fullName": "google.container.v1beta1.ClusterManager.ListClusters", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_GetCluster_async", - "title": "ClusterManager getCluster Sample", - "origin": "API_DEFINITION", - "description": " Gets the details for a specific cluster.", - "canonical": true, - "file": "cluster_manager.get_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCluster", - "fullName": "google.container.v1beta1.ClusterManager.GetCluster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Cluster", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "GetCluster", - "fullName": "google.container.v1beta1.ClusterManager.GetCluster", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_CreateCluster_async", - "title": "ClusterManager createCluster Sample", - "origin": "API_DEFINITION", - "description": " 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](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). 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.", - "canonical": true, - "file": "cluster_manager.create_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateCluster", - "fullName": "google.container.v1beta1.ClusterManager.CreateCluster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster", - "type": ".google.container.v1beta1.Cluster" - }, - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "CreateCluster", - "fullName": "google.container.v1beta1.ClusterManager.CreateCluster", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_UpdateCluster_async", - "title": "ClusterManager updateCluster Sample", - "origin": "API_DEFINITION", - "description": " Updates the settings for a specific cluster.", - "canonical": true, - "file": "cluster_manager.update_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateCluster", - "fullName": "google.container.v1beta1.ClusterManager.UpdateCluster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "update", - "type": ".google.container.v1beta1.ClusterUpdate" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "UpdateCluster", - "fullName": "google.container.v1beta1.ClusterManager.UpdateCluster", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_UpdateNodePool_async", - "title": "ClusterManager updateNodePool Sample", - "origin": "API_DEFINITION", - "description": " Updates the version and/or image type of a specific node pool.", - "canonical": true, - "file": "cluster_manager.update_node_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 160, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateNodePool", - "fullName": "google.container.v1beta1.ClusterManager.UpdateNodePool", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "node_version", - "type": "TYPE_STRING" - }, - { - "name": "image_type", - "type": "TYPE_STRING" - }, - { - "name": "locations", - "type": "TYPE_STRING[]" - }, - { - "name": "workload_metadata_config", - "type": ".google.container.v1beta1.WorkloadMetadataConfig" - }, - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "upgrade_settings", - "type": ".google.container.v1beta1.NodePool.UpgradeSettings" - }, - { - "name": "tags", - "type": ".google.container.v1beta1.NetworkTags" - }, - { - "name": "taints", - "type": ".google.container.v1beta1.NodeTaints" - }, - { - "name": "labels", - "type": ".google.container.v1beta1.NodeLabels" - }, - { - "name": "linux_node_config", - "type": ".google.container.v1beta1.LinuxNodeConfig" - }, - { - "name": "kubelet_config", - "type": ".google.container.v1beta1.NodeKubeletConfig" - }, - { - "name": "node_network_config", - "type": ".google.container.v1beta1.NodeNetworkConfig" - }, - { - "name": "gcfs_config", - "type": ".google.container.v1beta1.GcfsConfig" - }, - { - "name": "confidential_nodes", - "type": ".google.container.v1beta1.ConfidentialNodes" - }, - { - "name": "gvnic", - "type": ".google.container.v1beta1.VirtualNIC" - }, - { - "name": "etag", - "type": "TYPE_STRING" - }, - { - "name": "fast_socket", - "type": ".google.container.v1beta1.FastSocket" - }, - { - "name": "logging_config", - "type": ".google.container.v1beta1.NodePoolLoggingConfig" - }, - { - "name": "resource_labels", - "type": ".google.container.v1beta1.ResourceLabels" - }, - { - "name": "windows_node_config", - "type": ".google.container.v1beta1.WindowsNodeConfig" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "UpdateNodePool", - "fullName": "google.container.v1beta1.ClusterManager.UpdateNodePool", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_SetNodePoolAutoscaling_async", - "title": "ClusterManager setNodePoolAutoscaling Sample", - "origin": "API_DEFINITION", - "description": " Sets the autoscaling settings of a specific node pool.", - "canonical": true, - "file": "cluster_manager.set_node_pool_autoscaling.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetNodePoolAutoscaling", - "fullName": "google.container.v1beta1.ClusterManager.SetNodePoolAutoscaling", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "autoscaling", - "type": ".google.container.v1beta1.NodePoolAutoscaling" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "SetNodePoolAutoscaling", - "fullName": "google.container.v1beta1.ClusterManager.SetNodePoolAutoscaling", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_SetLoggingService_async", - "title": "ClusterManager setLoggingService Sample", - "origin": "API_DEFINITION", - "description": " Sets the logging service for a specific cluster.", - "canonical": true, - "file": "cluster_manager.set_logging_service.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetLoggingService", - "fullName": "google.container.v1beta1.ClusterManager.SetLoggingService", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "logging_service", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "SetLoggingService", - "fullName": "google.container.v1beta1.ClusterManager.SetLoggingService", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_SetMonitoringService_async", - "title": "ClusterManager setMonitoringService Sample", - "origin": "API_DEFINITION", - "description": " Sets the monitoring service for a specific cluster.", - "canonical": true, - "file": "cluster_manager.set_monitoring_service.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetMonitoringService", - "fullName": "google.container.v1beta1.ClusterManager.SetMonitoringService", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "monitoring_service", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "SetMonitoringService", - "fullName": "google.container.v1beta1.ClusterManager.SetMonitoringService", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_SetAddonsConfig_async", - "title": "ClusterManager setAddonsConfig Sample", - "origin": "API_DEFINITION", - "description": " Sets the addons for a specific cluster.", - "canonical": true, - "file": "cluster_manager.set_addons_config.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetAddonsConfig", - "fullName": "google.container.v1beta1.ClusterManager.SetAddonsConfig", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "addons_config", - "type": ".google.container.v1beta1.AddonsConfig" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "SetAddonsConfig", - "fullName": "google.container.v1beta1.ClusterManager.SetAddonsConfig", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_SetLocations_async", - "title": "ClusterManager setLocations Sample", - "origin": "API_DEFINITION", - "description": " Sets the locations for a specific cluster. Deprecated. Use [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters/update) instead.", - "canonical": true, - "file": "cluster_manager.set_locations.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetLocations", - "fullName": "google.container.v1beta1.ClusterManager.SetLocations", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "locations", - "type": "TYPE_STRING[]" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "SetLocations", - "fullName": "google.container.v1beta1.ClusterManager.SetLocations", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_UpdateMaster_async", - "title": "ClusterManager updateMaster Sample", - "origin": "API_DEFINITION", - "description": " Updates the master for a specific cluster.", - "canonical": true, - "file": "cluster_manager.update_master.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateMaster", - "fullName": "google.container.v1beta1.ClusterManager.UpdateMaster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "master_version", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "UpdateMaster", - "fullName": "google.container.v1beta1.ClusterManager.UpdateMaster", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_SetMasterAuth_async", - "title": "ClusterManager setMasterAuth Sample", - "origin": "API_DEFINITION", - "description": " Sets master auth materials. Currently supports changing the admin password or a specific cluster, either via password generation or explicitly setting the password.", - "canonical": true, - "file": "cluster_manager.set_master_auth.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetMasterAuth", - "fullName": "google.container.v1beta1.ClusterManager.SetMasterAuth", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "action", - "type": ".google.container.v1beta1.SetMasterAuthRequest.Action" - }, - { - "name": "update", - "type": ".google.container.v1beta1.MasterAuth" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "SetMasterAuth", - "fullName": "google.container.v1beta1.ClusterManager.SetMasterAuth", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_DeleteCluster_async", - "title": "ClusterManager deleteCluster Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "cluster_manager.delete_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteCluster", - "fullName": "google.container.v1beta1.ClusterManager.DeleteCluster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "DeleteCluster", - "fullName": "google.container.v1beta1.ClusterManager.DeleteCluster", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_ListOperations_async", - "title": "ClusterManager listOperations Sample", - "origin": "API_DEFINITION", - "description": " Lists all operations in a project in the specified zone or all zones.", - "canonical": true, - "file": "cluster_manager.list_operations.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListOperations", - "fullName": "google.container.v1beta1.ClusterManager.ListOperations", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.ListOperationsResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "ListOperations", - "fullName": "google.container.v1beta1.ClusterManager.ListOperations", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_GetOperation_async", - "title": "ClusterManager getOperation Sample", - "origin": "API_DEFINITION", - "description": " Gets the specified operation.", - "canonical": true, - "file": "cluster_manager.get_operation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetOperation", - "fullName": "google.container.v1beta1.ClusterManager.GetOperation", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "operation_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "GetOperation", - "fullName": "google.container.v1beta1.ClusterManager.GetOperation", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_CancelOperation_async", - "title": "ClusterManager cancelOperation Sample", - "origin": "API_DEFINITION", - "description": " Cancels the specified operation.", - "canonical": true, - "file": "cluster_manager.cancel_operation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CancelOperation", - "fullName": "google.container.v1beta1.ClusterManager.CancelOperation", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "operation_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "CancelOperation", - "fullName": "google.container.v1beta1.ClusterManager.CancelOperation", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_GetServerConfig_async", - "title": "ClusterManager getServerConfig Sample", - "origin": "API_DEFINITION", - "description": " Returns configuration info about the Google Kubernetes Engine service.", - "canonical": true, - "file": "cluster_manager.get_server_config.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetServerConfig", - "fullName": "google.container.v1beta1.ClusterManager.GetServerConfig", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.ServerConfig", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "GetServerConfig", - "fullName": "google.container.v1beta1.ClusterManager.GetServerConfig", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_GetJSONWebKeys_async", - "title": "ClusterManager getJSONWebKeys Sample", - "origin": "API_DEFINITION", - "description": " Gets the public component of the cluster signing keys in JSON Web Key format. This API is not yet intended for general use, and is not available for all clusters.", - "canonical": true, - "file": "cluster_manager.get_j_s_o_n_web_keys.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetJSONWebKeys", - "fullName": "google.container.v1beta1.ClusterManager.GetJSONWebKeys", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.GetJSONWebKeysResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "GetJSONWebKeys", - "fullName": "google.container.v1beta1.ClusterManager.GetJSONWebKeys", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_ListNodePools_async", - "title": "ClusterManager listNodePools Sample", - "origin": "API_DEFINITION", - "description": " Lists the node pools for a cluster.", - "canonical": true, - "file": "cluster_manager.list_node_pools.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListNodePools", - "fullName": "google.container.v1beta1.ClusterManager.ListNodePools", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.ListNodePoolsResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "ListNodePools", - "fullName": "google.container.v1beta1.ClusterManager.ListNodePools", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_GetNodePool_async", - "title": "ClusterManager getNodePool Sample", - "origin": "API_DEFINITION", - "description": " Retrieves the requested node pool.", - "canonical": true, - "file": "cluster_manager.get_node_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetNodePool", - "fullName": "google.container.v1beta1.ClusterManager.GetNodePool", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.NodePool", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "GetNodePool", - "fullName": "google.container.v1beta1.ClusterManager.GetNodePool", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_CreateNodePool_async", - "title": "ClusterManager createNodePool Sample", - "origin": "API_DEFINITION", - "description": " Creates a node pool for a cluster.", - "canonical": true, - "file": "cluster_manager.create_node_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateNodePool", - "fullName": "google.container.v1beta1.ClusterManager.CreateNodePool", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool", - "type": ".google.container.v1beta1.NodePool" - }, - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "CreateNodePool", - "fullName": "google.container.v1beta1.ClusterManager.CreateNodePool", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_DeleteNodePool_async", - "title": "ClusterManager deleteNodePool Sample", - "origin": "API_DEFINITION", - "description": " Deletes a node pool from a cluster.", - "canonical": true, - "file": "cluster_manager.delete_node_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteNodePool", - "fullName": "google.container.v1beta1.ClusterManager.DeleteNodePool", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "DeleteNodePool", - "fullName": "google.container.v1beta1.ClusterManager.DeleteNodePool", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_CompleteNodePoolUpgrade_async", - "title": "ClusterManager completeNodePoolUpgrade Sample", - "origin": "API_DEFINITION", - "description": " CompleteNodePoolUpgrade will signal an on-going node pool upgrade to complete.", - "canonical": true, - "file": "cluster_manager.complete_node_pool_upgrade.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CompleteNodePoolUpgrade", - "fullName": "google.container.v1beta1.ClusterManager.CompleteNodePoolUpgrade", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "CompleteNodePoolUpgrade", - "fullName": "google.container.v1beta1.ClusterManager.CompleteNodePoolUpgrade", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_RollbackNodePoolUpgrade_async", - "title": "ClusterManager rollbackNodePoolUpgrade Sample", - "origin": "API_DEFINITION", - "description": " Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last upgrade successfully completed.", - "canonical": true, - "file": "cluster_manager.rollback_node_pool_upgrade.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RollbackNodePoolUpgrade", - "fullName": "google.container.v1beta1.ClusterManager.RollbackNodePoolUpgrade", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "respect_pdb", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "RollbackNodePoolUpgrade", - "fullName": "google.container.v1beta1.ClusterManager.RollbackNodePoolUpgrade", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_SetNodePoolManagement_async", - "title": "ClusterManager setNodePoolManagement Sample", - "origin": "API_DEFINITION", - "description": " Sets the NodeManagement options for a node pool.", - "canonical": true, - "file": "cluster_manager.set_node_pool_management.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetNodePoolManagement", - "fullName": "google.container.v1beta1.ClusterManager.SetNodePoolManagement", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "management", - "type": ".google.container.v1beta1.NodeManagement" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "SetNodePoolManagement", - "fullName": "google.container.v1beta1.ClusterManager.SetNodePoolManagement", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_SetLabels_async", - "title": "ClusterManager setLabels Sample", - "origin": "API_DEFINITION", - "description": " Sets labels on a cluster.", - "canonical": true, - "file": "cluster_manager.set_labels.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetLabels", - "fullName": "google.container.v1beta1.ClusterManager.SetLabels", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "resource_labels", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "label_fingerprint", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "SetLabels", - "fullName": "google.container.v1beta1.ClusterManager.SetLabels", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_SetLegacyAbac_async", - "title": "ClusterManager setLegacyAbac Sample", - "origin": "API_DEFINITION", - "description": " Enables or disables the ABAC authorization mechanism on a cluster.", - "canonical": true, - "file": "cluster_manager.set_legacy_abac.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetLegacyAbac", - "fullName": "google.container.v1beta1.ClusterManager.SetLegacyAbac", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "enabled", - "type": "TYPE_BOOL" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "SetLegacyAbac", - "fullName": "google.container.v1beta1.ClusterManager.SetLegacyAbac", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_StartIPRotation_async", - "title": "ClusterManager startIPRotation Sample", - "origin": "API_DEFINITION", - "description": " Starts master IP rotation.", - "canonical": true, - "file": "cluster_manager.start_i_p_rotation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "StartIPRotation", - "fullName": "google.container.v1beta1.ClusterManager.StartIPRotation", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "rotate_credentials", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "StartIPRotation", - "fullName": "google.container.v1beta1.ClusterManager.StartIPRotation", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_CompleteIPRotation_async", - "title": "ClusterManager completeIPRotation Sample", - "origin": "API_DEFINITION", - "description": " Completes master IP rotation.", - "canonical": true, - "file": "cluster_manager.complete_i_p_rotation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CompleteIPRotation", - "fullName": "google.container.v1beta1.ClusterManager.CompleteIPRotation", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "CompleteIPRotation", - "fullName": "google.container.v1beta1.ClusterManager.CompleteIPRotation", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_SetNodePoolSize_async", - "title": "ClusterManager setNodePoolSize Sample", - "origin": "API_DEFINITION", - "description": " SetNodePoolSizeRequest sets the size of a node pool. The new size will be used for all replicas, including future replicas created by modifying [NodePool.locations][google.container.v1beta1.NodePool.locations].", - "canonical": true, - "file": "cluster_manager.set_node_pool_size.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetNodePoolSize", - "fullName": "google.container.v1beta1.ClusterManager.SetNodePoolSize", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "node_count", - "type": "TYPE_INT32" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "SetNodePoolSize", - "fullName": "google.container.v1beta1.ClusterManager.SetNodePoolSize", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_SetNetworkPolicy_async", - "title": "ClusterManager setNetworkPolicy Sample", - "origin": "API_DEFINITION", - "description": " Enables or disables Network Policy for a cluster.", - "canonical": true, - "file": "cluster_manager.set_network_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetNetworkPolicy", - "fullName": "google.container.v1beta1.ClusterManager.SetNetworkPolicy", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "network_policy", - "type": ".google.container.v1beta1.NetworkPolicy" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "SetNetworkPolicy", - "fullName": "google.container.v1beta1.ClusterManager.SetNetworkPolicy", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_SetMaintenancePolicy_async", - "title": "ClusterManager setMaintenancePolicy Sample", - "origin": "API_DEFINITION", - "description": " Sets the maintenance policy for a cluster.", - "canonical": true, - "file": "cluster_manager.set_maintenance_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 78, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetMaintenancePolicy", - "fullName": "google.container.v1beta1.ClusterManager.SetMaintenancePolicy", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "maintenance_policy", - "type": ".google.container.v1beta1.MaintenancePolicy" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "SetMaintenancePolicy", - "fullName": "google.container.v1beta1.ClusterManager.SetMaintenancePolicy", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_ListUsableSubnetworks_async", - "title": "ClusterManager listUsableSubnetworks Sample", - "origin": "API_DEFINITION", - "description": " Lists subnetworks that can be used for creating clusters in a project.", - "canonical": true, - "file": "cluster_manager.list_usable_subnetworks.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListUsableSubnetworks", - "fullName": "google.container.v1beta1.ClusterManager.ListUsableSubnetworks", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.ListUsableSubnetworksResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "ListUsableSubnetworks", - "fullName": "google.container.v1beta1.ClusterManager.ListUsableSubnetworks", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_CheckAutopilotCompatibility_async", - "title": "ClusterManager checkAutopilotCompatibility Sample", - "origin": "API_DEFINITION", - "description": " Checks the cluster compatibility with Autopilot mode, and returns a list of compatibility issues.", - "canonical": true, - "file": "cluster_manager.check_autopilot_compatibility.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CheckAutopilotCompatibility", - "fullName": "google.container.v1beta1.ClusterManager.CheckAutopilotCompatibility", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.CheckAutopilotCompatibilityResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "CheckAutopilotCompatibility", - "fullName": "google.container.v1beta1.ClusterManager.CheckAutopilotCompatibility", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_ListLocations_async", - "title": "ClusterManager listLocations Sample", - "origin": "API_DEFINITION", - "description": " Fetches locations that offer Google Kubernetes Engine.", - "canonical": true, - "file": "cluster_manager.list_locations.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListLocations", - "fullName": "google.container.v1beta1.ClusterManager.ListLocations", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.ListLocationsResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "ListLocations", - "fullName": "google.container.v1beta1.ClusterManager.ListLocations", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-container/v1beta1/src/index.ts b/owl-bot-staging/google-container/v1beta1/src/index.ts deleted file mode 100644 index 44cbef9d2d2..00000000000 --- a/owl-bot-staging/google-container/v1beta1/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1beta1 from './v1beta1'; -const ClusterManagerClient = v1beta1.ClusterManagerClient; -type ClusterManagerClient = v1beta1.ClusterManagerClient; -export {v1beta1, ClusterManagerClient}; -export default {v1beta1, ClusterManagerClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client.ts b/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client.ts deleted file mode 100644 index 168ebbd3a99..00000000000 --- a/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client.ts +++ /dev/null @@ -1,3623 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1beta1/cluster_manager_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './cluster_manager_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Google Kubernetes Engine Cluster Manager v1beta1 - * @class - * @memberof v1beta1 - */ -export class ClusterManagerClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - clusterManagerStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of ClusterManagerClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ClusterManagerClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof ClusterManagerClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listUsableSubnetworks: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'subnetworks') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.container.v1beta1.ClusterManager', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.clusterManagerStub) { - return this.clusterManagerStub; - } - - // Put together the "service stub" for - // google.container.v1beta1.ClusterManager. - this.clusterManagerStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.container.v1beta1.ClusterManager') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.container.v1beta1.ClusterManager, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const clusterManagerStubMethods = - ['listClusters', 'getCluster', 'createCluster', 'updateCluster', 'updateNodePool', 'setNodePoolAutoscaling', 'setLoggingService', 'setMonitoringService', 'setAddonsConfig', 'setLocations', 'updateMaster', 'setMasterAuth', 'deleteCluster', 'listOperations', 'getOperation', 'cancelOperation', 'getServerConfig', 'getJsonWebKeys', 'listNodePools', 'getNodePool', 'createNodePool', 'deleteNodePool', 'completeNodePoolUpgrade', 'rollbackNodePoolUpgrade', 'setNodePoolManagement', 'setLabels', 'setLegacyAbac', 'startIpRotation', 'completeIpRotation', 'setNodePoolSize', 'setNetworkPolicy', 'setMaintenancePolicy', 'listUsableSubnetworks', 'checkAutopilotCompatibility', 'listLocations']; - for (const methodName of clusterManagerStubMethods) { - const callPromise = this.clusterManagerStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.clusterManagerStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'container.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'container.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Lists all clusters owned by a project in either the specified zone or all - * zones. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the parent field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides, or "-" for all zones. This field has been deprecated and - * replaced by the parent field. - * @param {string} request.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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.ListClustersResponse | ListClustersResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.list_clusters.js - * region_tag:container_v1beta1_generated_ClusterManager_ListClusters_async - */ - listClusters( - request?: protos.google.container.v1beta1.IListClustersRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IListClustersResponse, - protos.google.container.v1beta1.IListClustersRequest|undefined, {}|undefined - ]>; - listClusters( - request: protos.google.container.v1beta1.IListClustersRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IListClustersResponse, - protos.google.container.v1beta1.IListClustersRequest|null|undefined, - {}|null|undefined>): void; - listClusters( - request: protos.google.container.v1beta1.IListClustersRequest, - callback: Callback< - protos.google.container.v1beta1.IListClustersResponse, - protos.google.container.v1beta1.IListClustersRequest|null|undefined, - {}|null|undefined>): void; - listClusters( - request?: protos.google.container.v1beta1.IListClustersRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IListClustersResponse, - protos.google.container.v1beta1.IListClustersRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IListClustersResponse, - protos.google.container.v1beta1.IListClustersRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IListClustersResponse, - protos.google.container.v1beta1.IListClustersRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - }); - this.initialize(); - return this.innerApiCalls.listClusters(request, options, callback); - } -/** - * Gets the details for a specific cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to retrieve. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to retrieve. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Cluster | Cluster}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.get_cluster.js - * region_tag:container_v1beta1_generated_ClusterManager_GetCluster_async - */ - getCluster( - request?: protos.google.container.v1beta1.IGetClusterRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.ICluster, - protos.google.container.v1beta1.IGetClusterRequest|undefined, {}|undefined - ]>; - getCluster( - request: protos.google.container.v1beta1.IGetClusterRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.ICluster, - protos.google.container.v1beta1.IGetClusterRequest|null|undefined, - {}|null|undefined>): void; - getCluster( - request: protos.google.container.v1beta1.IGetClusterRequest, - callback: Callback< - protos.google.container.v1beta1.ICluster, - protos.google.container.v1beta1.IGetClusterRequest|null|undefined, - {}|null|undefined>): void; - getCluster( - request?: protos.google.container.v1beta1.IGetClusterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.ICluster, - protos.google.container.v1beta1.IGetClusterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.ICluster, - protos.google.container.v1beta1.IGetClusterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.ICluster, - protos.google.container.v1beta1.IGetClusterRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.getCluster(request, options, callback); - } -/** - * 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](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). - * - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the parent field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the parent - * field. - * @param {google.container.v1beta1.Cluster} request.cluster - * Required. A [cluster - * resource](https://cloud.google.com/container-engine/reference/rest/v1beta1/projects.locations.clusters) - * @param {string} request.parent - * The parent (project and location) where the cluster will be created. - * Specified in the format `projects/* /locations/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.create_cluster.js - * region_tag:container_v1beta1_generated_ClusterManager_CreateCluster_async - */ - createCluster( - request?: protos.google.container.v1beta1.ICreateClusterRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICreateClusterRequest|undefined, {}|undefined - ]>; - createCluster( - request: protos.google.container.v1beta1.ICreateClusterRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICreateClusterRequest|null|undefined, - {}|null|undefined>): void; - createCluster( - request: protos.google.container.v1beta1.ICreateClusterRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICreateClusterRequest|null|undefined, - {}|null|undefined>): void; - createCluster( - request?: protos.google.container.v1beta1.ICreateClusterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICreateClusterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICreateClusterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICreateClusterRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - }); - this.initialize(); - return this.innerApiCalls.createCluster(request, options, callback); - } -/** - * Updates the settings for a specific cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {google.container.v1beta1.ClusterUpdate} request.update - * Required. A description of the update. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to update. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.update_cluster.js - * region_tag:container_v1beta1_generated_ClusterManager_UpdateCluster_async - */ - updateCluster( - request?: protos.google.container.v1beta1.IUpdateClusterRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateClusterRequest|undefined, {}|undefined - ]>; - updateCluster( - request: protos.google.container.v1beta1.IUpdateClusterRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateClusterRequest|null|undefined, - {}|null|undefined>): void; - updateCluster( - request: protos.google.container.v1beta1.IUpdateClusterRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateClusterRequest|null|undefined, - {}|null|undefined>): void; - updateCluster( - request?: protos.google.container.v1beta1.IUpdateClusterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateClusterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateClusterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateClusterRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateCluster(request, options, callback); - } -/** - * Updates the version and/or image type of a specific node pool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Required. Deprecated. The name of the node pool to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodeVersion - * 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 - * @param {string} request.imageType - * Required. The desired image type for the node pool. Please see - * https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for - * available image types. - * @param {string[]} request.locations - * The desired list of Google Compute Engine - * [zones](https://cloud.google.com/compute/docs/zones#available) in which the - * node pool's nodes should be located. Changing the locations for a node pool - * will result in nodes being either created or removed from the node pool, - * depending on whether locations are being added or removed. - * @param {google.container.v1beta1.WorkloadMetadataConfig} request.workloadMetadataConfig - * The desired workload metadata config for the node pool. - * @param {string} request.name - * The name (project, location, cluster, node pool) of the node pool to - * update. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {google.container.v1beta1.NodePool.UpgradeSettings} request.upgradeSettings - * Upgrade settings control disruption and speed of the upgrade. - * @param {google.container.v1beta1.NetworkTags} request.tags - * The desired network tags to be applied to all nodes in the node pool. - * If this field is not present, the tags will not be changed. Otherwise, - * the existing network tags will be *replaced* with the provided tags. - * @param {google.container.v1beta1.NodeTaints} request.taints - * The desired node taints to be applied to all nodes in the node pool. - * If this field is not present, the taints will not be changed. Otherwise, - * the existing node taints will be *replaced* with the provided taints. - * @param {google.container.v1beta1.NodeLabels} request.labels - * The desired node labels to be applied to all nodes in the node pool. - * If this field is not present, the labels will not be changed. Otherwise, - * the existing node labels will be *replaced* with the provided labels. - * @param {google.container.v1beta1.LinuxNodeConfig} request.linuxNodeConfig - * Parameters that can be configured on Linux nodes. - * @param {google.container.v1beta1.NodeKubeletConfig} request.kubeletConfig - * Node kubelet configs. - * @param {google.container.v1beta1.NodeNetworkConfig} request.nodeNetworkConfig - * Node network config. - * @param {google.container.v1beta1.GcfsConfig} request.gcfsConfig - * GCFS config. - * @param {google.container.v1beta1.ConfidentialNodes} request.confidentialNodes - * Confidential nodes config. - * All the nodes in the node pool will be Confidential VM once enabled. - * @param {google.container.v1beta1.VirtualNIC} request.gvnic - * Enable or disable gvnic on the node pool. - * @param {string} request.etag - * The current etag of the node pool. - * If an etag is provided and does not match the current etag of the node - * pool, update will be blocked and an ABORTED error will be returned. - * @param {google.container.v1beta1.FastSocket} request.fastSocket - * Enable or disable NCCL fast socket for the node pool. - * @param {google.container.v1beta1.NodePoolLoggingConfig} request.loggingConfig - * Logging configuration. - * @param {google.container.v1beta1.ResourceLabels} request.resourceLabels - * The resource labels for the node pool to use to annotate any related - * Google Compute Engine resources. - * @param {google.container.v1beta1.WindowsNodeConfig} request.windowsNodeConfig - * Parameters that can be configured on Windows nodes. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.update_node_pool.js - * region_tag:container_v1beta1_generated_ClusterManager_UpdateNodePool_async - */ - updateNodePool( - request?: protos.google.container.v1beta1.IUpdateNodePoolRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateNodePoolRequest|undefined, {}|undefined - ]>; - updateNodePool( - request: protos.google.container.v1beta1.IUpdateNodePoolRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateNodePoolRequest|null|undefined, - {}|null|undefined>): void; - updateNodePool( - request: protos.google.container.v1beta1.IUpdateNodePoolRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateNodePoolRequest|null|undefined, - {}|null|undefined>): void; - updateNodePool( - request?: protos.google.container.v1beta1.IUpdateNodePoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateNodePoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateNodePoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateNodePoolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateNodePool(request, options, callback); - } -/** - * Sets the autoscaling settings of a specific node pool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Required. Deprecated. The name of the node pool to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {google.container.v1beta1.NodePoolAutoscaling} request.autoscaling - * Required. Autoscaling configuration for the node pool. - * @param {string} request.name - * The name (project, location, cluster, node pool) of the node pool to set - * autoscaler settings. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.set_node_pool_autoscaling.js - * region_tag:container_v1beta1_generated_ClusterManager_SetNodePoolAutoscaling_async - */ - setNodePoolAutoscaling( - request?: protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest|undefined, {}|undefined - ]>; - setNodePoolAutoscaling( - request: protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest|null|undefined, - {}|null|undefined>): void; - setNodePoolAutoscaling( - request: protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest|null|undefined, - {}|null|undefined>): void; - setNodePoolAutoscaling( - request?: protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setNodePoolAutoscaling(request, options, callback); - } -/** - * Sets the logging service for a specific cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string} request.loggingService - * Required. The logging service the cluster should use to write logs. - * Currently available options: - * - * * `logging.googleapis.com/kubernetes` - The Cloud Logging - * service with a Kubernetes-native resource model - * * `logging.googleapis.com` - The legacy Cloud Logging service (no longer - * available as of GKE 1.15). - * * `none` - no logs will be exported from the cluster. - * - * If left as an empty string,`logging.googleapis.com/kubernetes` will be - * used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to set logging. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.set_logging_service.js - * region_tag:container_v1beta1_generated_ClusterManager_SetLoggingService_async - */ - setLoggingService( - request?: protos.google.container.v1beta1.ISetLoggingServiceRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLoggingServiceRequest|undefined, {}|undefined - ]>; - setLoggingService( - request: protos.google.container.v1beta1.ISetLoggingServiceRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLoggingServiceRequest|null|undefined, - {}|null|undefined>): void; - setLoggingService( - request: protos.google.container.v1beta1.ISetLoggingServiceRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLoggingServiceRequest|null|undefined, - {}|null|undefined>): void; - setLoggingService( - request?: protos.google.container.v1beta1.ISetLoggingServiceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLoggingServiceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLoggingServiceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLoggingServiceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setLoggingService(request, options, callback); - } -/** - * Sets the monitoring service for a specific cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string} request.monitoringService - * Required. The monitoring service the cluster should use to write metrics. - * Currently available options: - * - * * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring - * service with a Kubernetes-native resource model - * * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no - * longer available as of GKE 1.15). - * * `none` - No metrics will be exported from the cluster. - * - * If left as an empty string,`monitoring.googleapis.com/kubernetes` will be - * used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to set monitoring. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.set_monitoring_service.js - * region_tag:container_v1beta1_generated_ClusterManager_SetMonitoringService_async - */ - setMonitoringService( - request?: protos.google.container.v1beta1.ISetMonitoringServiceRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMonitoringServiceRequest|undefined, {}|undefined - ]>; - setMonitoringService( - request: protos.google.container.v1beta1.ISetMonitoringServiceRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMonitoringServiceRequest|null|undefined, - {}|null|undefined>): void; - setMonitoringService( - request: protos.google.container.v1beta1.ISetMonitoringServiceRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMonitoringServiceRequest|null|undefined, - {}|null|undefined>): void; - setMonitoringService( - request?: protos.google.container.v1beta1.ISetMonitoringServiceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMonitoringServiceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMonitoringServiceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMonitoringServiceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setMonitoringService(request, options, callback); - } -/** - * Sets the addons for a specific cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {google.container.v1beta1.AddonsConfig} request.addonsConfig - * Required. The desired configurations for the various addons available to - * run in the cluster. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to set addons. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.set_addons_config.js - * region_tag:container_v1beta1_generated_ClusterManager_SetAddonsConfig_async - */ - setAddonsConfig( - request?: protos.google.container.v1beta1.ISetAddonsConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetAddonsConfigRequest|undefined, {}|undefined - ]>; - setAddonsConfig( - request: protos.google.container.v1beta1.ISetAddonsConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetAddonsConfigRequest|null|undefined, - {}|null|undefined>): void; - setAddonsConfig( - request: protos.google.container.v1beta1.ISetAddonsConfigRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetAddonsConfigRequest|null|undefined, - {}|null|undefined>): void; - setAddonsConfig( - request?: protos.google.container.v1beta1.ISetAddonsConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetAddonsConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetAddonsConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetAddonsConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setAddonsConfig(request, options, callback); - } -/** - * Sets the locations for a specific cluster. - * Deprecated. Use - * [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters/update) - * instead. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string[]} request.locations - * Required. The desired list of Google Compute Engine - * [zones](https://cloud.google.com/compute/docs/zones#available) 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. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to set locations. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.set_locations.js - * region_tag:container_v1beta1_generated_ClusterManager_SetLocations_async - * @deprecated SetLocations is deprecated and may be removed in a future version. - */ - setLocations( - request?: protos.google.container.v1beta1.ISetLocationsRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLocationsRequest|undefined, {}|undefined - ]>; - setLocations( - request: protos.google.container.v1beta1.ISetLocationsRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLocationsRequest|null|undefined, - {}|null|undefined>): void; - setLocations( - request: protos.google.container.v1beta1.ISetLocationsRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLocationsRequest|null|undefined, - {}|null|undefined>): void; - setLocations( - request?: protos.google.container.v1beta1.ISetLocationsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLocationsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLocationsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLocationsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - this.warn('DEP$ClusterManager-$SetLocations','SetLocations is deprecated and may be removed in a future version.', 'DeprecationWarning'); - return this.innerApiCalls.setLocations(request, options, callback); - } -/** - * Updates the master for a specific cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string} request.masterVersion - * 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 - * @param {string} request.name - * The name (project, location, cluster) of the cluster to update. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.update_master.js - * region_tag:container_v1beta1_generated_ClusterManager_UpdateMaster_async - */ - updateMaster( - request?: protos.google.container.v1beta1.IUpdateMasterRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateMasterRequest|undefined, {}|undefined - ]>; - updateMaster( - request: protos.google.container.v1beta1.IUpdateMasterRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateMasterRequest|null|undefined, - {}|null|undefined>): void; - updateMaster( - request: protos.google.container.v1beta1.IUpdateMasterRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateMasterRequest|null|undefined, - {}|null|undefined>): void; - updateMaster( - request?: protos.google.container.v1beta1.IUpdateMasterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateMasterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateMasterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateMasterRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateMaster(request, options, callback); - } -/** - * Sets master auth materials. Currently supports changing the admin password - * or a specific cluster, either via password generation or explicitly setting - * the password. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {google.container.v1beta1.SetMasterAuthRequest.Action} request.action - * Required. The exact form of action to be taken on the master auth. - * @param {google.container.v1beta1.MasterAuth} request.update - * Required. A description of the update. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to set auth. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.set_master_auth.js - * region_tag:container_v1beta1_generated_ClusterManager_SetMasterAuth_async - */ - setMasterAuth( - request?: protos.google.container.v1beta1.ISetMasterAuthRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMasterAuthRequest|undefined, {}|undefined - ]>; - setMasterAuth( - request: protos.google.container.v1beta1.ISetMasterAuthRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMasterAuthRequest|null|undefined, - {}|null|undefined>): void; - setMasterAuth( - request: protos.google.container.v1beta1.ISetMasterAuthRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMasterAuthRequest|null|undefined, - {}|null|undefined>): void; - setMasterAuth( - request?: protos.google.container.v1beta1.ISetMasterAuthRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMasterAuthRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMasterAuthRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMasterAuthRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setMasterAuth(request, options, callback); - } -/** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to delete. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to delete. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.delete_cluster.js - * region_tag:container_v1beta1_generated_ClusterManager_DeleteCluster_async - */ - deleteCluster( - request?: protos.google.container.v1beta1.IDeleteClusterRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IDeleteClusterRequest|undefined, {}|undefined - ]>; - deleteCluster( - request: protos.google.container.v1beta1.IDeleteClusterRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IDeleteClusterRequest|null|undefined, - {}|null|undefined>): void; - deleteCluster( - request: protos.google.container.v1beta1.IDeleteClusterRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IDeleteClusterRequest|null|undefined, - {}|null|undefined>): void; - deleteCluster( - request?: protos.google.container.v1beta1.IDeleteClusterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IDeleteClusterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IDeleteClusterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IDeleteClusterRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteCluster(request, options, callback); - } -/** - * Lists all operations in a project in the specified zone or all zones. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the parent field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) to return - * operations for, or `-` for all zones. This field has been deprecated and - * replaced by the parent field. - * @param {string} request.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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.ListOperationsResponse | ListOperationsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.list_operations.js - * region_tag:container_v1beta1_generated_ClusterManager_ListOperations_async - */ - listOperations( - request?: protos.google.container.v1beta1.IListOperationsRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IListOperationsResponse, - protos.google.container.v1beta1.IListOperationsRequest|undefined, {}|undefined - ]>; - listOperations( - request: protos.google.container.v1beta1.IListOperationsRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IListOperationsResponse, - protos.google.container.v1beta1.IListOperationsRequest|null|undefined, - {}|null|undefined>): void; - listOperations( - request: protos.google.container.v1beta1.IListOperationsRequest, - callback: Callback< - protos.google.container.v1beta1.IListOperationsResponse, - protos.google.container.v1beta1.IListOperationsRequest|null|undefined, - {}|null|undefined>): void; - listOperations( - request?: protos.google.container.v1beta1.IListOperationsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IListOperationsResponse, - protos.google.container.v1beta1.IListOperationsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IListOperationsResponse, - protos.google.container.v1beta1.IListOperationsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IListOperationsResponse, - protos.google.container.v1beta1.IListOperationsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - }); - this.initialize(); - return this.innerApiCalls.listOperations(request, options, callback); - } -/** - * Gets the specified operation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.operationId - * Required. Deprecated. The server-assigned `name` of the operation. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, operation id) of the operation to get. - * Specified in the format `projects/* /locations/* /operations/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.get_operation.js - * region_tag:container_v1beta1_generated_ClusterManager_GetOperation_async - */ - getOperation( - request?: protos.google.container.v1beta1.IGetOperationRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IGetOperationRequest|undefined, {}|undefined - ]>; - getOperation( - request: protos.google.container.v1beta1.IGetOperationRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IGetOperationRequest|null|undefined, - {}|null|undefined>): void; - getOperation( - request: protos.google.container.v1beta1.IGetOperationRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IGetOperationRequest|null|undefined, - {}|null|undefined>): void; - getOperation( - request?: protos.google.container.v1beta1.IGetOperationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IGetOperationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IGetOperationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IGetOperationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'operation_id': request.operationId ?? '', - }); - this.initialize(); - return this.innerApiCalls.getOperation(request, options, callback); - } -/** - * Cancels the specified operation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * operation resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.operationId - * Required. Deprecated. The server-assigned `name` of the operation. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, operation id) of the operation to cancel. - * Specified in the format `projects/* /locations/* /operations/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.cancel_operation.js - * region_tag:container_v1beta1_generated_ClusterManager_CancelOperation_async - */ - cancelOperation( - request?: protos.google.container.v1beta1.ICancelOperationRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.container.v1beta1.ICancelOperationRequest|undefined, {}|undefined - ]>; - cancelOperation( - request: protos.google.container.v1beta1.ICancelOperationRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1beta1.ICancelOperationRequest|null|undefined, - {}|null|undefined>): void; - cancelOperation( - request: protos.google.container.v1beta1.ICancelOperationRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1beta1.ICancelOperationRequest|null|undefined, - {}|null|undefined>): void; - cancelOperation( - request?: protos.google.container.v1beta1.ICancelOperationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1beta1.ICancelOperationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1beta1.ICancelOperationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.container.v1beta1.ICancelOperationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'operation_id': request.operationId ?? '', - }); - this.initialize(); - return this.innerApiCalls.cancelOperation(request, options, callback); - } -/** - * Returns configuration info about the Google Kubernetes Engine service. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) to return - * operations for. This field has been deprecated and replaced by the name - * field. - * @param {string} request.name - * The name (project and location) of the server config to get, - * specified in the format `projects/* /locations/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.ServerConfig | ServerConfig}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.get_server_config.js - * region_tag:container_v1beta1_generated_ClusterManager_GetServerConfig_async - */ - getServerConfig( - request?: protos.google.container.v1beta1.IGetServerConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IServerConfig, - protos.google.container.v1beta1.IGetServerConfigRequest|undefined, {}|undefined - ]>; - getServerConfig( - request: protos.google.container.v1beta1.IGetServerConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IServerConfig, - protos.google.container.v1beta1.IGetServerConfigRequest|null|undefined, - {}|null|undefined>): void; - getServerConfig( - request: protos.google.container.v1beta1.IGetServerConfigRequest, - callback: Callback< - protos.google.container.v1beta1.IServerConfig, - protos.google.container.v1beta1.IGetServerConfigRequest|null|undefined, - {}|null|undefined>): void; - getServerConfig( - request?: protos.google.container.v1beta1.IGetServerConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IServerConfig, - protos.google.container.v1beta1.IGetServerConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IServerConfig, - protos.google.container.v1beta1.IGetServerConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IServerConfig, - protos.google.container.v1beta1.IGetServerConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - }); - this.initialize(); - return this.innerApiCalls.getServerConfig(request, options, callback); - } -/** - * Gets the public component of the cluster signing keys in - * JSON Web Key format. - * This API is not yet intended for general use, and is not available for all - * clusters. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The cluster (project, location, cluster name) to get keys for. Specified in - * the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.GetJSONWebKeysResponse | GetJSONWebKeysResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.get_j_s_o_n_web_keys.js - * region_tag:container_v1beta1_generated_ClusterManager_GetJSONWebKeys_async - */ - getJSONWebKeys( - request?: protos.google.container.v1beta1.IGetJSONWebKeysRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IGetJSONWebKeysResponse, - protos.google.container.v1beta1.IGetJSONWebKeysRequest|undefined, {}|undefined - ]>; - getJSONWebKeys( - request: protos.google.container.v1beta1.IGetJSONWebKeysRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IGetJSONWebKeysResponse, - protos.google.container.v1beta1.IGetJSONWebKeysRequest|null|undefined, - {}|null|undefined>): void; - getJSONWebKeys( - request: protos.google.container.v1beta1.IGetJSONWebKeysRequest, - callback: Callback< - protos.google.container.v1beta1.IGetJSONWebKeysResponse, - protos.google.container.v1beta1.IGetJSONWebKeysRequest|null|undefined, - {}|null|undefined>): void; - getJSONWebKeys( - request?: protos.google.container.v1beta1.IGetJSONWebKeysRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IGetJSONWebKeysResponse, - protos.google.container.v1beta1.IGetJSONWebKeysRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IGetJSONWebKeysResponse, - protos.google.container.v1beta1.IGetJSONWebKeysRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IGetJSONWebKeysResponse, - protos.google.container.v1beta1.IGetJSONWebKeysRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.getJsonWebKeys(request, options, callback); - } -/** - * Lists the node pools for a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the parent field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the parent - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the parent field. - * @param {string} request.parent - * The parent (project, location, cluster name) where the node pools will be - * listed. Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.ListNodePoolsResponse | ListNodePoolsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.list_node_pools.js - * region_tag:container_v1beta1_generated_ClusterManager_ListNodePools_async - */ - listNodePools( - request?: protos.google.container.v1beta1.IListNodePoolsRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IListNodePoolsResponse, - protos.google.container.v1beta1.IListNodePoolsRequest|undefined, {}|undefined - ]>; - listNodePools( - request: protos.google.container.v1beta1.IListNodePoolsRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IListNodePoolsResponse, - protos.google.container.v1beta1.IListNodePoolsRequest|null|undefined, - {}|null|undefined>): void; - listNodePools( - request: protos.google.container.v1beta1.IListNodePoolsRequest, - callback: Callback< - protos.google.container.v1beta1.IListNodePoolsResponse, - protos.google.container.v1beta1.IListNodePoolsRequest|null|undefined, - {}|null|undefined>): void; - listNodePools( - request?: protos.google.container.v1beta1.IListNodePoolsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IListNodePoolsResponse, - protos.google.container.v1beta1.IListNodePoolsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IListNodePoolsResponse, - protos.google.container.v1beta1.IListNodePoolsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IListNodePoolsResponse, - protos.google.container.v1beta1.IListNodePoolsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.listNodePools(request, options, callback); - } -/** - * Retrieves the requested node pool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Required. Deprecated. The name of the node pool. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster, node pool id) of the node pool to - * get. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.NodePool | NodePool}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.get_node_pool.js - * region_tag:container_v1beta1_generated_ClusterManager_GetNodePool_async - */ - getNodePool( - request?: protos.google.container.v1beta1.IGetNodePoolRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.INodePool, - protos.google.container.v1beta1.IGetNodePoolRequest|undefined, {}|undefined - ]>; - getNodePool( - request: protos.google.container.v1beta1.IGetNodePoolRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.INodePool, - protos.google.container.v1beta1.IGetNodePoolRequest|null|undefined, - {}|null|undefined>): void; - getNodePool( - request: protos.google.container.v1beta1.IGetNodePoolRequest, - callback: Callback< - protos.google.container.v1beta1.INodePool, - protos.google.container.v1beta1.IGetNodePoolRequest|null|undefined, - {}|null|undefined>): void; - getNodePool( - request?: protos.google.container.v1beta1.IGetNodePoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.INodePool, - protos.google.container.v1beta1.IGetNodePoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.INodePool, - protos.google.container.v1beta1.IGetNodePoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.INodePool, - protos.google.container.v1beta1.IGetNodePoolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.getNodePool(request, options, callback); - } -/** - * Creates a node pool for a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the parent field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the parent - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the parent field. - * @param {google.container.v1beta1.NodePool} request.nodePool - * Required. The node pool to create. - * @param {string} request.parent - * The parent (project, location, cluster name) where the node pool will be - * created. Specified in the format - * `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.create_node_pool.js - * region_tag:container_v1beta1_generated_ClusterManager_CreateNodePool_async - */ - createNodePool( - request?: protos.google.container.v1beta1.ICreateNodePoolRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICreateNodePoolRequest|undefined, {}|undefined - ]>; - createNodePool( - request: protos.google.container.v1beta1.ICreateNodePoolRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICreateNodePoolRequest|null|undefined, - {}|null|undefined>): void; - createNodePool( - request: protos.google.container.v1beta1.ICreateNodePoolRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICreateNodePoolRequest|null|undefined, - {}|null|undefined>): void; - createNodePool( - request?: protos.google.container.v1beta1.ICreateNodePoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICreateNodePoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICreateNodePoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICreateNodePoolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.createNodePool(request, options, callback); - } -/** - * Deletes a node pool from a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Required. Deprecated. The name of the node pool to delete. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster, node pool id) of the node pool to - * delete. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.delete_node_pool.js - * region_tag:container_v1beta1_generated_ClusterManager_DeleteNodePool_async - */ - deleteNodePool( - request?: protos.google.container.v1beta1.IDeleteNodePoolRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IDeleteNodePoolRequest|undefined, {}|undefined - ]>; - deleteNodePool( - request: protos.google.container.v1beta1.IDeleteNodePoolRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IDeleteNodePoolRequest|null|undefined, - {}|null|undefined>): void; - deleteNodePool( - request: protos.google.container.v1beta1.IDeleteNodePoolRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IDeleteNodePoolRequest|null|undefined, - {}|null|undefined>): void; - deleteNodePool( - request?: protos.google.container.v1beta1.IDeleteNodePoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IDeleteNodePoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IDeleteNodePoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IDeleteNodePoolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteNodePool(request, options, callback); - } -/** - * CompleteNodePoolUpgrade will signal an on-going node pool upgrade to - * complete. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The name (project, location, cluster, node pool id) of the node pool to - * complete upgrade. - * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.complete_node_pool_upgrade.js - * region_tag:container_v1beta1_generated_ClusterManager_CompleteNodePoolUpgrade_async - */ - completeNodePoolUpgrade( - request?: protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest|undefined, {}|undefined - ]>; - completeNodePoolUpgrade( - request: protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>): void; - completeNodePoolUpgrade( - request: protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>): void; - completeNodePoolUpgrade( - request?: protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.completeNodePoolUpgrade(request, options, callback); - } -/** - * Rolls back a previously Aborted or Failed NodePool upgrade. - * This makes no changes if the last upgrade successfully completed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to rollback. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Required. Deprecated. The name of the node pool to rollback. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster, node pool id) of the node poll to - * rollback upgrade. - * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {boolean} request.respectPdb - * Option for rollback to ignore the PodDisruptionBudget. - * Default value is false. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.rollback_node_pool_upgrade.js - * region_tag:container_v1beta1_generated_ClusterManager_RollbackNodePoolUpgrade_async - */ - rollbackNodePoolUpgrade( - request?: protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest|undefined, {}|undefined - ]>; - rollbackNodePoolUpgrade( - request: protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>): void; - rollbackNodePoolUpgrade( - request: protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>): void; - rollbackNodePoolUpgrade( - request?: protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.rollbackNodePoolUpgrade(request, options, callback); - } -/** - * Sets the NodeManagement options for a node pool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to update. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Required. Deprecated. The name of the node pool to update. - * This field has been deprecated and replaced by the name field. - * @param {google.container.v1beta1.NodeManagement} request.management - * Required. NodeManagement configuration for the node pool. - * @param {string} request.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/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.set_node_pool_management.js - * region_tag:container_v1beta1_generated_ClusterManager_SetNodePoolManagement_async - */ - setNodePoolManagement( - request?: protos.google.container.v1beta1.ISetNodePoolManagementRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolManagementRequest|undefined, {}|undefined - ]>; - setNodePoolManagement( - request: protos.google.container.v1beta1.ISetNodePoolManagementRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolManagementRequest|null|undefined, - {}|null|undefined>): void; - setNodePoolManagement( - request: protos.google.container.v1beta1.ISetNodePoolManagementRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolManagementRequest|null|undefined, - {}|null|undefined>): void; - setNodePoolManagement( - request?: protos.google.container.v1beta1.ISetNodePoolManagementRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolManagementRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolManagementRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolManagementRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setNodePoolManagement(request, options, callback); - } -/** - * Sets labels on a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the name field. - * @param {number[]} request.resourceLabels - * Required. The labels to set for that cluster. - * @param {string} request.labelFingerprint - * 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. - * @param {string} request.name - * The name (project, location, cluster name) of the cluster to set labels. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.set_labels.js - * region_tag:container_v1beta1_generated_ClusterManager_SetLabels_async - */ - setLabels( - request?: protos.google.container.v1beta1.ISetLabelsRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLabelsRequest|undefined, {}|undefined - ]>; - setLabels( - request: protos.google.container.v1beta1.ISetLabelsRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLabelsRequest|null|undefined, - {}|null|undefined>): void; - setLabels( - request: protos.google.container.v1beta1.ISetLabelsRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLabelsRequest|null|undefined, - {}|null|undefined>): void; - setLabels( - request?: protos.google.container.v1beta1.ISetLabelsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLabelsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLabelsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLabelsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setLabels(request, options, callback); - } -/** - * Enables or disables the ABAC authorization mechanism on a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to update. - * This field has been deprecated and replaced by the name field. - * @param {boolean} request.enabled - * Required. Whether ABAC authorization will be enabled in the cluster. - * @param {string} request.name - * The name (project, location, cluster name) of the cluster to set legacy - * abac. Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.set_legacy_abac.js - * region_tag:container_v1beta1_generated_ClusterManager_SetLegacyAbac_async - */ - setLegacyAbac( - request?: protos.google.container.v1beta1.ISetLegacyAbacRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLegacyAbacRequest|undefined, {}|undefined - ]>; - setLegacyAbac( - request: protos.google.container.v1beta1.ISetLegacyAbacRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLegacyAbacRequest|null|undefined, - {}|null|undefined>): void; - setLegacyAbac( - request: protos.google.container.v1beta1.ISetLegacyAbacRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLegacyAbacRequest|null|undefined, - {}|null|undefined>): void; - setLegacyAbac( - request?: protos.google.container.v1beta1.ISetLegacyAbacRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLegacyAbacRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLegacyAbacRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLegacyAbacRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setLegacyAbac(request, options, callback); - } -/** - * Starts master IP rotation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster name) of the cluster to start IP - * rotation. Specified in the format `projects/* /locations/* /clusters/*`. - * @param {boolean} request.rotateCredentials - * Whether to rotate credentials during IP rotation. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.start_i_p_rotation.js - * region_tag:container_v1beta1_generated_ClusterManager_StartIPRotation_async - */ - startIPRotation( - request?: protos.google.container.v1beta1.IStartIPRotationRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IStartIPRotationRequest|undefined, {}|undefined - ]>; - startIPRotation( - request: protos.google.container.v1beta1.IStartIPRotationRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IStartIPRotationRequest|null|undefined, - {}|null|undefined>): void; - startIPRotation( - request: protos.google.container.v1beta1.IStartIPRotationRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IStartIPRotationRequest|null|undefined, - {}|null|undefined>): void; - startIPRotation( - request?: protos.google.container.v1beta1.IStartIPRotationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IStartIPRotationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IStartIPRotationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IStartIPRotationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.startIpRotation(request, options, callback); - } -/** - * Completes master IP rotation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster name) of the cluster to complete IP - * rotation. Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.complete_i_p_rotation.js - * region_tag:container_v1beta1_generated_ClusterManager_CompleteIPRotation_async - */ - completeIPRotation( - request?: protos.google.container.v1beta1.ICompleteIPRotationRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICompleteIPRotationRequest|undefined, {}|undefined - ]>; - completeIPRotation( - request: protos.google.container.v1beta1.ICompleteIPRotationRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICompleteIPRotationRequest|null|undefined, - {}|null|undefined>): void; - completeIPRotation( - request: protos.google.container.v1beta1.ICompleteIPRotationRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICompleteIPRotationRequest|null|undefined, - {}|null|undefined>): void; - completeIPRotation( - request?: protos.google.container.v1beta1.ICompleteIPRotationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICompleteIPRotationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICompleteIPRotationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICompleteIPRotationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.completeIpRotation(request, options, callback); - } -/** - * SetNodePoolSizeRequest sets the size of a node pool. The new size will be - * used for all replicas, including future replicas created by modifying - * {@link google.container.v1beta1.NodePool.locations|NodePool.locations}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to update. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Required. Deprecated. The name of the node pool to update. - * This field has been deprecated and replaced by the name field. - * @param {number} request.nodeCount - * Required. The desired node count for the pool. - * @param {string} request.name - * The name (project, location, cluster, node pool id) of the node pool to set - * size. - * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.set_node_pool_size.js - * region_tag:container_v1beta1_generated_ClusterManager_SetNodePoolSize_async - */ - setNodePoolSize( - request?: protos.google.container.v1beta1.ISetNodePoolSizeRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolSizeRequest|undefined, {}|undefined - ]>; - setNodePoolSize( - request: protos.google.container.v1beta1.ISetNodePoolSizeRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolSizeRequest|null|undefined, - {}|null|undefined>): void; - setNodePoolSize( - request: protos.google.container.v1beta1.ISetNodePoolSizeRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolSizeRequest|null|undefined, - {}|null|undefined>): void; - setNodePoolSize( - request?: protos.google.container.v1beta1.ISetNodePoolSizeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolSizeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolSizeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolSizeRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setNodePoolSize(request, options, callback); - } -/** - * Enables or disables Network Policy for a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the name field. - * @param {google.container.v1beta1.NetworkPolicy} request.networkPolicy - * Required. Configuration options for the NetworkPolicy feature. - * @param {string} request.name - * The name (project, location, cluster name) of the cluster to set networking - * policy. Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.set_network_policy.js - * region_tag:container_v1beta1_generated_ClusterManager_SetNetworkPolicy_async - */ - setNetworkPolicy( - request?: protos.google.container.v1beta1.ISetNetworkPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNetworkPolicyRequest|undefined, {}|undefined - ]>; - setNetworkPolicy( - request: protos.google.container.v1beta1.ISetNetworkPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNetworkPolicyRequest|null|undefined, - {}|null|undefined>): void; - setNetworkPolicy( - request: protos.google.container.v1beta1.ISetNetworkPolicyRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNetworkPolicyRequest|null|undefined, - {}|null|undefined>): void; - setNetworkPolicy( - request?: protos.google.container.v1beta1.ISetNetworkPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNetworkPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNetworkPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNetworkPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setNetworkPolicy(request, options, callback); - } -/** - * Sets the maintenance policy for a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * @param {string} request.zone - * Required. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. - * @param {string} request.clusterId - * Required. The name of the cluster to update. - * @param {google.container.v1beta1.MaintenancePolicy} request.maintenancePolicy - * Required. The maintenance policy to be set for the cluster. An empty field - * clears the existing maintenance policy. - * @param {string} request.name - * The name (project, location, cluster name) of the cluster to set - * maintenance policy. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.set_maintenance_policy.js - * region_tag:container_v1beta1_generated_ClusterManager_SetMaintenancePolicy_async - */ - setMaintenancePolicy( - request?: protos.google.container.v1beta1.ISetMaintenancePolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMaintenancePolicyRequest|undefined, {}|undefined - ]>; - setMaintenancePolicy( - request: protos.google.container.v1beta1.ISetMaintenancePolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMaintenancePolicyRequest|null|undefined, - {}|null|undefined>): void; - setMaintenancePolicy( - request: protos.google.container.v1beta1.ISetMaintenancePolicyRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMaintenancePolicyRequest|null|undefined, - {}|null|undefined>): void; - setMaintenancePolicy( - request?: protos.google.container.v1beta1.ISetMaintenancePolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMaintenancePolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMaintenancePolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMaintenancePolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setMaintenancePolicy(request, options, callback); - } -/** - * Checks the cluster compatibility with Autopilot mode, and returns a list of - * compatibility issues. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to retrieve. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.CheckAutopilotCompatibilityResponse | CheckAutopilotCompatibilityResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js - * region_tag:container_v1beta1_generated_ClusterManager_CheckAutopilotCompatibility_async - */ - checkAutopilotCompatibility( - request?: protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, - protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest|undefined, {}|undefined - ]>; - checkAutopilotCompatibility( - request: protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, - protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest|null|undefined, - {}|null|undefined>): void; - checkAutopilotCompatibility( - request: protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest, - callback: Callback< - protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, - protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest|null|undefined, - {}|null|undefined>): void; - checkAutopilotCompatibility( - request?: protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, - protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, - protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, - protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.checkAutopilotCompatibility(request, options, callback); - } -/** - * Fetches locations that offer Google Kubernetes Engine. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Contains the name of the resource requested. - * Specified in the format `projects/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.ListLocationsResponse | ListLocationsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.list_locations.js - * region_tag:container_v1beta1_generated_ClusterManager_ListLocations_async - */ - listLocations( - request?: protos.google.container.v1beta1.IListLocationsRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IListLocationsResponse, - protos.google.container.v1beta1.IListLocationsRequest|undefined, {}|undefined - ]>; - listLocations( - request: protos.google.container.v1beta1.IListLocationsRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IListLocationsResponse, - protos.google.container.v1beta1.IListLocationsRequest|null|undefined, - {}|null|undefined>): void; - listLocations( - request: protos.google.container.v1beta1.IListLocationsRequest, - callback: Callback< - protos.google.container.v1beta1.IListLocationsResponse, - protos.google.container.v1beta1.IListLocationsRequest|null|undefined, - {}|null|undefined>): void; - listLocations( - request?: protos.google.container.v1beta1.IListLocationsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IListLocationsResponse, - protos.google.container.v1beta1.IListLocationsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IListLocationsResponse, - protos.google.container.v1beta1.IListLocationsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IListLocationsResponse, - protos.google.container.v1beta1.IListLocationsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listLocations(request, options, callback); - } - - /** - * Lists subnetworks that can be used for creating clusters in a project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent project where subnetworks are usable. - * Specified in the format `projects/*`. - * @param {string} request.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. - * @param {number} request.pageSize - * 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) - * @param {string} request.pageToken - * Specifies a page token to use. Set this to the nextPageToken returned by - * previous list requests to get the next page of results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link google.container.v1beta1.UsableSubnetwork | UsableSubnetwork}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listUsableSubnetworksAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listUsableSubnetworks( - request?: protos.google.container.v1beta1.IListUsableSubnetworksRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IUsableSubnetwork[], - protos.google.container.v1beta1.IListUsableSubnetworksRequest|null, - protos.google.container.v1beta1.IListUsableSubnetworksResponse - ]>; - listUsableSubnetworks( - request: protos.google.container.v1beta1.IListUsableSubnetworksRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.container.v1beta1.IListUsableSubnetworksRequest, - protos.google.container.v1beta1.IListUsableSubnetworksResponse|null|undefined, - protos.google.container.v1beta1.IUsableSubnetwork>): void; - listUsableSubnetworks( - request: protos.google.container.v1beta1.IListUsableSubnetworksRequest, - callback: PaginationCallback< - protos.google.container.v1beta1.IListUsableSubnetworksRequest, - protos.google.container.v1beta1.IListUsableSubnetworksResponse|null|undefined, - protos.google.container.v1beta1.IUsableSubnetwork>): void; - listUsableSubnetworks( - request?: protos.google.container.v1beta1.IListUsableSubnetworksRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.container.v1beta1.IListUsableSubnetworksRequest, - protos.google.container.v1beta1.IListUsableSubnetworksResponse|null|undefined, - protos.google.container.v1beta1.IUsableSubnetwork>, - callback?: PaginationCallback< - protos.google.container.v1beta1.IListUsableSubnetworksRequest, - protos.google.container.v1beta1.IListUsableSubnetworksResponse|null|undefined, - protos.google.container.v1beta1.IUsableSubnetwork>): - Promise<[ - protos.google.container.v1beta1.IUsableSubnetwork[], - protos.google.container.v1beta1.IListUsableSubnetworksRequest|null, - protos.google.container.v1beta1.IListUsableSubnetworksResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listUsableSubnetworks(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent project where subnetworks are usable. - * Specified in the format `projects/*`. - * @param {string} request.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. - * @param {number} request.pageSize - * 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) - * @param {string} request.pageToken - * Specifies a page token to use. Set this to the nextPageToken returned by - * previous list requests to get the next page of results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link google.container.v1beta1.UsableSubnetwork | UsableSubnetwork} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listUsableSubnetworksAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listUsableSubnetworksStream( - request?: protos.google.container.v1beta1.IListUsableSubnetworksRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listUsableSubnetworks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listUsableSubnetworks.createStream( - this.innerApiCalls.listUsableSubnetworks as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listUsableSubnetworks`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent project where subnetworks are usable. - * Specified in the format `projects/*`. - * @param {string} request.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. - * @param {number} request.pageSize - * 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) - * @param {string} request.pageToken - * Specifies a page token to use. Set this to the nextPageToken returned by - * previous list requests to get the next page of results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * {@link google.container.v1beta1.UsableSubnetwork | UsableSubnetwork}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.list_usable_subnetworks.js - * region_tag:container_v1beta1_generated_ClusterManager_ListUsableSubnetworks_async - */ - listUsableSubnetworksAsync( - request?: protos.google.container.v1beta1.IListUsableSubnetworksRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listUsableSubnetworks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listUsableSubnetworks.asyncIterate( - this.innerApiCalls['listUsableSubnetworks'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.clusterManagerStub && !this._terminated) { - return this.clusterManagerStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client_config.json b/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client_config.json deleted file mode 100644 index 911352f9362..00000000000 --- a/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client_config.json +++ /dev/null @@ -1,198 +0,0 @@ -{ - "interfaces": { - "google.container.v1beta1.ClusterManager": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListClusters": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetCluster": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateCluster": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateCluster": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateNodePool": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetNodePoolAutoscaling": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetLoggingService": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetMonitoringService": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetAddonsConfig": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetLocations": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateMaster": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetMasterAuth": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteCluster": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListOperations": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetOperation": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CancelOperation": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetServerConfig": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetJSONWebKeys": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListNodePools": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetNodePool": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateNodePool": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteNodePool": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CompleteNodePoolUpgrade": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RollbackNodePoolUpgrade": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetNodePoolManagement": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetLabels": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetLegacyAbac": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "StartIPRotation": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CompleteIPRotation": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetNodePoolSize": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetNetworkPolicy": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetMaintenancePolicy": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListUsableSubnetworks": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CheckAutopilotCompatibility": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListLocations": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_proto_list.json b/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_proto_list.json deleted file mode 100644 index 7a594ccf698..00000000000 --- a/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_proto_list.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - "../../protos/google/container/v1beta1/cluster_service.proto" -] diff --git a/owl-bot-staging/google-container/v1beta1/src/v1beta1/gapic_metadata.json b/owl-bot-staging/google-container/v1beta1/src/v1beta1/gapic_metadata.json deleted file mode 100644 index 0278af900c2..00000000000 --- a/owl-bot-staging/google-container/v1beta1/src/v1beta1/gapic_metadata.json +++ /dev/null @@ -1,377 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.container.v1beta1", - "libraryPackage": "@google-cloud/container", - "services": { - "ClusterManager": { - "clients": { - "grpc": { - "libraryClient": "ClusterManagerClient", - "rpcs": { - "ListClusters": { - "methods": [ - "listClusters" - ] - }, - "GetCluster": { - "methods": [ - "getCluster" - ] - }, - "CreateCluster": { - "methods": [ - "createCluster" - ] - }, - "UpdateCluster": { - "methods": [ - "updateCluster" - ] - }, - "UpdateNodePool": { - "methods": [ - "updateNodePool" - ] - }, - "SetNodePoolAutoscaling": { - "methods": [ - "setNodePoolAutoscaling" - ] - }, - "SetLoggingService": { - "methods": [ - "setLoggingService" - ] - }, - "SetMonitoringService": { - "methods": [ - "setMonitoringService" - ] - }, - "SetAddonsConfig": { - "methods": [ - "setAddonsConfig" - ] - }, - "SetLocations": { - "methods": [ - "setLocations" - ] - }, - "UpdateMaster": { - "methods": [ - "updateMaster" - ] - }, - "SetMasterAuth": { - "methods": [ - "setMasterAuth" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "ListOperations": { - "methods": [ - "listOperations" - ] - }, - "GetOperation": { - "methods": [ - "getOperation" - ] - }, - "CancelOperation": { - "methods": [ - "cancelOperation" - ] - }, - "GetServerConfig": { - "methods": [ - "getServerConfig" - ] - }, - "GetJSONWebKeys": { - "methods": [ - "getJSONWebKeys" - ] - }, - "ListNodePools": { - "methods": [ - "listNodePools" - ] - }, - "GetNodePool": { - "methods": [ - "getNodePool" - ] - }, - "CreateNodePool": { - "methods": [ - "createNodePool" - ] - }, - "DeleteNodePool": { - "methods": [ - "deleteNodePool" - ] - }, - "CompleteNodePoolUpgrade": { - "methods": [ - "completeNodePoolUpgrade" - ] - }, - "RollbackNodePoolUpgrade": { - "methods": [ - "rollbackNodePoolUpgrade" - ] - }, - "SetNodePoolManagement": { - "methods": [ - "setNodePoolManagement" - ] - }, - "SetLabels": { - "methods": [ - "setLabels" - ] - }, - "SetLegacyAbac": { - "methods": [ - "setLegacyAbac" - ] - }, - "StartIPRotation": { - "methods": [ - "startIPRotation" - ] - }, - "CompleteIPRotation": { - "methods": [ - "completeIPRotation" - ] - }, - "SetNodePoolSize": { - "methods": [ - "setNodePoolSize" - ] - }, - "SetNetworkPolicy": { - "methods": [ - "setNetworkPolicy" - ] - }, - "SetMaintenancePolicy": { - "methods": [ - "setMaintenancePolicy" - ] - }, - "CheckAutopilotCompatibility": { - "methods": [ - "checkAutopilotCompatibility" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - }, - "ListUsableSubnetworks": { - "methods": [ - "listUsableSubnetworks", - "listUsableSubnetworksStream", - "listUsableSubnetworksAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "ClusterManagerClient", - "rpcs": { - "ListClusters": { - "methods": [ - "listClusters" - ] - }, - "GetCluster": { - "methods": [ - "getCluster" - ] - }, - "CreateCluster": { - "methods": [ - "createCluster" - ] - }, - "UpdateCluster": { - "methods": [ - "updateCluster" - ] - }, - "UpdateNodePool": { - "methods": [ - "updateNodePool" - ] - }, - "SetNodePoolAutoscaling": { - "methods": [ - "setNodePoolAutoscaling" - ] - }, - "SetLoggingService": { - "methods": [ - "setLoggingService" - ] - }, - "SetMonitoringService": { - "methods": [ - "setMonitoringService" - ] - }, - "SetAddonsConfig": { - "methods": [ - "setAddonsConfig" - ] - }, - "SetLocations": { - "methods": [ - "setLocations" - ] - }, - "UpdateMaster": { - "methods": [ - "updateMaster" - ] - }, - "SetMasterAuth": { - "methods": [ - "setMasterAuth" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "ListOperations": { - "methods": [ - "listOperations" - ] - }, - "GetOperation": { - "methods": [ - "getOperation" - ] - }, - "CancelOperation": { - "methods": [ - "cancelOperation" - ] - }, - "GetServerConfig": { - "methods": [ - "getServerConfig" - ] - }, - "GetJSONWebKeys": { - "methods": [ - "getJSONWebKeys" - ] - }, - "ListNodePools": { - "methods": [ - "listNodePools" - ] - }, - "GetNodePool": { - "methods": [ - "getNodePool" - ] - }, - "CreateNodePool": { - "methods": [ - "createNodePool" - ] - }, - "DeleteNodePool": { - "methods": [ - "deleteNodePool" - ] - }, - "CompleteNodePoolUpgrade": { - "methods": [ - "completeNodePoolUpgrade" - ] - }, - "RollbackNodePoolUpgrade": { - "methods": [ - "rollbackNodePoolUpgrade" - ] - }, - "SetNodePoolManagement": { - "methods": [ - "setNodePoolManagement" - ] - }, - "SetLabels": { - "methods": [ - "setLabels" - ] - }, - "SetLegacyAbac": { - "methods": [ - "setLegacyAbac" - ] - }, - "StartIPRotation": { - "methods": [ - "startIPRotation" - ] - }, - "CompleteIPRotation": { - "methods": [ - "completeIPRotation" - ] - }, - "SetNodePoolSize": { - "methods": [ - "setNodePoolSize" - ] - }, - "SetNetworkPolicy": { - "methods": [ - "setNetworkPolicy" - ] - }, - "SetMaintenancePolicy": { - "methods": [ - "setMaintenancePolicy" - ] - }, - "CheckAutopilotCompatibility": { - "methods": [ - "checkAutopilotCompatibility" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - }, - "ListUsableSubnetworks": { - "methods": [ - "listUsableSubnetworks", - "listUsableSubnetworksStream", - "listUsableSubnetworksAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-container/v1beta1/src/v1beta1/index.ts b/owl-bot-staging/google-container/v1beta1/src/v1beta1/index.ts deleted file mode 100644 index b1b39233034..00000000000 --- a/owl-bot-staging/google-container/v1beta1/src/v1beta1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {ClusterManagerClient} from './cluster_manager_client'; diff --git a/owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 1101d781caa..00000000000 --- a/owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const container = require('@google-cloud/container'); - -function main() { - const clusterManagerClient = new container.ClusterManagerClient(); -} - -main(); diff --git a/owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 6685b8649e6..00000000000 --- a/owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {ClusterManagerClient} from '@google-cloud/container'; - -// check that the client class type name can be used -function doStuffWithClusterManagerClient(client: ClusterManagerClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const clusterManagerClient = new ClusterManagerClient(); - doStuffWithClusterManagerClient(clusterManagerClient); -} - -main(); diff --git a/owl-bot-staging/google-container/v1beta1/system-test/install.ts b/owl-bot-staging/google-container/v1beta1/system-test/install.ts deleted file mode 100644 index c8f81b25a86..00000000000 --- a/owl-bot-staging/google-container/v1beta1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/google-container/v1beta1/test/gapic_cluster_manager_v1beta1.ts b/owl-bot-staging/google-container/v1beta1/test/gapic_cluster_manager_v1beta1.ts deleted file mode 100644 index 7f93f752f2c..00000000000 --- a/owl-bot-staging/google-container/v1beta1/test/gapic_cluster_manager_v1beta1.ts +++ /dev/null @@ -1,5238 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as clustermanagerModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta1.ClusterManagerClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = clustermanagerModule.v1beta1.ClusterManagerClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = clustermanagerModule.v1beta1.ClusterManagerClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = clustermanagerModule.v1beta1.ClusterManagerClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.clusterManagerStub, undefined); - await client.initialize(); - assert(client.clusterManagerStub); - }); - - it('has close method for the initialized client', done => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.clusterManagerStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.clusterManagerStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - }); - - describe('listClusters', () => { - it('invokes listClusters without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.ListClustersResponse() - ); - client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); - const [response] = await client.listClusters(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClusters without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.ListClustersResponse() - ); - client.innerApiCalls.listClusters = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listClusters( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IListClustersResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClusters with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listClusters = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listClusters(request), expectedError); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClusters with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['zone']); - request.zone = defaultValue3; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.listClusters(request), expectedError); - }); - }); - - describe('getCluster', () => { - it('invokes getCluster without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Cluster() - ); - client.innerApiCalls.getCluster = stubSimpleCall(expectedResponse); - const [response] = await client.getCluster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Cluster() - ); - client.innerApiCalls.getCluster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCluster( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.ICluster|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCluster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getCluster(request), expectedError); - }); - }); - - describe('createCluster', () => { - it('invokes createCluster without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.createCluster = stubSimpleCall(expectedResponse); - const [response] = await client.createCluster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.createCluster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCluster( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCluster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['zone']); - request.zone = defaultValue3; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createCluster(request), expectedError); - }); - }); - - describe('updateCluster', () => { - it('invokes updateCluster without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.UpdateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.updateCluster = stubSimpleCall(expectedResponse); - const [response] = await client.updateCluster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.UpdateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.updateCluster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateCluster( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.UpdateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCluster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.UpdateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateCluster(request), expectedError); - }); - }); - - describe('updateNodePool', () => { - it('invokes updateNodePool without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.UpdateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.updateNodePool = stubSimpleCall(expectedResponse); - const [response] = await client.updateNodePool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateNodePool without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.UpdateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.updateNodePool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateNodePool( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateNodePool with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.UpdateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateNodePool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateNodePool(request), expectedError); - const actualRequest = (client.innerApiCalls.updateNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateNodePool with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.UpdateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateNodePool(request), expectedError); - }); - }); - - describe('setNodePoolAutoscaling', () => { - it('invokes setNodePoolAutoscaling without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNodePoolAutoscalingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCall(expectedResponse); - const [response] = await client.setNodePoolAutoscaling(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolAutoscaling without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNodePoolAutoscalingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setNodePoolAutoscaling( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolAutoscaling with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNodePoolAutoscalingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setNodePoolAutoscaling(request), expectedError); - const actualRequest = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolAutoscaling with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNodePoolAutoscalingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setNodePoolAutoscaling(request), expectedError); - }); - }); - - describe('setLoggingService', () => { - it('invokes setLoggingService without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLoggingServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setLoggingService = stubSimpleCall(expectedResponse); - const [response] = await client.setLoggingService(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLoggingService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLoggingService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLoggingService without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLoggingServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setLoggingService = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setLoggingService( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLoggingService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLoggingService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLoggingService with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLoggingServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setLoggingService = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setLoggingService(request), expectedError); - const actualRequest = (client.innerApiCalls.setLoggingService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLoggingService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLoggingService with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLoggingServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setLoggingService(request), expectedError); - }); - }); - - describe('setMonitoringService', () => { - it('invokes setMonitoringService without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetMonitoringServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setMonitoringService = stubSimpleCall(expectedResponse); - const [response] = await client.setMonitoringService(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setMonitoringService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMonitoringService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMonitoringService without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetMonitoringServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setMonitoringService = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setMonitoringService( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setMonitoringService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMonitoringService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMonitoringService with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetMonitoringServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setMonitoringService = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setMonitoringService(request), expectedError); - const actualRequest = (client.innerApiCalls.setMonitoringService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMonitoringService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMonitoringService with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetMonitoringServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setMonitoringService(request), expectedError); - }); - }); - - describe('setAddonsConfig', () => { - it('invokes setAddonsConfig without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetAddonsConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setAddonsConfig = stubSimpleCall(expectedResponse); - const [response] = await client.setAddonsConfig(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setAddonsConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setAddonsConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setAddonsConfig without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetAddonsConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setAddonsConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setAddonsConfig( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setAddonsConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setAddonsConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setAddonsConfig with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetAddonsConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setAddonsConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setAddonsConfig(request), expectedError); - const actualRequest = (client.innerApiCalls.setAddonsConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setAddonsConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setAddonsConfig with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetAddonsConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setAddonsConfig(request), expectedError); - }); - }); - - describe('setLocations', () => { - it('invokes setLocations without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLocationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setLocations = stubSimpleCall(expectedResponse); - const [response] = await client.setLocations(request); - assert(stub.calledOnce); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLocations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLocations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLocations without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLocationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setLocations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setLocations( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert(stub.calledOnce); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLocations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLocations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLocations with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLocationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setLocations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setLocations(request), expectedError); - assert(stub.calledOnce); - const actualRequest = (client.innerApiCalls.setLocations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLocations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLocations with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLocationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setLocations(request), expectedError); - assert(stub.calledOnce); - }); - }); - - describe('updateMaster', () => { - it('invokes updateMaster without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.UpdateMasterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.updateMaster = stubSimpleCall(expectedResponse); - const [response] = await client.updateMaster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateMaster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateMaster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateMaster without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.UpdateMasterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.updateMaster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateMaster( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateMaster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateMaster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateMaster with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.UpdateMasterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateMaster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateMaster(request), expectedError); - const actualRequest = (client.innerApiCalls.updateMaster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateMaster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateMaster with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.UpdateMasterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateMaster(request), expectedError); - }); - }); - - describe('setMasterAuth', () => { - it('invokes setMasterAuth without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetMasterAuthRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setMasterAuth = stubSimpleCall(expectedResponse); - const [response] = await client.setMasterAuth(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setMasterAuth as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMasterAuth as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMasterAuth without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetMasterAuthRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setMasterAuth = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setMasterAuth( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setMasterAuth as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMasterAuth as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMasterAuth with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetMasterAuthRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setMasterAuth = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setMasterAuth(request), expectedError); - const actualRequest = (client.innerApiCalls.setMasterAuth as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMasterAuth as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMasterAuth with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetMasterAuthRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setMasterAuth(request), expectedError); - }); - }); - - describe('deleteCluster', () => { - it('invokes deleteCluster without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.deleteCluster = stubSimpleCall(expectedResponse); - const [response] = await client.deleteCluster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.deleteCluster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteCluster( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCluster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteCluster(request), expectedError); - }); - }); - - describe('listOperations', () => { - it('invokes listOperations without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.ListOperationsResponse() - ); - client.innerApiCalls.listOperations = stubSimpleCall(expectedResponse); - const [response] = await client.listOperations(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listOperations without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.ListOperationsResponse() - ); - client.innerApiCalls.listOperations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listOperations( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IListOperationsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listOperations with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listOperations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listOperations(request), expectedError); - const actualRequest = (client.innerApiCalls.listOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listOperations with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['zone']); - request.zone = defaultValue3; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.listOperations(request), expectedError); - }); - }); - - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.getOperation = stubSimpleCall(expectedResponse); - const [response] = await client.getOperation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getOperation without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.getOperation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getOperation( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getOperation with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getOperation(request), expectedError); - const actualRequest = (client.innerApiCalls.getOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getOperation with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getOperation(request), expectedError); - }); - }); - - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CancelOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.cancelOperation = stubSimpleCall(expectedResponse); - const [response] = await client.cancelOperation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelOperation without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CancelOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.cancelOperation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelOperation( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelOperation with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CancelOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelOperation(request), expectedError); - const actualRequest = (client.innerApiCalls.cancelOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelOperation with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CancelOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.cancelOperation(request), expectedError); - }); - }); - - describe('getServerConfig', () => { - it('invokes getServerConfig without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetServerConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.ServerConfig() - ); - client.innerApiCalls.getServerConfig = stubSimpleCall(expectedResponse); - const [response] = await client.getServerConfig(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getServerConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getServerConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getServerConfig without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetServerConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.ServerConfig() - ); - client.innerApiCalls.getServerConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getServerConfig( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IServerConfig|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getServerConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getServerConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getServerConfig with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetServerConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getServerConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getServerConfig(request), expectedError); - const actualRequest = (client.innerApiCalls.getServerConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getServerConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getServerConfig with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetServerConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['zone']); - request.zone = defaultValue3; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getServerConfig(request), expectedError); - }); - }); - - describe('getJSONWebKeys', () => { - it('invokes getJSONWebKeys without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetJSONWebKeysRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetJSONWebKeysRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.GetJSONWebKeysResponse() - ); - client.innerApiCalls.getJsonWebKeys = stubSimpleCall(expectedResponse); - const [response] = await client.getJSONWebKeys(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getJsonWebKeys as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJsonWebKeys as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJSONWebKeys without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetJSONWebKeysRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetJSONWebKeysRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.GetJSONWebKeysResponse() - ); - client.innerApiCalls.getJsonWebKeys = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getJSONWebKeys( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IGetJSONWebKeysResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getJsonWebKeys as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJsonWebKeys as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJSONWebKeys with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetJSONWebKeysRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetJSONWebKeysRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getJsonWebKeys = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getJSONWebKeys(request), expectedError); - const actualRequest = (client.innerApiCalls.getJsonWebKeys as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJsonWebKeys as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJSONWebKeys with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetJSONWebKeysRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetJSONWebKeysRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getJSONWebKeys(request), expectedError); - }); - }); - - describe('listNodePools', () => { - it('invokes listNodePools without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListNodePoolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.ListNodePoolsResponse() - ); - client.innerApiCalls.listNodePools = stubSimpleCall(expectedResponse); - const [response] = await client.listNodePools(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listNodePools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNodePools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNodePools without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListNodePoolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.ListNodePoolsResponse() - ); - client.innerApiCalls.listNodePools = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listNodePools( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IListNodePoolsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listNodePools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNodePools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNodePools with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListNodePoolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listNodePools = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listNodePools(request), expectedError); - const actualRequest = (client.innerApiCalls.listNodePools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNodePools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNodePools with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListNodePoolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.listNodePools(request), expectedError); - }); - }); - - describe('getNodePool', () => { - it('invokes getNodePool without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.NodePool() - ); - client.innerApiCalls.getNodePool = stubSimpleCall(expectedResponse); - const [response] = await client.getNodePool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNodePool without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.NodePool() - ); - client.innerApiCalls.getNodePool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getNodePool( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.INodePool|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNodePool with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getNodePool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getNodePool(request), expectedError); - const actualRequest = (client.innerApiCalls.getNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNodePool with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getNodePool(request), expectedError); - }); - }); - - describe('createNodePool', () => { - it('invokes createNodePool without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CreateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.createNodePool = stubSimpleCall(expectedResponse); - const [response] = await client.createNodePool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createNodePool without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CreateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.createNodePool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createNodePool( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createNodePool with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CreateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createNodePool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createNodePool(request), expectedError); - const actualRequest = (client.innerApiCalls.createNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createNodePool with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CreateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createNodePool(request), expectedError); - }); - }); - - describe('deleteNodePool', () => { - it('invokes deleteNodePool without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.DeleteNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.deleteNodePool = stubSimpleCall(expectedResponse); - const [response] = await client.deleteNodePool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteNodePool without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.DeleteNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.deleteNodePool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteNodePool( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteNodePool with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.DeleteNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteNodePool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteNodePool(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteNodePool with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.DeleteNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteNodePool(request), expectedError); - }); - }); - - describe('completeNodePoolUpgrade', () => { - it('invokes completeNodePoolUpgrade without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CompleteNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CompleteNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.completeNodePoolUpgrade = stubSimpleCall(expectedResponse); - const [response] = await client.completeNodePoolUpgrade(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes completeNodePoolUpgrade without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CompleteNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CompleteNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.completeNodePoolUpgrade = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.completeNodePoolUpgrade( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes completeNodePoolUpgrade with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CompleteNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CompleteNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.completeNodePoolUpgrade = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.completeNodePoolUpgrade(request), expectedError); - const actualRequest = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes completeNodePoolUpgrade with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CompleteNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CompleteNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.completeNodePoolUpgrade(request), expectedError); - }); - }); - - describe('rollbackNodePoolUpgrade', () => { - it('invokes rollbackNodePoolUpgrade without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.RollbackNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCall(expectedResponse); - const [response] = await client.rollbackNodePoolUpgrade(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollbackNodePoolUpgrade without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.RollbackNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.rollbackNodePoolUpgrade( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollbackNodePoolUpgrade with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.RollbackNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.rollbackNodePoolUpgrade(request), expectedError); - const actualRequest = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollbackNodePoolUpgrade with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.RollbackNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.rollbackNodePoolUpgrade(request), expectedError); - }); - }); - - describe('setNodePoolManagement', () => { - it('invokes setNodePoolManagement without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNodePoolManagementRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setNodePoolManagement = stubSimpleCall(expectedResponse); - const [response] = await client.setNodePoolManagement(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNodePoolManagement as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolManagement as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolManagement without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNodePoolManagementRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setNodePoolManagement = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setNodePoolManagement( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNodePoolManagement as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolManagement as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolManagement with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNodePoolManagementRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setNodePoolManagement = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setNodePoolManagement(request), expectedError); - const actualRequest = (client.innerApiCalls.setNodePoolManagement as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolManagement as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolManagement with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNodePoolManagementRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setNodePoolManagement(request), expectedError); - }); - }); - - describe('setLabels', () => { - it('invokes setLabels without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLabelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); - const [response] = await client.setLabels(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLabels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLabels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLabels without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLabelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setLabels = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setLabels( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLabels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLabels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLabels with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLabelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setLabels = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setLabels(request), expectedError); - const actualRequest = (client.innerApiCalls.setLabels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLabels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLabels with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLabelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setLabels(request), expectedError); - }); - }); - - describe('setLegacyAbac', () => { - it('invokes setLegacyAbac without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLegacyAbacRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setLegacyAbac = stubSimpleCall(expectedResponse); - const [response] = await client.setLegacyAbac(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLegacyAbac as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLegacyAbac as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLegacyAbac without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLegacyAbacRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setLegacyAbac = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setLegacyAbac( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLegacyAbac as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLegacyAbac as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLegacyAbac with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLegacyAbacRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setLegacyAbac = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setLegacyAbac(request), expectedError); - const actualRequest = (client.innerApiCalls.setLegacyAbac as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLegacyAbac as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLegacyAbac with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLegacyAbacRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setLegacyAbac(request), expectedError); - }); - }); - - describe('startIPRotation', () => { - it('invokes startIPRotation without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.StartIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.startIpRotation = stubSimpleCall(expectedResponse); - const [response] = await client.startIPRotation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.startIpRotation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.startIpRotation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes startIPRotation without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.StartIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.startIpRotation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.startIPRotation( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.startIpRotation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.startIpRotation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes startIPRotation with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.StartIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.startIpRotation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.startIPRotation(request), expectedError); - const actualRequest = (client.innerApiCalls.startIpRotation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.startIpRotation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes startIPRotation with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.StartIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.startIPRotation(request), expectedError); - }); - }); - - describe('completeIPRotation', () => { - it('invokes completeIPRotation without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CompleteIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.completeIpRotation = stubSimpleCall(expectedResponse); - const [response] = await client.completeIPRotation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.completeIpRotation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeIpRotation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes completeIPRotation without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CompleteIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.completeIpRotation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.completeIPRotation( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.completeIpRotation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeIpRotation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes completeIPRotation with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CompleteIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.completeIpRotation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.completeIPRotation(request), expectedError); - const actualRequest = (client.innerApiCalls.completeIpRotation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeIpRotation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes completeIPRotation with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CompleteIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.completeIPRotation(request), expectedError); - }); - }); - - describe('setNodePoolSize', () => { - it('invokes setNodePoolSize without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNodePoolSizeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setNodePoolSize = stubSimpleCall(expectedResponse); - const [response] = await client.setNodePoolSize(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNodePoolSize as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolSize as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolSize without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNodePoolSizeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setNodePoolSize = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setNodePoolSize( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNodePoolSize as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolSize as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolSize with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNodePoolSizeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setNodePoolSize = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setNodePoolSize(request), expectedError); - const actualRequest = (client.innerApiCalls.setNodePoolSize as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolSize as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolSize with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNodePoolSizeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setNodePoolSize(request), expectedError); - }); - }); - - describe('setNetworkPolicy', () => { - it('invokes setNetworkPolicy without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNetworkPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setNetworkPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.setNetworkPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNetworkPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNetworkPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNetworkPolicy without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNetworkPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setNetworkPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setNetworkPolicy( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNetworkPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNetworkPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNetworkPolicy with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNetworkPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setNetworkPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setNetworkPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.setNetworkPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNetworkPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNetworkPolicy with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNetworkPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setNetworkPolicy(request), expectedError); - }); - }); - - describe('setMaintenancePolicy', () => { - it('invokes setMaintenancePolicy without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetMaintenancePolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setMaintenancePolicy = stubSimpleCall(expectedResponse); - const [response] = await client.setMaintenancePolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setMaintenancePolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMaintenancePolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMaintenancePolicy without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetMaintenancePolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setMaintenancePolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setMaintenancePolicy( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setMaintenancePolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMaintenancePolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMaintenancePolicy with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetMaintenancePolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setMaintenancePolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setMaintenancePolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.setMaintenancePolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMaintenancePolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMaintenancePolicy with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetMaintenancePolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setMaintenancePolicy(request), expectedError); - }); - }); - - describe('checkAutopilotCompatibility', () => { - it('invokes checkAutopilotCompatibility without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CheckAutopilotCompatibilityRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CheckAutopilotCompatibilityRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.CheckAutopilotCompatibilityResponse() - ); - client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCall(expectedResponse); - const [response] = await client.checkAutopilotCompatibility(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkAutopilotCompatibility without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CheckAutopilotCompatibilityRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CheckAutopilotCompatibilityRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.CheckAutopilotCompatibilityResponse() - ); - client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.checkAutopilotCompatibility( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkAutopilotCompatibility with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CheckAutopilotCompatibilityRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CheckAutopilotCompatibilityRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkAutopilotCompatibility(request), expectedError); - const actualRequest = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkAutopilotCompatibility with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CheckAutopilotCompatibilityRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CheckAutopilotCompatibilityRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.checkAutopilotCompatibility(request), expectedError); - }); - }); - - describe('listLocations', () => { - it('invokes listLocations without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListLocationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListLocationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.ListLocationsResponse() - ); - client.innerApiCalls.listLocations = stubSimpleCall(expectedResponse); - const [response] = await client.listLocations(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listLocations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listLocations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listLocations without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListLocationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListLocationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.ListLocationsResponse() - ); - client.innerApiCalls.listLocations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listLocations( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IListLocationsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listLocations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listLocations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listLocations with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListLocationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListLocationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listLocations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listLocations(request), expectedError); - const actualRequest = (client.innerApiCalls.listLocations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listLocations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listLocations with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListLocationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListLocationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.listLocations(request), expectedError); - }); - }); - - describe('listUsableSubnetworks', () => { - it('invokes listUsableSubnetworks without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), - ]; - client.innerApiCalls.listUsableSubnetworks = stubSimpleCall(expectedResponse); - const [response] = await client.listUsableSubnetworks(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listUsableSubnetworks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUsableSubnetworks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listUsableSubnetworks without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), - ]; - client.innerApiCalls.listUsableSubnetworks = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listUsableSubnetworks( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IUsableSubnetwork[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listUsableSubnetworks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUsableSubnetworks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listUsableSubnetworks with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listUsableSubnetworks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listUsableSubnetworks(request), expectedError); - const actualRequest = (client.innerApiCalls.listUsableSubnetworks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUsableSubnetworks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listUsableSubnetworksStream without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), - ]; - client.descriptors.page.listUsableSubnetworks.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listUsableSubnetworksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.container.v1beta1.UsableSubnetwork[] = []; - stream.on('data', (response: protos.google.container.v1beta1.UsableSubnetwork) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listUsableSubnetworks, request)); - assert( - (client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listUsableSubnetworksStream with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listUsableSubnetworks.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listUsableSubnetworksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.container.v1beta1.UsableSubnetwork[] = []; - stream.on('data', (response: protos.google.container.v1beta1.UsableSubnetwork) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listUsableSubnetworks, request)); - assert( - (client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listUsableSubnetworks without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), - ]; - client.descriptors.page.listUsableSubnetworks.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.container.v1beta1.IUsableSubnetwork[] = []; - const iterable = client.listUsableSubnetworksAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listUsableSubnetworks with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listUsableSubnetworks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listUsableSubnetworksAsync(request); - await assert.rejects(async () => { - const responses: protos.google.container.v1beta1.IUsableSubnetwork[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); -}); diff --git a/owl-bot-staging/google-container/v1beta1/tsconfig.json b/owl-bot-staging/google-container/v1beta1/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-container/v1beta1/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/google-container/v1beta1/webpack.config.js b/owl-bot-staging/google-container/v1beta1/webpack.config.js deleted file mode 100644 index 9032271af9d..00000000000 --- a/owl-bot-staging/google-container/v1beta1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 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. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'ClusterManager', - filename: './cluster-manager.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/packages/google-container/protos/google/container/v1beta1/cluster_service.proto b/packages/google-container/protos/google/container/v1beta1/cluster_service.proto index cd3efee31f7..d35034ce072 100644 --- a/packages/google-container/protos/google/container/v1beta1/cluster_service.proto +++ b/packages/google-container/protos/google/container/v1beta1/cluster_service.proto @@ -922,7 +922,7 @@ message NodeNetworkConfig { // overprovisioning is disabled. PodCIDROverprovisionConfig pod_cidr_overprovision_config = 13; - // Output only. [Output only] The utilization of the IPv4 range for pod. + // Output only. [Output only] The utilization of the IPv4 range for the pod. // The ratio is Usage/[Total number of IPs in the secondary range], // Usage=numNodes*numZones*podIPsPerNode. double pod_ipv4_range_utilization = 16 @@ -1647,7 +1647,7 @@ message IPAllocationPolicy { [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. [Output only] The utilization of the cluster default IPv4 - // range for pod. The ratio is Usage/[Total number of IPs in the secondary + // range for the pod. The ratio is Usage/[Total number of IPs in the secondary // range], Usage=numNodes*numZones*podIPsPerNode. double default_pod_ipv4_range_utilization = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -4895,7 +4895,7 @@ message DNSConfig { // Use CloudDNS for DNS resolution. CLOUD_DNS = 2; - // Use KubeDNS for DNS resolution + // Use KubeDNS for DNS resolution. KUBE_DNS = 3; } @@ -5488,6 +5488,35 @@ message MonitoringConfig { // Enable Google Cloud Managed Service for Prometheus // in the cluster. ManagedPrometheusConfig managed_prometheus_config = 2; + + // Configuration of Advanced Datapath Observability features. + AdvancedDatapathObservabilityConfig advanced_datapath_observability_config = + 3; +} + +// AdvancedDatapathObservabilityConfig specifies configuration of observability +// features of advanced datapath. +message AdvancedDatapathObservabilityConfig { + // Supported Relay modes + enum RelayMode { + // Default value. This shouldn't be used. + RELAY_MODE_UNSPECIFIED = 0; + + // disabled + DISABLED = 1; + + // exposed via internal load balancer + INTERNAL_VPC_LB = 3; + + // exposed via external load balancer + EXTERNAL_LB = 4; + } + + // Expose flow metrics on nodes + bool enable_metrics = 1; + + // Method used to make Relay available + RelayMode relay_mode = 2; } // NodePoolLoggingConfig specifies logging configuration for nodepools. diff --git a/packages/google-container/protos/protos.d.ts b/packages/google-container/protos/protos.d.ts index af82e60ab03..d65adf502c7 100644 --- a/packages/google-container/protos/protos.d.ts +++ b/packages/google-container/protos/protos.d.ts @@ -42644,6 +42644,9 @@ export namespace google { /** MonitoringConfig managedPrometheusConfig */ managedPrometheusConfig?: (google.container.v1beta1.IManagedPrometheusConfig|null); + + /** MonitoringConfig advancedDatapathObservabilityConfig */ + advancedDatapathObservabilityConfig?: (google.container.v1beta1.IAdvancedDatapathObservabilityConfig|null); } /** Represents a MonitoringConfig. */ @@ -42661,6 +42664,9 @@ export namespace google { /** MonitoringConfig managedPrometheusConfig. */ public managedPrometheusConfig?: (google.container.v1beta1.IManagedPrometheusConfig|null); + /** MonitoringConfig advancedDatapathObservabilityConfig. */ + public advancedDatapathObservabilityConfig?: (google.container.v1beta1.IAdvancedDatapathObservabilityConfig|null); + /** * Creates a new MonitoringConfig instance using the specified properties. * @param [properties] Properties to set @@ -42739,6 +42745,120 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an AdvancedDatapathObservabilityConfig. */ + interface IAdvancedDatapathObservabilityConfig { + + /** AdvancedDatapathObservabilityConfig enableMetrics */ + enableMetrics?: (boolean|null); + + /** AdvancedDatapathObservabilityConfig relayMode */ + relayMode?: (google.container.v1beta1.AdvancedDatapathObservabilityConfig.RelayMode|keyof typeof google.container.v1beta1.AdvancedDatapathObservabilityConfig.RelayMode|null); + } + + /** Represents an AdvancedDatapathObservabilityConfig. */ + class AdvancedDatapathObservabilityConfig implements IAdvancedDatapathObservabilityConfig { + + /** + * Constructs a new AdvancedDatapathObservabilityConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.container.v1beta1.IAdvancedDatapathObservabilityConfig); + + /** AdvancedDatapathObservabilityConfig enableMetrics. */ + public enableMetrics: boolean; + + /** AdvancedDatapathObservabilityConfig relayMode. */ + public relayMode: (google.container.v1beta1.AdvancedDatapathObservabilityConfig.RelayMode|keyof typeof google.container.v1beta1.AdvancedDatapathObservabilityConfig.RelayMode); + + /** + * Creates a new AdvancedDatapathObservabilityConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AdvancedDatapathObservabilityConfig instance + */ + public static create(properties?: google.container.v1beta1.IAdvancedDatapathObservabilityConfig): google.container.v1beta1.AdvancedDatapathObservabilityConfig; + + /** + * Encodes the specified AdvancedDatapathObservabilityConfig message. Does not implicitly {@link google.container.v1beta1.AdvancedDatapathObservabilityConfig.verify|verify} messages. + * @param message AdvancedDatapathObservabilityConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.container.v1beta1.IAdvancedDatapathObservabilityConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AdvancedDatapathObservabilityConfig message, length delimited. Does not implicitly {@link google.container.v1beta1.AdvancedDatapathObservabilityConfig.verify|verify} messages. + * @param message AdvancedDatapathObservabilityConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.container.v1beta1.IAdvancedDatapathObservabilityConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AdvancedDatapathObservabilityConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AdvancedDatapathObservabilityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.container.v1beta1.AdvancedDatapathObservabilityConfig; + + /** + * Decodes an AdvancedDatapathObservabilityConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AdvancedDatapathObservabilityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.container.v1beta1.AdvancedDatapathObservabilityConfig; + + /** + * Verifies an AdvancedDatapathObservabilityConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AdvancedDatapathObservabilityConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AdvancedDatapathObservabilityConfig + */ + public static fromObject(object: { [k: string]: any }): google.container.v1beta1.AdvancedDatapathObservabilityConfig; + + /** + * Creates a plain object from an AdvancedDatapathObservabilityConfig message. Also converts values to other types if specified. + * @param message AdvancedDatapathObservabilityConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.container.v1beta1.AdvancedDatapathObservabilityConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AdvancedDatapathObservabilityConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AdvancedDatapathObservabilityConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AdvancedDatapathObservabilityConfig { + + /** RelayMode enum. */ + enum RelayMode { + RELAY_MODE_UNSPECIFIED = 0, + DISABLED = 1, + INTERNAL_VPC_LB = 3, + EXTERNAL_LB = 4 + } + } + /** Properties of a NodePoolLoggingConfig. */ interface INodePoolLoggingConfig { diff --git a/packages/google-container/protos/protos.js b/packages/google-container/protos/protos.js index a7dc34fdd76..6b7a659810d 100644 --- a/packages/google-container/protos/protos.js +++ b/packages/google-container/protos/protos.js @@ -108201,6 +108201,7 @@ * @interface IMonitoringConfig * @property {google.container.v1beta1.IMonitoringComponentConfig|null} [componentConfig] MonitoringConfig componentConfig * @property {google.container.v1beta1.IManagedPrometheusConfig|null} [managedPrometheusConfig] MonitoringConfig managedPrometheusConfig + * @property {google.container.v1beta1.IAdvancedDatapathObservabilityConfig|null} [advancedDatapathObservabilityConfig] MonitoringConfig advancedDatapathObservabilityConfig */ /** @@ -108234,6 +108235,14 @@ */ MonitoringConfig.prototype.managedPrometheusConfig = null; + /** + * MonitoringConfig advancedDatapathObservabilityConfig. + * @member {google.container.v1beta1.IAdvancedDatapathObservabilityConfig|null|undefined} advancedDatapathObservabilityConfig + * @memberof google.container.v1beta1.MonitoringConfig + * @instance + */ + MonitoringConfig.prototype.advancedDatapathObservabilityConfig = null; + /** * Creates a new MonitoringConfig instance using the specified properties. * @function create @@ -108262,6 +108271,8 @@ $root.google.container.v1beta1.MonitoringComponentConfig.encode(message.componentConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.managedPrometheusConfig != null && Object.hasOwnProperty.call(message, "managedPrometheusConfig")) $root.google.container.v1beta1.ManagedPrometheusConfig.encode(message.managedPrometheusConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.advancedDatapathObservabilityConfig != null && Object.hasOwnProperty.call(message, "advancedDatapathObservabilityConfig")) + $root.google.container.v1beta1.AdvancedDatapathObservabilityConfig.encode(message.advancedDatapathObservabilityConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -108304,6 +108315,10 @@ message.managedPrometheusConfig = $root.google.container.v1beta1.ManagedPrometheusConfig.decode(reader, reader.uint32()); break; } + case 3: { + message.advancedDatapathObservabilityConfig = $root.google.container.v1beta1.AdvancedDatapathObservabilityConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -108349,6 +108364,11 @@ if (error) return "managedPrometheusConfig." + error; } + if (message.advancedDatapathObservabilityConfig != null && message.hasOwnProperty("advancedDatapathObservabilityConfig")) { + var error = $root.google.container.v1beta1.AdvancedDatapathObservabilityConfig.verify(message.advancedDatapathObservabilityConfig); + if (error) + return "advancedDatapathObservabilityConfig." + error; + } return null; }; @@ -108374,6 +108394,11 @@ throw TypeError(".google.container.v1beta1.MonitoringConfig.managedPrometheusConfig: object expected"); message.managedPrometheusConfig = $root.google.container.v1beta1.ManagedPrometheusConfig.fromObject(object.managedPrometheusConfig); } + if (object.advancedDatapathObservabilityConfig != null) { + if (typeof object.advancedDatapathObservabilityConfig !== "object") + throw TypeError(".google.container.v1beta1.MonitoringConfig.advancedDatapathObservabilityConfig: object expected"); + message.advancedDatapathObservabilityConfig = $root.google.container.v1beta1.AdvancedDatapathObservabilityConfig.fromObject(object.advancedDatapathObservabilityConfig); + } return message; }; @@ -108393,11 +108418,14 @@ if (options.defaults) { object.componentConfig = null; object.managedPrometheusConfig = null; + object.advancedDatapathObservabilityConfig = null; } if (message.componentConfig != null && message.hasOwnProperty("componentConfig")) object.componentConfig = $root.google.container.v1beta1.MonitoringComponentConfig.toObject(message.componentConfig, options); if (message.managedPrometheusConfig != null && message.hasOwnProperty("managedPrometheusConfig")) object.managedPrometheusConfig = $root.google.container.v1beta1.ManagedPrometheusConfig.toObject(message.managedPrometheusConfig, options); + if (message.advancedDatapathObservabilityConfig != null && message.hasOwnProperty("advancedDatapathObservabilityConfig")) + object.advancedDatapathObservabilityConfig = $root.google.container.v1beta1.AdvancedDatapathObservabilityConfig.toObject(message.advancedDatapathObservabilityConfig, options); return object; }; @@ -108430,6 +108458,280 @@ return MonitoringConfig; })(); + v1beta1.AdvancedDatapathObservabilityConfig = (function() { + + /** + * Properties of an AdvancedDatapathObservabilityConfig. + * @memberof google.container.v1beta1 + * @interface IAdvancedDatapathObservabilityConfig + * @property {boolean|null} [enableMetrics] AdvancedDatapathObservabilityConfig enableMetrics + * @property {google.container.v1beta1.AdvancedDatapathObservabilityConfig.RelayMode|null} [relayMode] AdvancedDatapathObservabilityConfig relayMode + */ + + /** + * Constructs a new AdvancedDatapathObservabilityConfig. + * @memberof google.container.v1beta1 + * @classdesc Represents an AdvancedDatapathObservabilityConfig. + * @implements IAdvancedDatapathObservabilityConfig + * @constructor + * @param {google.container.v1beta1.IAdvancedDatapathObservabilityConfig=} [properties] Properties to set + */ + function AdvancedDatapathObservabilityConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AdvancedDatapathObservabilityConfig enableMetrics. + * @member {boolean} enableMetrics + * @memberof google.container.v1beta1.AdvancedDatapathObservabilityConfig + * @instance + */ + AdvancedDatapathObservabilityConfig.prototype.enableMetrics = false; + + /** + * AdvancedDatapathObservabilityConfig relayMode. + * @member {google.container.v1beta1.AdvancedDatapathObservabilityConfig.RelayMode} relayMode + * @memberof google.container.v1beta1.AdvancedDatapathObservabilityConfig + * @instance + */ + AdvancedDatapathObservabilityConfig.prototype.relayMode = 0; + + /** + * Creates a new AdvancedDatapathObservabilityConfig instance using the specified properties. + * @function create + * @memberof google.container.v1beta1.AdvancedDatapathObservabilityConfig + * @static + * @param {google.container.v1beta1.IAdvancedDatapathObservabilityConfig=} [properties] Properties to set + * @returns {google.container.v1beta1.AdvancedDatapathObservabilityConfig} AdvancedDatapathObservabilityConfig instance + */ + AdvancedDatapathObservabilityConfig.create = function create(properties) { + return new AdvancedDatapathObservabilityConfig(properties); + }; + + /** + * Encodes the specified AdvancedDatapathObservabilityConfig message. Does not implicitly {@link google.container.v1beta1.AdvancedDatapathObservabilityConfig.verify|verify} messages. + * @function encode + * @memberof google.container.v1beta1.AdvancedDatapathObservabilityConfig + * @static + * @param {google.container.v1beta1.IAdvancedDatapathObservabilityConfig} message AdvancedDatapathObservabilityConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdvancedDatapathObservabilityConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableMetrics != null && Object.hasOwnProperty.call(message, "enableMetrics")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableMetrics); + if (message.relayMode != null && Object.hasOwnProperty.call(message, "relayMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.relayMode); + return writer; + }; + + /** + * Encodes the specified AdvancedDatapathObservabilityConfig message, length delimited. Does not implicitly {@link google.container.v1beta1.AdvancedDatapathObservabilityConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.container.v1beta1.AdvancedDatapathObservabilityConfig + * @static + * @param {google.container.v1beta1.IAdvancedDatapathObservabilityConfig} message AdvancedDatapathObservabilityConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdvancedDatapathObservabilityConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AdvancedDatapathObservabilityConfig message from the specified reader or buffer. + * @function decode + * @memberof google.container.v1beta1.AdvancedDatapathObservabilityConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.container.v1beta1.AdvancedDatapathObservabilityConfig} AdvancedDatapathObservabilityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdvancedDatapathObservabilityConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.container.v1beta1.AdvancedDatapathObservabilityConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enableMetrics = reader.bool(); + break; + } + case 2: { + message.relayMode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AdvancedDatapathObservabilityConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.container.v1beta1.AdvancedDatapathObservabilityConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.container.v1beta1.AdvancedDatapathObservabilityConfig} AdvancedDatapathObservabilityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdvancedDatapathObservabilityConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AdvancedDatapathObservabilityConfig message. + * @function verify + * @memberof google.container.v1beta1.AdvancedDatapathObservabilityConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AdvancedDatapathObservabilityConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableMetrics != null && message.hasOwnProperty("enableMetrics")) + if (typeof message.enableMetrics !== "boolean") + return "enableMetrics: boolean expected"; + if (message.relayMode != null && message.hasOwnProperty("relayMode")) + switch (message.relayMode) { + default: + return "relayMode: enum value expected"; + case 0: + case 1: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates an AdvancedDatapathObservabilityConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.container.v1beta1.AdvancedDatapathObservabilityConfig + * @static + * @param {Object.} object Plain object + * @returns {google.container.v1beta1.AdvancedDatapathObservabilityConfig} AdvancedDatapathObservabilityConfig + */ + AdvancedDatapathObservabilityConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.container.v1beta1.AdvancedDatapathObservabilityConfig) + return object; + var message = new $root.google.container.v1beta1.AdvancedDatapathObservabilityConfig(); + if (object.enableMetrics != null) + message.enableMetrics = Boolean(object.enableMetrics); + switch (object.relayMode) { + default: + if (typeof object.relayMode === "number") { + message.relayMode = object.relayMode; + break; + } + break; + case "RELAY_MODE_UNSPECIFIED": + case 0: + message.relayMode = 0; + break; + case "DISABLED": + case 1: + message.relayMode = 1; + break; + case "INTERNAL_VPC_LB": + case 3: + message.relayMode = 3; + break; + case "EXTERNAL_LB": + case 4: + message.relayMode = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from an AdvancedDatapathObservabilityConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.container.v1beta1.AdvancedDatapathObservabilityConfig + * @static + * @param {google.container.v1beta1.AdvancedDatapathObservabilityConfig} message AdvancedDatapathObservabilityConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AdvancedDatapathObservabilityConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enableMetrics = false; + object.relayMode = options.enums === String ? "RELAY_MODE_UNSPECIFIED" : 0; + } + if (message.enableMetrics != null && message.hasOwnProperty("enableMetrics")) + object.enableMetrics = message.enableMetrics; + if (message.relayMode != null && message.hasOwnProperty("relayMode")) + object.relayMode = options.enums === String ? $root.google.container.v1beta1.AdvancedDatapathObservabilityConfig.RelayMode[message.relayMode] === undefined ? message.relayMode : $root.google.container.v1beta1.AdvancedDatapathObservabilityConfig.RelayMode[message.relayMode] : message.relayMode; + return object; + }; + + /** + * Converts this AdvancedDatapathObservabilityConfig to JSON. + * @function toJSON + * @memberof google.container.v1beta1.AdvancedDatapathObservabilityConfig + * @instance + * @returns {Object.} JSON object + */ + AdvancedDatapathObservabilityConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AdvancedDatapathObservabilityConfig + * @function getTypeUrl + * @memberof google.container.v1beta1.AdvancedDatapathObservabilityConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AdvancedDatapathObservabilityConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.container.v1beta1.AdvancedDatapathObservabilityConfig"; + }; + + /** + * RelayMode enum. + * @name google.container.v1beta1.AdvancedDatapathObservabilityConfig.RelayMode + * @enum {number} + * @property {number} RELAY_MODE_UNSPECIFIED=0 RELAY_MODE_UNSPECIFIED value + * @property {number} DISABLED=1 DISABLED value + * @property {number} INTERNAL_VPC_LB=3 INTERNAL_VPC_LB value + * @property {number} EXTERNAL_LB=4 EXTERNAL_LB value + */ + AdvancedDatapathObservabilityConfig.RelayMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RELAY_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DISABLED"] = 1; + values[valuesById[3] = "INTERNAL_VPC_LB"] = 3; + values[valuesById[4] = "EXTERNAL_LB"] = 4; + return values; + })(); + + return AdvancedDatapathObservabilityConfig; + })(); + v1beta1.NodePoolLoggingConfig = (function() { /** diff --git a/packages/google-container/protos/protos.json b/packages/google-container/protos/protos.json index 7dbcef08966..d6ee74fba57 100644 --- a/packages/google-container/protos/protos.json +++ b/packages/google-container/protos/protos.json @@ -11392,6 +11392,32 @@ "managedPrometheusConfig": { "type": "ManagedPrometheusConfig", "id": 2 + }, + "advancedDatapathObservabilityConfig": { + "type": "AdvancedDatapathObservabilityConfig", + "id": 3 + } + } + }, + "AdvancedDatapathObservabilityConfig": { + "fields": { + "enableMetrics": { + "type": "bool", + "id": 1 + }, + "relayMode": { + "type": "RelayMode", + "id": 2 + } + }, + "nested": { + "RelayMode": { + "values": { + "RELAY_MODE_UNSPECIFIED": 0, + "DISABLED": 1, + "INTERNAL_VPC_LB": 3, + "EXTERNAL_LB": 4 + } } } }, From 9c346ffdbf763d93c8df1c3c9163d47abeb15c4c Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 12 Jul 2023 19:55:44 +0000 Subject: [PATCH 3/4] feat: add advanced_datapath_observability_config to monitoring_config -- feat: add a Pod IP Utilization API Users can use `cluster describe` command to check the Pod IP ranges utilizations consumed by all the node pools within the same cluster. This percentage can be seen at cluster default Pod range, additional Pod ranges, and node pool level Pod ranges. PiperOrigin-RevId: 547521835 Source-Link: https://github.com/googleapis/googleapis/commit/1bd12d77dee2fc6e9c51fe5999c92e814e78b4e3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/cbb5fcc1aad9d30d9f51f5baf05cdd2da7b6da9c Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNvbnRhaW5lci8uT3dsQm90LnlhbWwiLCJoIjoiY2JiNWZjYzFhYWQ5ZDMwZDlmNTFmNWJhZjA1Y2RkMmRhN2I2ZGE5YyJ9 --- .../google-container/v1/.eslintignore | 7 + .../google-container/v1/.eslintrc.json | 3 + .../google-container/v1/.gitignore | 14 + owl-bot-staging/google-container/v1/.jsdoc.js | 55 + .../google-container/v1/.mocharc.js | 33 + .../google-container/v1/.prettierrc.js | 22 + owl-bot-staging/google-container/v1/README.md | 1 + .../v1/linkinator.config.json | 16 + .../google-container/v1/package.json | 64 + .../google/container/v1/cluster_service.proto | 5156 +++++++++++++++ .../v1/cluster_manager.cancel_operation.js | 61 + ...r_manager.check_autopilot_compatibility.js | 61 + .../cluster_manager.complete_i_p_rotation.js | 61 + ...ster_manager.complete_node_pool_upgrade.js | 62 + .../v1/cluster_manager.create_cluster.js | 67 + .../v1/cluster_manager.create_node_pool.js | 67 + .../v1/cluster_manager.delete_cluster.js | 61 + .../v1/cluster_manager.delete_node_pool.js | 62 + .../v1/cluster_manager.get_cluster.js | 61 + .../cluster_manager.get_j_s_o_n_web_keys.js | 61 + .../v1/cluster_manager.get_node_pool.js | 62 + .../v1/cluster_manager.get_operation.js | 61 + .../v1/cluster_manager.get_server_config.js | 61 + .../v1/cluster_manager.list_clusters.js | 62 + .../v1/cluster_manager.list_node_pools.js | 61 + .../v1/cluster_manager.list_operations.js | 62 + ...cluster_manager.list_usable_subnetworks.js | 82 + ...ster_manager.rollback_node_pool_upgrade.js | 67 + .../v1/cluster_manager.set_addons_config.js | 67 + .../v1/cluster_manager.set_labels.js | 76 + .../v1/cluster_manager.set_legacy_abac.js | 66 + .../v1/cluster_manager.set_locations.js | 71 + .../v1/cluster_manager.set_logging_service.js | 74 + .../cluster_manager.set_maintenance_policy.js | 86 + .../v1/cluster_manager.set_master_auth.js | 71 + .../cluster_manager.set_monitoring_service.js | 74 + .../v1/cluster_manager.set_network_policy.js | 66 + ...uster_manager.set_node_pool_autoscaling.js | 67 + ...luster_manager.set_node_pool_management.js | 67 + .../v1/cluster_manager.set_node_pool_size.js | 67 + .../v1/cluster_manager.start_i_p_rotation.js | 65 + .../v1/cluster_manager.update_cluster.js | 66 + .../v1/cluster_manager.update_master.js | 73 + .../v1/cluster_manager.update_node_pool.js | 164 + .../snippet_metadata.google.container.v1.json | 1915 ++++++ .../google-container/v1/src/index.ts | 25 + .../v1/src/v1/cluster_manager_client.ts | 3551 +++++++++++ .../src/v1/cluster_manager_client_config.json | 192 + .../v1/src/v1/cluster_manager_proto_list.json | 3 + .../v1/src/v1/gapic_metadata.json | 367 ++ .../google-container/v1/src/v1/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../v1/system-test/install.ts | 49 + .../v1/test/gapic_cluster_manager_v1.ts | 5130 +++++++++++++++ .../google-container/v1/tsconfig.json | 19 + .../google-container/v1/webpack.config.js | 64 + .../google-container/v1beta1/.eslintignore | 7 + .../google-container/v1beta1/.eslintrc.json | 3 + .../google-container/v1beta1/.gitignore | 14 + .../google-container/v1beta1/.jsdoc.js | 55 + .../google-container/v1beta1/.mocharc.js | 33 + .../google-container/v1beta1/.prettierrc.js | 22 + .../google-container/v1beta1/README.md | 1 + .../v1beta1/linkinator.config.json | 16 + .../google-container/v1beta1/package.json | 64 + .../container/v1beta1/cluster_service.proto | 5617 +++++++++++++++++ .../cluster_manager.cancel_operation.js | 64 + ...r_manager.check_autopilot_compatibility.js | 61 + .../cluster_manager.complete_i_p_rotation.js | 64 + ...ster_manager.complete_node_pool_upgrade.js | 62 + .../v1beta1/cluster_manager.create_cluster.js | 69 + .../cluster_manager.create_node_pool.js | 70 + .../v1beta1/cluster_manager.delete_cluster.js | 64 + .../cluster_manager.delete_node_pool.js | 66 + .../v1beta1/cluster_manager.get_cluster.js | 64 + .../cluster_manager.get_j_s_o_n_web_keys.js | 61 + .../v1beta1/cluster_manager.get_node_pool.js | 66 + .../v1beta1/cluster_manager.get_operation.js | 64 + .../cluster_manager.get_server_config.js | 63 + .../v1beta1/cluster_manager.list_clusters.js | 64 + .../v1beta1/cluster_manager.list_locations.js | 62 + .../cluster_manager.list_node_pools.js | 64 + .../cluster_manager.list_operations.js | 64 + ...cluster_manager.list_usable_subnetworks.js | 83 + ...ster_manager.rollback_node_pool_upgrade.js | 71 + .../cluster_manager.set_addons_config.js | 70 + .../v1beta1/cluster_manager.set_labels.js | 79 + .../cluster_manager.set_legacy_abac.js | 69 + .../v1beta1/cluster_manager.set_locations.js | 74 + .../cluster_manager.set_logging_service.js | 77 + .../cluster_manager.set_maintenance_policy.js | 86 + .../cluster_manager.set_master_auth.js | 74 + .../cluster_manager.set_monitoring_service.js | 77 + .../cluster_manager.set_network_policy.js | 69 + ...uster_manager.set_node_pool_autoscaling.js | 71 + ...luster_manager.set_node_pool_management.js | 71 + .../cluster_manager.set_node_pool_size.js | 71 + .../cluster_manager.start_i_p_rotation.js | 68 + .../v1beta1/cluster_manager.update_cluster.js | 69 + .../v1beta1/cluster_manager.update_master.js | 76 + .../cluster_manager.update_node_pool.js | 168 + ...pet_metadata.google.container.v1beta1.json | 1955 ++++++ .../google-container/v1beta1/src/index.ts | 25 + .../src/v1beta1/cluster_manager_client.ts | 3623 +++++++++++ .../cluster_manager_client_config.json | 198 + .../v1beta1/cluster_manager_proto_list.json | 3 + .../v1beta1/src/v1beta1/gapic_metadata.json | 377 ++ .../v1beta1/src/v1beta1/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../v1beta1/system-test/install.ts | 49 + .../test/gapic_cluster_manager_v1beta1.ts | 5238 +++++++++++++++ .../google-container/v1beta1/tsconfig.json | 19 + .../v1beta1/webpack.config.js | 64 + 115 files changed, 39102 insertions(+) create mode 100644 owl-bot-staging/google-container/v1/.eslintignore create mode 100644 owl-bot-staging/google-container/v1/.eslintrc.json create mode 100644 owl-bot-staging/google-container/v1/.gitignore create mode 100644 owl-bot-staging/google-container/v1/.jsdoc.js create mode 100644 owl-bot-staging/google-container/v1/.mocharc.js create mode 100644 owl-bot-staging/google-container/v1/.prettierrc.js create mode 100644 owl-bot-staging/google-container/v1/README.md create mode 100644 owl-bot-staging/google-container/v1/linkinator.config.json create mode 100644 owl-bot-staging/google-container/v1/package.json create mode 100644 owl-bot-staging/google-container/v1/protos/google/container/v1/cluster_service.proto create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.cancel_operation.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_i_p_rotation.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_cluster.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_node_pool.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_cluster.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_node_pool.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_cluster.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_j_s_o_n_web_keys.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_node_pool.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_operation.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_server_config.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_clusters.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_node_pools.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_operations.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_usable_subnetworks.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.rollback_node_pool_upgrade.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_addons_config.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_labels.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_legacy_abac.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_locations.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_logging_service.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_maintenance_policy.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_master_auth.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_monitoring_service.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_network_policy.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_autoscaling.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_management.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_size.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.start_i_p_rotation.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_cluster.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_master.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_node_pool.js create mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/snippet_metadata.google.container.v1.json create mode 100644 owl-bot-staging/google-container/v1/src/index.ts create mode 100644 owl-bot-staging/google-container/v1/src/v1/cluster_manager_client.ts create mode 100644 owl-bot-staging/google-container/v1/src/v1/cluster_manager_client_config.json create mode 100644 owl-bot-staging/google-container/v1/src/v1/cluster_manager_proto_list.json create mode 100644 owl-bot-staging/google-container/v1/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-container/v1/src/v1/index.ts create mode 100644 owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-container/v1/system-test/install.ts create mode 100644 owl-bot-staging/google-container/v1/test/gapic_cluster_manager_v1.ts create mode 100644 owl-bot-staging/google-container/v1/tsconfig.json create mode 100644 owl-bot-staging/google-container/v1/webpack.config.js create mode 100644 owl-bot-staging/google-container/v1beta1/.eslintignore create mode 100644 owl-bot-staging/google-container/v1beta1/.eslintrc.json create mode 100644 owl-bot-staging/google-container/v1beta1/.gitignore create mode 100644 owl-bot-staging/google-container/v1beta1/.jsdoc.js create mode 100644 owl-bot-staging/google-container/v1beta1/.mocharc.js create mode 100644 owl-bot-staging/google-container/v1beta1/.prettierrc.js create mode 100644 owl-bot-staging/google-container/v1beta1/README.md create mode 100644 owl-bot-staging/google-container/v1beta1/linkinator.config.json create mode 100644 owl-bot-staging/google-container/v1beta1/package.json create mode 100644 owl-bot-staging/google-container/v1beta1/protos/google/container/v1beta1/cluster_service.proto create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.cancel_operation.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_i_p_rotation.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_node_pool_upgrade.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_cluster.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_node_pool.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_cluster.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_node_pool.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_cluster.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_j_s_o_n_web_keys.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_node_pool.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_operation.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_server_config.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_clusters.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_locations.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_node_pools.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_operations.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_usable_subnetworks.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.rollback_node_pool_upgrade.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_addons_config.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_labels.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_legacy_abac.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_locations.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_logging_service.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_maintenance_policy.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_master_auth.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_monitoring_service.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_network_policy.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_autoscaling.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_management.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_size.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.start_i_p_rotation.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_cluster.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_master.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_node_pool.js create mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json create mode 100644 owl-bot-staging/google-container/v1beta1/src/index.ts create mode 100644 owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client.ts create mode 100644 owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client_config.json create mode 100644 owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_proto_list.json create mode 100644 owl-bot-staging/google-container/v1beta1/src/v1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-container/v1beta1/src/v1beta1/index.ts create mode 100644 owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-container/v1beta1/system-test/install.ts create mode 100644 owl-bot-staging/google-container/v1beta1/test/gapic_cluster_manager_v1beta1.ts create mode 100644 owl-bot-staging/google-container/v1beta1/tsconfig.json create mode 100644 owl-bot-staging/google-container/v1beta1/webpack.config.js diff --git a/owl-bot-staging/google-container/v1/.eslintignore b/owl-bot-staging/google-container/v1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-container/v1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-container/v1/.eslintrc.json b/owl-bot-staging/google-container/v1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-container/v1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-container/v1/.gitignore b/owl-bot-staging/google-container/v1/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-container/v1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-container/v1/.jsdoc.js b/owl-bot-staging/google-container/v1/.jsdoc.js new file mode 100644 index 00000000000..6dc18e81193 --- /dev/null +++ b/owl-bot-staging/google-container/v1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2023 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/container', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-container/v1/.mocharc.js b/owl-bot-staging/google-container/v1/.mocharc.js new file mode 100644 index 00000000000..1a38f257db7 --- /dev/null +++ b/owl-bot-staging/google-container/v1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-container/v1/.prettierrc.js b/owl-bot-staging/google-container/v1/.prettierrc.js new file mode 100644 index 00000000000..55639e70f9e --- /dev/null +++ b/owl-bot-staging/google-container/v1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-container/v1/README.md b/owl-bot-staging/google-container/v1/README.md new file mode 100644 index 00000000000..f32441d7e6b --- /dev/null +++ b/owl-bot-staging/google-container/v1/README.md @@ -0,0 +1 @@ +Container: Nodejs Client diff --git a/owl-bot-staging/google-container/v1/linkinator.config.json b/owl-bot-staging/google-container/v1/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/owl-bot-staging/google-container/v1/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/owl-bot-staging/google-container/v1/package.json b/owl-bot-staging/google-container/v1/package.json new file mode 100644 index 00000000000..9795068794e --- /dev/null +++ b/owl-bot-staging/google-container/v1/package.json @@ -0,0 +1,64 @@ +{ + "name": "@google-cloud/container", + "version": "0.1.0", + "description": "Container client for Node.js", + "repository": "googleapis/nodejs-container", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google container", + "container", + "cluster manager" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^3.5.7" + }, + "devDependencies": { + "@types/mocha": "^10.0.1", + "@types/node": "^18.11.18", + "@types/sinon": "^10.0.13", + "c8": "^7.12.0", + "gts": "^3.1.1", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.1", + "jsdoc-region-tag": "^2.0.1", + "linkinator": "^4.1.2", + "mocha": "^10.2.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^15.0.1", + "ts-loader": "^8.4.0", + "typescript": "^4.8.4", + "webpack": "^4.46.0", + "webpack-cli": "^4.10.0" + }, + "engines": { + "node": ">=v12" + } +} diff --git a/owl-bot-staging/google-container/v1/protos/google/container/v1/cluster_service.proto b/owl-bot-staging/google-container/v1/protos/google/container/v1/cluster_service.proto new file mode 100644 index 00000000000..83149cc4f44 --- /dev/null +++ b/owl-bot-staging/google-container/v1/protos/google/container/v1/cluster_service.proto @@ -0,0 +1,5156 @@ +// Copyright 2023 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. + +syntax = "proto3"; + +package google.container.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/rpc/code.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.Container.V1"; +option go_package = "cloud.google.com/go/container/apiv1/containerpb;containerpb"; +option java_multiple_files = true; +option java_outer_classname = "ClusterServiceProto"; +option java_package = "com.google.container.v1"; +option php_namespace = "Google\\Cloud\\Container\\V1"; +option ruby_package = "Google::Cloud::Container::V1"; +option (google.api.resource_definition) = { + type: "pubsub.googleapis.com/Topic" + pattern: "projects/{project}/topics/{topic}" +}; + +// Google Kubernetes Engine Cluster Manager v1 +service ClusterManager { + option (google.api.default_host) = "container.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists all clusters owned by a project in either the specified zone or all + // zones. + rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/clusters" + additional_bindings { + get: "/v1/projects/{project_id}/zones/{zone}/clusters" + } + }; + option (google.api.method_signature) = "project_id,zone"; + option (google.api.method_signature) = "parent"; + } + + // Gets the details of a specific cluster. + rpc GetCluster(GetClusterRequest) returns (Cluster) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/clusters/*}" + additional_bindings { + get: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id"; + option (google.api.method_signature) = "name"; + } + + // 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](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). + // + // 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. + rpc CreateCluster(CreateClusterRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/clusters" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster"; + option (google.api.method_signature) = "parent,cluster"; + } + + // Updates the settings of a specific cluster. + rpc UpdateCluster(UpdateClusterRequest) returns (Operation) { + option (google.api.http) = { + put: "/v1/{name=projects/*/locations/*/clusters/*}" + body: "*" + additional_bindings { + put: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id,update"; + option (google.api.method_signature) = "name,update"; + } + + // Updates the version and/or image type for the specified node pool. + rpc UpdateNodePool(UpdateNodePoolRequest) returns (Operation) { + option (google.api.http) = { + put: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/update" + body: "*" + } + }; + } + + // Sets the autoscaling settings for the specified node pool. + rpc SetNodePoolAutoscaling(SetNodePoolAutoscalingRequest) + returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setAutoscaling" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/autoscaling" + body: "*" + } + }; + } + + // Sets the logging service for a specific cluster. + rpc SetLoggingService(SetLoggingServiceRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:setLogging" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/logging" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,logging_service"; + option (google.api.method_signature) = "name,logging_service"; + } + + // Sets the monitoring service for a specific cluster. + rpc SetMonitoringService(SetMonitoringServiceRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:setMonitoring" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/monitoring" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,monitoring_service"; + option (google.api.method_signature) = "name,monitoring_service"; + } + + // Sets the addons for a specific cluster. + rpc SetAddonsConfig(SetAddonsConfigRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:setAddons" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/addons" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,addons_config"; + option (google.api.method_signature) = "name,addons_config"; + } + + // Sets the locations for a specific cluster. + // Deprecated. Use + // [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update) + // instead. + rpc SetLocations(SetLocationsRequest) returns (Operation) { + option deprecated = true; + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:setLocations" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/locations" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,locations"; + option (google.api.method_signature) = "name,locations"; + } + + // Updates the master for a specific cluster. + rpc UpdateMaster(UpdateMasterRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:updateMaster" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/master" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,master_version"; + option (google.api.method_signature) = "name,master_version"; + } + + // Sets master auth materials. Currently supports changing the admin password + // or a specific cluster, either via password generation or explicitly setting + // the password. + rpc SetMasterAuth(SetMasterAuthRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:setMasterAuth" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setMasterAuth" + body: "*" + } + }; + } + + // 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. + rpc DeleteCluster(DeleteClusterRequest) returns (Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/clusters/*}" + additional_bindings { + delete: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id"; + option (google.api.method_signature) = "name"; + } + + // Lists all operations in a project in a specific zone or all zones. + rpc ListOperations(ListOperationsRequest) returns (ListOperationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/operations" + additional_bindings { + get: "/v1/projects/{project_id}/zones/{zone}/operations" + } + }; + option (google.api.method_signature) = "project_id,zone"; + } + + // Gets the specified operation. + rpc GetOperation(GetOperationRequest) returns (Operation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/operations/*}" + additional_bindings { + get: "/v1/projects/{project_id}/zones/{zone}/operations/{operation_id}" + } + }; + option (google.api.method_signature) = "project_id,zone,operation_id"; + option (google.api.method_signature) = "name"; + } + + // Cancels the specified operation. + rpc CancelOperation(CancelOperationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/operations/*}:cancel" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/operations/{operation_id}:cancel" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,zone,operation_id"; + option (google.api.method_signature) = "name"; + } + + // Returns configuration info about the Google Kubernetes Engine service. + rpc GetServerConfig(GetServerConfigRequest) returns (ServerConfig) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*}/serverConfig" + additional_bindings { + get: "/v1/projects/{project_id}/zones/{zone}/serverconfig" + } + }; + option (google.api.method_signature) = "project_id,zone"; + option (google.api.method_signature) = "name"; + } + + // Gets the public component of the cluster signing keys in + // JSON Web Key format. + // This API is not yet intended for general use, and is not available for all + // clusters. + rpc GetJSONWebKeys(GetJSONWebKeysRequest) returns (GetJSONWebKeysResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/clusters/*}/jwks" + }; + } + + // Lists the node pools for a cluster. + rpc ListNodePools(ListNodePoolsRequest) returns (ListNodePoolsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/clusters/*}/nodePools" + additional_bindings { + get: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id"; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the requested node pool. + rpc GetNodePool(GetNodePoolRequest) returns (NodePool) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}" + additional_bindings { + get: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,node_pool_id"; + option (google.api.method_signature) = "name"; + } + + // Creates a node pool for a cluster. + rpc CreateNodePool(CreateNodePoolRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/clusters/*}/nodePools" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,node_pool"; + option (google.api.method_signature) = "parent,node_pool"; + } + + // Deletes a node pool from a cluster. + rpc DeleteNodePool(DeleteNodePoolRequest) returns (Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}" + additional_bindings { + delete: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,node_pool_id"; + option (google.api.method_signature) = "name"; + } + + // CompleteNodePoolUpgrade will signal an on-going node pool upgrade to + // complete. + rpc CompleteNodePoolUpgrade(CompleteNodePoolUpgradeRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}:completeUpgrade" + body: "*" + }; + } + + // Rolls back a previously Aborted or Failed NodePool upgrade. + // This makes no changes if the last upgrade successfully completed. + rpc RollbackNodePoolUpgrade(RollbackNodePoolUpgradeRequest) + returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}:rollback" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}:rollback" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,node_pool_id"; + option (google.api.method_signature) = "name"; + } + + // Sets the NodeManagement options for a node pool. + rpc SetNodePoolManagement(SetNodePoolManagementRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setManagement" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/setManagement" + body: "*" + } + }; + } + + // Sets labels on a cluster. + rpc SetLabels(SetLabelsRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:setResourceLabels" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/resourceLabels" + body: "*" + } + }; + } + + // Enables or disables the ABAC authorization mechanism on a cluster. + rpc SetLegacyAbac(SetLegacyAbacRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:setLegacyAbac" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/legacyAbac" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id,enabled"; + option (google.api.method_signature) = "name,enabled"; + } + + // Starts master IP rotation. + rpc StartIPRotation(StartIPRotationRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:startIpRotation" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:startIpRotation" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id"; + option (google.api.method_signature) = "name"; + } + + // Completes master IP rotation. + rpc CompleteIPRotation(CompleteIPRotationRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:completeIpRotation" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:completeIpRotation" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id"; + option (google.api.method_signature) = "name"; + } + + // Sets the size for a specific node pool. The new size will be used for all + // replicas, including future replicas created by modifying + // [NodePool.locations][google.container.v1.NodePool.locations]. + rpc SetNodePoolSize(SetNodePoolSizeRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setSize" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/setSize" + body: "*" + } + }; + } + + // Enables or disables Network Policy for a cluster. + rpc SetNetworkPolicy(SetNetworkPolicyRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:setNetworkPolicy" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setNetworkPolicy" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,network_policy"; + option (google.api.method_signature) = "name,network_policy"; + } + + // Sets the maintenance policy for a cluster. + rpc SetMaintenancePolicy(SetMaintenancePolicyRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:setMaintenancePolicy" + body: "*" + additional_bindings { + post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setMaintenancePolicy" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,maintenance_policy"; + option (google.api.method_signature) = "name,maintenance_policy"; + } + + // Lists subnetworks that are usable for creating clusters in a project. + rpc ListUsableSubnetworks(ListUsableSubnetworksRequest) + returns (ListUsableSubnetworksResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/aggregated/usableSubnetworks" + }; + } + + // Checks the cluster compatibility with Autopilot mode, and returns a list of + // compatibility issues. + rpc CheckAutopilotCompatibility(CheckAutopilotCompatibilityRequest) + returns (CheckAutopilotCompatibilityResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/clusters/*}:checkAutopilotCompatibility" + }; + } +} + +// Parameters that can be configured on Linux nodes. +message LinuxNodeConfig { + // Possible cgroup modes that can be used. + enum CgroupMode { + // CGROUP_MODE_UNSPECIFIED is when unspecified cgroup configuration is used. + // The default for the GKE node OS image will be used. + CGROUP_MODE_UNSPECIFIED = 0; + + // CGROUP_MODE_V1 specifies to use cgroupv1 for the cgroup configuration on + // the node image. + CGROUP_MODE_V1 = 1; + + // CGROUP_MODE_V2 specifies to use cgroupv2 for the cgroup configuration on + // the node image. + CGROUP_MODE_V2 = 2; + } + + // The Linux kernel parameters to be applied to the nodes and all pods running + // on the nodes. + // + // The following parameters are supported. + // + // net.core.busy_poll + // net.core.busy_read + // net.core.netdev_max_backlog + // net.core.rmem_max + // net.core.wmem_default + // net.core.wmem_max + // net.core.optmem_max + // net.core.somaxconn + // net.ipv4.tcp_rmem + // net.ipv4.tcp_wmem + // net.ipv4.tcp_tw_reuse + map sysctls = 1; + + // cgroup_mode specifies the cgroup mode to be used on the node. + CgroupMode cgroup_mode = 2; +} + +// Parameters that can be configured on Windows nodes. +// Windows Node Config that define the parameters that will be used to +// configure the Windows node pool settings +message WindowsNodeConfig { + // Possible OS version that can be used. + enum OSVersion { + // When OSVersion is not specified + OS_VERSION_UNSPECIFIED = 0; + + // LTSC2019 specifies to use LTSC2019 as the Windows Servercore Base Image + OS_VERSION_LTSC2019 = 1; + + // LTSC2022 specifies to use LTSC2022 as the Windows Servercore Base Image + OS_VERSION_LTSC2022 = 2; + } + + // OSVersion specifies the Windows node config to be used on the node + OSVersion os_version = 1; +} + +// Node kubelet configs. +message NodeKubeletConfig { + // Control the CPU management policy on the node. + // See + // https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/ + // + // The following values are allowed. + // * "none": the default, which represents the existing scheduling behavior. + // * "static": allows pods with certain resource characteristics to be granted + // increased CPU affinity and exclusivity on the node. + // The default value is 'none' if unspecified. + string cpu_manager_policy = 1; + + // Enable CPU CFS quota enforcement for containers that specify CPU limits. + // + // This option is enabled by default which makes kubelet use CFS quota + // (https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt) to + // enforce container CPU limits. Otherwise, CPU limits will not be enforced at + // all. + // + // Disable this option to mitigate CPU throttling problems while still having + // your pods to be in Guaranteed QoS class by specifying the CPU limits. + // + // The default value is 'true' if unspecified. + google.protobuf.BoolValue cpu_cfs_quota = 2; + + // Set the CPU CFS quota period value 'cpu.cfs_period_us'. + // + // The string must be a sequence of decimal numbers, each with optional + // fraction and a unit suffix, such as "300ms". + // Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". + // The value must be a positive duration. + string cpu_cfs_quota_period = 3; + + // Set the Pod PID limits. See + // https://kubernetes.io/docs/concepts/policy/pid-limiting/#pod-pid-limits + // + // Controls the maximum number of processes allowed to run in a pod. The value + // must be greater than or equal to 1024 and less than 4194304. + int64 pod_pids_limit = 4; + + // Enable or disable Kubelet read only port. + optional bool insecure_kubelet_readonly_port_enabled = 7; +} + +// Parameters that describe the nodes in a cluster. +// +// GKE Autopilot clusters do not +// recognize parameters in `NodeConfig`. Use +// [AutoprovisioningNodePoolDefaults][google.container.v1.AutoprovisioningNodePoolDefaults] +// instead. +message NodeConfig { + // The name of a Google Compute Engine [machine + // type](https://cloud.google.com/compute/docs/machine-types) + // + // If unspecified, the default machine type is `e2-medium`. + string machine_type = 1; + + // 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. + int32 disk_size_gb = 2; + + // 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](https://cloud.google.com/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. + repeated string oauth_scopes = 3; + + // The Google Cloud Platform Service Account to be used by the node VMs. + // Specify the email address of the Service Account; otherwise, if no Service + // Account is specified, the "default" service account is used. + string service_account = 9; + + // 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-ensure-gke-docker" + // - "gci-metrics-enabled" + // - "gci-update-strategy" + // - "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" + // + // 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. + map metadata = 4; + + // The image type to use for this node. Note that for a given image type, + // the latest version of it will be used. Please see + // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for + // available image types. + string image_type = 5; + + // 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/ + map labels = 6; + + // 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. + int32 local_ssd_count = 7; + + // 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. + repeated string tags = 8; + + // 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. + bool preemptible = 10; + + // 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. + repeated AcceleratorConfig accelerators = 11; + + // Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or + // 'pd-balanced') + // + // If unspecified, the default disk type is 'pd-standard' + string disk_type = 12; + + // 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](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform) + string min_cpu_platform = 13; + + // The workload metadata configuration for this node. + WorkloadMetadataConfig workload_metadata_config = 14; + + // 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/ + repeated NodeTaint taints = 15; + + // Sandbox configuration for this node. + SandboxConfig sandbox_config = 17; + + // Setting this field will assign instances of this + // pool to run on the specified node group. This is useful for running + // workloads on [sole tenant + // nodes](https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes). + string node_group = 18; + + // The optional reservation affinity. Setting this field will apply + // the specified [Zonal Compute + // Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources) + // to this node pool. + ReservationAffinity reservation_affinity = 19; + + // Shielded Instance options. + ShieldedInstanceConfig shielded_instance_config = 20; + + // Parameters that can be configured on Linux nodes. + LinuxNodeConfig linux_node_config = 21; + + // Node kubelet configs. + NodeKubeletConfig kubelet_config = 22; + + // + // The Customer Managed Encryption Key used to encrypt the boot disk attached + // to each node in the node pool. This should be of the form + // projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. + // For more information about protecting resources with Cloud KMS Keys please + // see: + // https://cloud.google.com/compute/docs/disks/customer-managed-encryption + string boot_disk_kms_key = 23; + + // Google Container File System (image streaming) configs. + GcfsConfig gcfs_config = 25; + + // Advanced features for the Compute Engine VM. + AdvancedMachineFeatures advanced_machine_features = 26; + + // Enable or disable gvnic in the node pool. + VirtualNIC gvnic = 29; + + // Spot flag for enabling Spot VM, which is a rebrand of + // the existing preemptible flag. + bool spot = 32; + + // Confidential nodes config. + // All the nodes in the node pool will be Confidential VM once enabled. + ConfidentialNodes confidential_nodes = 35; + + // Enable or disable NCCL fast socket for the node pool. + optional FastSocket fast_socket = 36; + + // The resource labels for the node pool to use to annotate any related + // Google Compute Engine resources. + map resource_labels = 37; + + // Logging configuration. + NodePoolLoggingConfig logging_config = 38; + + // Parameters that can be configured on Windows nodes. + WindowsNodeConfig windows_node_config = 39; + + // Parameters for using raw-block Local NVMe SSDs. + LocalNvmeSsdBlockConfig local_nvme_ssd_block_config = 40; + + // Parameters for the node ephemeral storage using Local SSDs. + // If unspecified, ephemeral storage is backed by the boot disk. + EphemeralStorageLocalSsdConfig ephemeral_storage_local_ssd_config = 41; + + // Parameters for node pools to be backed by shared sole tenant node groups. + SoleTenantConfig sole_tenant_config = 42; +} + +// Specifies options for controlling advanced machine features. +message AdvancedMachineFeatures { + // The number of threads per physical core. To disable simultaneous + // multithreading (SMT) set this to 1. If unset, the maximum number of threads + // supported per core by the underlying processor is assumed. + optional int64 threads_per_core = 1; +} + +// Parameters for node pool-level network config. +message NodeNetworkConfig { + // Configuration of all network bandwidth tiers + message NetworkPerformanceConfig { + // Node network tier + enum Tier { + // Default value + TIER_UNSPECIFIED = 0; + + // Higher bandwidth, actual values based on VM size. + TIER_1 = 1; + } + + // Specifies the total network bandwidth tier for the NodePool. + optional Tier total_egress_bandwidth_tier = 1; + } + + // Input only. Whether to create a new range for pod IPs in this node pool. + // Defaults are provided for `pod_range` and `pod_ipv4_cidr_block` if they + // are not specified. + // + // If neither `create_pod_range` or `pod_range` are specified, the + // cluster-level default (`ip_allocation_policy.cluster_ipv4_cidr_block`) is + // used. + // + // Only applicable if `ip_allocation_policy.use_ip_aliases` is true. + // + // This field cannot be changed after the node pool has been created. + bool create_pod_range = 4 [(google.api.field_behavior) = INPUT_ONLY]; + + // The ID of the secondary range for pod IPs. + // If `create_pod_range` is true, this ID is used for the new range. + // If `create_pod_range` is false, uses an existing secondary range with this + // ID. + // + // Only applicable if `ip_allocation_policy.use_ip_aliases` is true. + // + // This field cannot be changed after the node pool has been created. + string pod_range = 5; + + // The IP address range for pod IPs in this node pool. + // + // Only applicable if `create_pod_range` 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](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `10.96.0.0/14`) to pick a specific range to use. + // + // Only applicable if `ip_allocation_policy.use_ip_aliases` is true. + // + // This field cannot be changed after the node pool has been created. + string pod_ipv4_cidr_block = 6; + + // Whether nodes have internal IP addresses only. + // If enable_private_nodes is not specified, then the value is derived from + // [cluster.privateClusterConfig.enablePrivateNodes][google.container.v1beta1.PrivateClusterConfig.enablePrivateNodes] + optional bool enable_private_nodes = 9; + + // Network bandwidth tier configuration. + optional NetworkPerformanceConfig network_performance_config = 11; + + // [PRIVATE FIELD] + // Pod CIDR size overprovisioning config for the nodepool. + // + // Pod CIDR size per node depends on max_pods_per_node. By default, the value + // of max_pods_per_node is rounded off to next power of 2 and we then double + // that to get the size of pod CIDR block per node. + // Example: max_pods_per_node of 30 would result in 64 IPs (/26). + // + // This config can disable the doubling of IPs (we still round off to next + // power of 2) + // Example: max_pods_per_node of 30 will result in 32 IPs (/27) when + // overprovisioning is disabled. + PodCIDROverprovisionConfig pod_cidr_overprovision_config = 13; + + // Output only. [Output only] The utilization of the IPv4 range for the pod. + // The ratio is Usage/[Total number of IPs in the secondary range], + // Usage=numNodes*numZones*podIPsPerNode. + double pod_ipv4_range_utilization = 16 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A set of Shielded Instance options. +message ShieldedInstanceConfig { + // 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. + bool enable_secure_boot = 1; + + // 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. + bool enable_integrity_monitoring = 2; +} + +// SandboxConfig contains configurations of the sandbox to use for the node. +message SandboxConfig { + // Possible types of sandboxes. + enum Type { + // Default value. This should not be used. + UNSPECIFIED = 0; + + // Run sandbox using gvisor. + GVISOR = 1; + } + + // Type of the sandbox to use for the node. + Type type = 2; +} + +// GcfsConfig contains configurations of Google Container File System +// (image streaming). +message GcfsConfig { + // Whether to use GCFS. + bool enabled = 1; +} + +// [ReservationAffinity](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources) +// is the configuration of desired reservation which instances could take +// capacity from. +message ReservationAffinity { + // Indicates whether to consume capacity from a reservation or not. + enum Type { + // Default value. This should not be used. + UNSPECIFIED = 0; + + // Do not consume from any reserved capacity. + NO_RESERVATION = 1; + + // Consume any reservation available. + ANY_RESERVATION = 2; + + // Must consume from a specific reservation. Must specify key value fields + // for specifying the reservations. + SPECIFIC_RESERVATION = 3; + } + + // Corresponds to the type of reservation consumption. + Type consume_reservation_type = 1; + + // Corresponds to the label key of a reservation resource. To target a + // SPECIFIC_RESERVATION by name, specify + // "compute.googleapis.com/reservation-name" as the key and specify the name + // of your reservation as its value. + string key = 2; + + // Corresponds to the label value(s) of reservation resource(s). + repeated string values = 3; +} + +// SoleTenantConfig contains the NodeAffinities to specify what shared sole +// tenant node groups should back the node pool. +message SoleTenantConfig { + // Specifies the NodeAffinity key, values, and affinity operator according to + // [shared sole tenant node group + // affinities](https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes#node_affinity_and_anti-affinity). + message NodeAffinity { + // Operator allows user to specify affinity or anti-affinity for the + // given key values. + enum Operator { + // Invalid or unspecified affinity operator. + OPERATOR_UNSPECIFIED = 0; + + // Affinity operator. + IN = 1; + + // Anti-affinity operator. + NOT_IN = 2; + } + + // Key for NodeAffinity. + string key = 1; + + // Operator for NodeAffinity. + Operator operator = 2; + + // Values for NodeAffinity. + repeated string values = 3; + } + + // NodeAffinities used to match to a shared sole tenant node group. + repeated NodeAffinity node_affinities = 1; +} + +// Kubernetes taint is composed of three fields: key, value, and effect. Effect +// can only be one of three types: NoSchedule, PreferNoSchedule or NoExecute. +// +// See +// [here](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration) +// for more information, including usage and the valid values. +message NodeTaint { + // Possible values for Effect in taint. + enum Effect { + // Not set + EFFECT_UNSPECIFIED = 0; + + // NoSchedule + NO_SCHEDULE = 1; + + // PreferNoSchedule + PREFER_NO_SCHEDULE = 2; + + // NoExecute + NO_EXECUTE = 3; + } + + // Key for taint. + string key = 1; + + // Value for taint. + string value = 2; + + // Effect for taint. + Effect effect = 3; +} + +// Collection of Kubernetes [node +// taints](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration). +message NodeTaints { + // List of node taints. + repeated NodeTaint taints = 1; +} + +// Collection of node-level [Kubernetes +// labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels). +message NodeLabels { + // Map of node label keys and node label values. + map labels = 1; +} + +// Collection of [GCP +// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). +message ResourceLabels { + // Map of node label keys and node label values. + map labels = 1; +} + +// Collection of Compute Engine network tags that can be applied to a node's +// underlying VM instance. +message NetworkTags { + // List of network tags. + repeated string tags = 1; +} + +// The authentication information for accessing the master endpoint. +// Authentication can be done using HTTP basic auth or using client +// certificates. +message MasterAuth { + // 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). + // + // Warning: basic authentication is deprecated, and will be removed in GKE + // control plane versions 1.19 and newer. For a list of recommended + // authentication methods, see: + // https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication + string username = 1 [deprecated = true]; + + // 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. + // + // Warning: basic authentication is deprecated, and will be removed in GKE + // control plane versions 1.19 and newer. For a list of recommended + // authentication methods, see: + // https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication + string password = 2 [deprecated = true]; + + // Configuration for client certificate authentication on the cluster. For + // clusters before v1.12, if no configuration is specified, a client + // certificate is issued. + ClientCertificateConfig client_certificate_config = 3; + + // [Output only] Base64-encoded public certificate that is the root of + // trust for the cluster. + string cluster_ca_certificate = 100; + + // [Output only] Base64-encoded public certificate used by clients to + // authenticate to the cluster endpoint. + string client_certificate = 101; + + // [Output only] Base64-encoded private key used by clients to authenticate + // to the cluster endpoint. + string client_key = 102; +} + +// Configuration for client certificates on the cluster. +message ClientCertificateConfig { + // Issue a client certificate. + bool issue_client_certificate = 1; +} + +// Configuration for the addons that can be automatically spun up in the +// cluster, enabling additional functionality. +message AddonsConfig { + // Configuration for the HTTP (L7) load balancing controller addon, which + // makes it easy to set up HTTP load balancers for services in a cluster. + HttpLoadBalancing http_load_balancing = 1; + + // 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. + HorizontalPodAutoscaling horizontal_pod_autoscaling = 2; + + // 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 + KubernetesDashboard kubernetes_dashboard = 3 [deprecated = true]; + + // 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. + NetworkPolicyConfig network_policy_config = 4; + + // Configuration for the Cloud Run addon, which allows the user to use a + // managed Knative service. + CloudRunConfig cloud_run_config = 7; + + // Configuration for NodeLocalDNS, a dns cache running on cluster nodes + DnsCacheConfig dns_cache_config = 8; + + // Configuration for the ConfigConnector add-on, a Kubernetes + // extension to manage hosted GCP services through the Kubernetes API + ConfigConnectorConfig config_connector_config = 10; + + // Configuration for the Compute Engine Persistent Disk CSI driver. + GcePersistentDiskCsiDriverConfig gce_persistent_disk_csi_driver_config = 11; + + // Configuration for the GCP Filestore CSI driver. + GcpFilestoreCsiDriverConfig gcp_filestore_csi_driver_config = 14; + + // Configuration for the Backup for GKE agent addon. + GkeBackupAgentConfig gke_backup_agent_config = 16; + + // Configuration for the Cloud Storage Fuse CSI driver. + GcsFuseCsiDriverConfig gcs_fuse_csi_driver_config = 17; +} + +// 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. +message HttpLoadBalancing { + // 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. + bool disabled = 1; +} + +// 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. +message HorizontalPodAutoscaling { + // Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. + // When enabled, it ensures that metrics are collected into Stackdriver + // Monitoring. + bool disabled = 1; +} + +// Configuration for the Kubernetes Dashboard. +message KubernetesDashboard { + // Whether the Kubernetes Dashboard is enabled for this cluster. + bool disabled = 1; +} + +// 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. +message NetworkPolicyConfig { + // Whether NetworkPolicy is enabled for this cluster. + bool disabled = 1; +} + +// Configuration for NodeLocal DNSCache +message DnsCacheConfig { + // Whether NodeLocal DNSCache is enabled for this cluster. + bool enabled = 1; +} + +// Configuration for controlling master global access settings. +message PrivateClusterMasterGlobalAccessConfig { + // Whenever master is accessible globally or not. + bool enabled = 1; +} + +// Configuration options for private clusters. +message PrivateClusterConfig { + // 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. + bool enable_private_nodes = 1; + + // Whether the master's internal IP address is used as the cluster endpoint. + bool enable_private_endpoint = 2; + + // 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. + string master_ipv4_cidr_block = 3; + + // Output only. The internal IP address of this cluster's master endpoint. + string private_endpoint = 4; + + // Output only. The external IP address of this cluster's master endpoint. + string public_endpoint = 5; + + // Output only. The peering name in the customer VPC used by this cluster. + string peering_name = 7; + + // Controls master global access settings. + PrivateClusterMasterGlobalAccessConfig master_global_access_config = 8; + + // Subnet to provision the master's private endpoint during cluster creation. + // Specified in projects/*/regions/*/subnetworks/* format. + string private_endpoint_subnetwork = 10; +} + +// Configuration for returning group information from authenticators. +message AuthenticatorGroupsConfig { + // Whether this cluster should return group membership lookups + // during authentication using a group of security groups. + bool enabled = 1; + + // The name of the security group-of-groups to be used. Only relevant + // if enabled = true. + string security_group = 2; +} + +// Configuration options for the Cloud Run feature. +message CloudRunConfig { + // Load balancer type of ingress service of Cloud Run. + enum LoadBalancerType { + // Load balancer type for Cloud Run is unspecified. + LOAD_BALANCER_TYPE_UNSPECIFIED = 0; + + // Install external load balancer for Cloud Run. + LOAD_BALANCER_TYPE_EXTERNAL = 1; + + // Install internal load balancer for Cloud Run. + LOAD_BALANCER_TYPE_INTERNAL = 2; + } + + // Whether Cloud Run addon is enabled for this cluster. + bool disabled = 1; + + // Which load balancer type is installed for Cloud Run. + LoadBalancerType load_balancer_type = 3; +} + +// Configuration options for the Config Connector add-on. +message ConfigConnectorConfig { + // Whether Cloud Connector is enabled for this cluster. + bool enabled = 1; +} + +// Configuration for the Compute Engine PD CSI driver. +message GcePersistentDiskCsiDriverConfig { + // Whether the Compute Engine PD CSI driver is enabled for this cluster. + bool enabled = 1; +} + +// Configuration for the GCP Filestore CSI driver. +message GcpFilestoreCsiDriverConfig { + // Whether the GCP Filestore CSI driver is enabled for this cluster. + bool enabled = 1; +} + +// Configuration for the Cloud Storage Fuse CSI driver. +message GcsFuseCsiDriverConfig { + // Whether the Cloud Storage Fuse CSI driver is enabled for this cluster. + bool enabled = 1; +} + +// Configuration for the Backup for GKE Agent. +message GkeBackupAgentConfig { + // Whether the Backup for GKE agent is enabled for this cluster. + bool enabled = 1; +} + +// 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. +message MasterAuthorizedNetworksConfig { + // CidrBlock contains an optional name and one CIDR block. + message CidrBlock { + // display_name is an optional field for users to identify CIDR blocks. + string display_name = 1; + + // cidr_block must be specified in CIDR notation. + string cidr_block = 2; + } + + // Whether or not master authorized networks is enabled. + bool enabled = 1; + + // cidr_blocks define up to 50 external networks that could access + // Kubernetes master through HTTPS. + repeated CidrBlock cidr_blocks = 2; + + // Whether master is accessbile via Google Compute Engine Public IP addresses. + optional bool gcp_public_cidrs_access_enabled = 3; +} + +// Configuration for the legacy Attribute Based Access Control authorization +// mode. +message LegacyAbac { + // 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. + bool enabled = 1; +} + +// Configuration options for the NetworkPolicy feature. +// https://kubernetes.io/docs/concepts/services-networking/networkpolicies/ +message NetworkPolicy { + // Allowed Network Policy providers. + enum Provider { + // Not set + PROVIDER_UNSPECIFIED = 0; + + // Tigera (Calico Felix). + CALICO = 1; + } + + // The selected network policy provider. + Provider provider = 1; + + // Whether network policy is enabled on the cluster. + bool enabled = 2; +} + +// Configuration for Binary Authorization. +message BinaryAuthorization { + // Binary Authorization mode of operation. + enum EvaluationMode { + // Default value + EVALUATION_MODE_UNSPECIFIED = 0; + + // Disable BinaryAuthorization + DISABLED = 1; + + // Enforce Kubernetes admission requests with BinaryAuthorization using the + // project's singleton policy. This is equivalent to setting the + // enabled boolean to true. + PROJECT_SINGLETON_POLICY_ENFORCE = 2; + } + + // This field is deprecated. Leave this unset and instead configure + // BinaryAuthorization using evaluation_mode. If evaluation_mode is set to + // anything other than EVALUATION_MODE_UNSPECIFIED, this field is ignored. + bool enabled = 1 [deprecated = true]; + + // Mode of operation for binauthz policy evaluation. If unspecified, defaults + // to DISABLED. + EvaluationMode evaluation_mode = 2; +} + +// [PRIVATE FIELD] +// Config for pod CIDR size overprovisioning. +message PodCIDROverprovisionConfig { + // Whether Pod CIDR overprovisioning is disabled. + // Note: Pod CIDR overprovisioning is enabled by default. + bool disable = 1; +} + +// Configuration for controlling how IPs are allocated in the cluster. +message IPAllocationPolicy { + // Whether alias IPs will be used for pod IPs in the cluster. + // This is used in conjunction with use_routes. It cannot + // be true if use_routes is true. If both use_ip_aliases and use_routes are + // false, then the server picks the default IP allocation mode + bool use_ip_aliases = 1; + + // Whether a new subnetwork will be created automatically for the cluster. + // + // This field is only applicable when `use_ip_aliases` is true. + bool create_subnetwork = 2; + + // 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. + string subnetwork_name = 3; + + // This field is deprecated, use cluster_ipv4_cidr_block. + string cluster_ipv4_cidr = 4 [deprecated = true]; + + // This field is deprecated, use node_ipv4_cidr_block. + string node_ipv4_cidr = 5 [deprecated = true]; + + // This field is deprecated, use services_ipv4_cidr_block. + string services_ipv4_cidr = 6 [deprecated = true]; + + // 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. + string cluster_secondary_range_name = 7; + + // 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. + string services_secondary_range_name = 8; + + // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // 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. + string cluster_ipv4_cidr_block = 9; + + // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // 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. + string node_ipv4_cidr_block = 10; + + // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // 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. + string services_ipv4_cidr_block = 11; + + // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // 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. + string tpu_ipv4_cidr_block = 13; + + // Whether routes will be used for pod IPs in the cluster. + // This is used in conjunction with use_ip_aliases. It cannot be true if + // use_ip_aliases is true. If both use_ip_aliases and use_routes are false, + // then the server picks the default IP allocation mode + bool use_routes = 15; + + // The IP stack type of the cluster + StackType stack_type = 16; + + // The ipv6 access type (internal or external) when create_subnetwork is true + IPv6AccessType ipv6_access_type = 17; + + // [PRIVATE FIELD] + // Pod CIDR size overprovisioning config for the cluster. + // + // Pod CIDR size per node depends on max_pods_per_node. By default, the value + // of max_pods_per_node is doubled and then rounded off to next power of 2 to + // get the size of pod CIDR block per node. + // Example: max_pods_per_node of 30 would result in 64 IPs (/26). + // + // This config can disable the doubling of IPs (we still round off to next + // power of 2) + // Example: max_pods_per_node of 30 will result in 32 IPs (/27) when + // overprovisioning is disabled. + PodCIDROverprovisionConfig pod_cidr_overprovision_config = 21; + + // Output only. [Output only] The subnet's IPv6 CIDR block used by nodes and + // pods. + string subnet_ipv6_cidr_block = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output only] The services IPv6 CIDR block for the cluster. + string services_ipv6_cidr_block = 23 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output only] The additional pod ranges that are added to the + // cluster. These pod ranges can be used by new node pools to allocate pod IPs + // automatically. Once the range is removed it will not show up in + // IPAllocationPolicy. + AdditionalPodRangesConfig additional_pod_ranges_config = 24 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output only] The utilization of the cluster default IPv4 + // range for the pod. The ratio is Usage/[Total number of IPs in the secondary + // range], Usage=numNodes*numZones*podIPsPerNode. + double default_pod_ipv4_range_utilization = 25 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A Google Kubernetes Engine cluster. +message Cluster { + // The current status of the cluster. + enum Status { + // Not set. + STATUS_UNSPECIFIED = 0; + + // The PROVISIONING state indicates the cluster is being created. + PROVISIONING = 1; + + // The RUNNING state indicates the cluster has been created and is fully + // usable. + RUNNING = 2; + + // 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. + RECONCILING = 3; + + // The STOPPING state indicates the cluster is being deleted. + STOPPING = 4; + + // The ERROR state indicates the cluster is unusable. It will be + // automatically deleted. Details can be found in the `statusMessage` field. + ERROR = 5; + + // The DEGRADED state indicates the cluster requires user action to restore + // full functionality. Details can be found in the `statusMessage` field. + DEGRADED = 6; + } + + // 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. + string name = 1; + + // An optional description of this cluster. + string description = 2; + + // The number of nodes to create in this cluster. You must ensure that your + // 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 + // "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. + int32 initial_node_count = 3 [deprecated = true]; + + // 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. + NodeConfig node_config = 4 [deprecated = true]; + + // 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. + MasterAuth master_auth = 5; + + // The logging service the cluster should use to write logs. + // Currently available options: + // + // * `logging.googleapis.com/kubernetes` - The Cloud Logging + // service with a Kubernetes-native resource model + // * `logging.googleapis.com` - The legacy Cloud Logging service (no longer + // available as of GKE 1.15). + // * `none` - no logs will be exported from the cluster. + // + // If left as an empty string,`logging.googleapis.com/kubernetes` will be + // used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. + string logging_service = 6; + + // The monitoring service the cluster should use to write metrics. + // Currently available options: + // + // * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring + // service with a Kubernetes-native resource model + // * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no + // longer available as of GKE 1.15). + // * `none` - No metrics will be exported from the cluster. + // + // If left as an empty string,`monitoring.googleapis.com/kubernetes` will be + // used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. + string monitoring_service = 7; + + // The name of the Google Compute Engine + // [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) + // to which the cluster is connected. If left unspecified, the `default` + // network will be used. + string network = 8; + + // The IP address range of the container pods in this cluster, in + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // 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`. + string cluster_ipv4_cidr = 9; + + // Configurations for the various addons available to run in the cluster. + AddonsConfig addons_config = 10; + + // The name of the Google Compute Engine + // [subnetwork](https://cloud.google.com/compute/docs/subnetworks) to which + // the cluster is connected. + string subnetwork = 11; + + // The node pools associated with this cluster. + // This field should not be set if "node_config" or "initial_node_count" are + // specified. + repeated NodePool node_pools = 12; + + // The list of Google Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster's nodes should be located. + // + // This field provides a default value if + // [NodePool.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools#NodePool.FIELDS.locations) + // are not specified during node pool creation. + // + // Warning: changing cluster locations will update the + // [NodePool.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools#NodePool.FIELDS.locations) + // of all node pools and will result in nodes being added and/or removed. + repeated string locations = 13; + + // 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. + bool enable_kubernetes_alpha = 14; + + // The resource labels for the cluster to use to annotate any related + // Google Compute Engine resources. + map resource_labels = 15; + + // The fingerprint of the set of labels for this cluster. + string label_fingerprint = 16; + + // Configuration for the legacy ABAC authorization mode. + LegacyAbac legacy_abac = 18; + + // Configuration options for the NetworkPolicy feature. + NetworkPolicy network_policy = 19; + + // Configuration for cluster IP allocation. + IPAllocationPolicy ip_allocation_policy = 20; + + // The configuration options for master authorized networks feature. + MasterAuthorizedNetworksConfig master_authorized_networks_config = 22; + + // Configure the maintenance policy for this cluster. + MaintenancePolicy maintenance_policy = 23; + + // Configuration for Binary Authorization. + BinaryAuthorization binary_authorization = 24; + + // Cluster-level autoscaling configuration. + ClusterAutoscaling autoscaling = 26; + + // Configuration for cluster networking. + NetworkConfig network_config = 27; + + // 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. + MaxPodsConstraint default_max_pods_constraint = 30; + + // Configuration for exporting resource usages. Resource usage export is + // disabled when this config is unspecified. + ResourceUsageExportConfig resource_usage_export_config = 33; + + // Configuration controlling RBAC group membership information. + AuthenticatorGroupsConfig authenticator_groups_config = 34; + + // Configuration for private cluster. + PrivateClusterConfig private_cluster_config = 37; + + // Configuration of etcd encryption. + DatabaseEncryption database_encryption = 38; + + // Cluster-level Vertical Pod Autoscaling configuration. + VerticalPodAutoscaling vertical_pod_autoscaling = 39; + + // Shielded Nodes configuration. + ShieldedNodes shielded_nodes = 40; + + // Release channel configuration. If left unspecified on cluster creation and + // a version is specified, the cluster is enrolled in the most mature release + // channel where the version is available (first checking STABLE, then + // REGULAR, and finally RAPID). Otherwise, if no release channel + // configuration and no version is specified, the cluster is enrolled in the + // REGULAR channel with its default version. + ReleaseChannel release_channel = 41; + + // Configuration for the use of Kubernetes Service Accounts in GCP IAM + // policies. + WorkloadIdentityConfig workload_identity_config = 43; + + // Configuration for issuance of mTLS keys and certificates to Kubernetes + // pods. + MeshCertificates mesh_certificates = 67; + + // Configuration for the fine-grained cost management feature. + CostManagementConfig cost_management_config = 45; + + // Notification configuration of the cluster. + NotificationConfig notification_config = 49; + + // Configuration of Confidential Nodes. + // All the nodes in the cluster will be Confidential VM once enabled. + ConfidentialNodes confidential_nodes = 50; + + // Configuration for Identity Service component. + IdentityServiceConfig identity_service_config = 54; + + // [Output only] Server-defined URL for the resource. + string self_link = 100; + + // [Output only] The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field is deprecated, use location instead. + string zone = 101 [deprecated = true]; + + // [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. + string endpoint = 102; + + // 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 + string initial_cluster_version = 103; + + // [Output only] The current software version of the master endpoint. + string current_master_version = 104; + + // [Output only] Deprecated, use + // [NodePools.version](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools) + // 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. + string current_node_version = 105 [deprecated = true]; + + // [Output only] The time the cluster was created, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + string create_time = 106; + + // [Output only] The current status of this cluster. + Status status = 107; + + // [Output only] Deprecated. Use conditions instead. + // Additional information about the current status of this + // cluster, if available. + string status_message = 108 [deprecated = true]; + + // [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. + int32 node_ipv4_cidr_size = 109; + + // [Output only] The IP address range of the Kubernetes services in + // this cluster, in + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `1.2.3.4/29`). Service addresses are + // typically put in the last `/16` from the container CIDR. + string services_ipv4_cidr = 110; + + // Deprecated. Use node_pools.instance_group_urls. + repeated string instance_group_urls = 111 [deprecated = true]; + + // [Output only] The number of nodes currently in the cluster. Deprecated. + // Call Kubernetes API directly to retrieve node information. + int32 current_node_count = 112 [deprecated = true]; + + // [Output only] The time the cluster will be automatically + // deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + string expire_time = 113; + + // [Output only] The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) + // or + // [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) + // in which the cluster resides. + string location = 114; + + // Enable the ability to use Cloud TPUs in this cluster. + bool enable_tpu = 115; + + // [Output only] The IP address range of the Cloud TPUs in this cluster, in + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `1.2.3.4/29`). + string tpu_ipv4_cidr_block = 116; + + // Which conditions caused the current cluster state. + repeated StatusCondition conditions = 118; + + // Autopilot configuration for the cluster. + Autopilot autopilot = 128; + + // Output only. Unique id for the cluster. + string id = 129 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Default NodePool settings for the entire cluster. These settings are + // overridden if specified on the specific NodePool object. + optional NodePoolDefaults node_pool_defaults = 131; + + // Logging configuration for the cluster. + LoggingConfig logging_config = 132; + + // Monitoring configuration for the cluster. + MonitoringConfig monitoring_config = 133; + + // Node pool configs that apply to all auto-provisioned node pools + // in autopilot clusters and node auto-provisioning enabled clusters. + NodePoolAutoConfig node_pool_auto_config = 136; + + // This checksum is computed by the server based on the value of cluster + // fields, and may be sent on update requests to ensure the client has an + // up-to-date value before proceeding. + string etag = 139; + + // Fleet information for the cluster. + Fleet fleet = 140; + + // Enable/Disable Security Posture API features for the cluster. + SecurityPostureConfig security_posture_config = 145; + + // Beta APIs Config + K8sBetaAPIConfig enable_k8s_beta_apis = 143; +} + +// K8sBetaAPIConfig , configuration for beta APIs +message K8sBetaAPIConfig { + // Enabled k8s beta APIs. + repeated string enabled_apis = 1; +} + +// SecurityPostureConfig defines the flags needed to enable/disable features for +// the Security Posture API. +message SecurityPostureConfig { + // Mode defines enablement mode for GKE Security posture features. + enum Mode { + // Default value not specified. + MODE_UNSPECIFIED = 0; + + // Disables Security Posture features on the cluster. + DISABLED = 1; + + // Applies Security Posture features on the cluster. + BASIC = 2; + } + + // VulnerabilityMode defines enablement mode for vulnerability scanning. + enum VulnerabilityMode { + // Default value not specified. + VULNERABILITY_MODE_UNSPECIFIED = 0; + + // Disables vulnerability scanning on the cluster. + VULNERABILITY_DISABLED = 1; + + // Applies basic vulnerability scanning on the cluster. + VULNERABILITY_BASIC = 2; + } + + // Sets which mode to use for Security Posture features. + optional Mode mode = 1; + + // Sets which mode to use for vulnerability scanning. + optional VulnerabilityMode vulnerability_mode = 2; +} + +// Node pool configs that apply to all auto-provisioned node pools +// in autopilot clusters and node auto-provisioning enabled clusters. +message NodePoolAutoConfig { + // 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 creation. Each tag within the list + // must comply with RFC1035. + NetworkTags network_tags = 1; +} + +// Subset of Nodepool message that has defaults. +message NodePoolDefaults { + // Subset of NodeConfig message that has defaults. + NodeConfigDefaults node_config_defaults = 1; +} + +// Subset of NodeConfig message that has defaults. +message NodeConfigDefaults { + // GCFS (Google Container File System, also known as Riptide) options. + GcfsConfig gcfs_config = 1; + + // Logging configuration for node pools. + NodePoolLoggingConfig logging_config = 3; +} + +// 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. +message ClusterUpdate { + // 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 + string desired_node_version = 4; + + // The monitoring service the cluster should use to write metrics. + // Currently available options: + // + // * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring + // service with a Kubernetes-native resource model + // * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no + // longer available as of GKE 1.15). + // * `none` - No metrics will be exported from the cluster. + // + // If left as an empty string,`monitoring.googleapis.com/kubernetes` will be + // used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. + string desired_monitoring_service = 5; + + // Configurations for the various addons available to run in the cluster. + AddonsConfig desired_addons_config = 6; + + // 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. + string desired_node_pool_id = 7; + + // The desired image type for the node pool. + // NOTE: Set the "desired_node_pool" field as well. + string desired_image_type = 8; + + // Configuration of etcd encryption. + DatabaseEncryption desired_database_encryption = 46; + + // Configuration for Workload Identity. + WorkloadIdentityConfig desired_workload_identity_config = 47; + + // Configuration for issuance of mTLS keys and certificates to Kubernetes + // pods. + MeshCertificates desired_mesh_certificates = 67; + + // Configuration for Shielded Nodes. + ShieldedNodes desired_shielded_nodes = 48; + + // The desired configuration for the fine-grained cost management feature. + CostManagementConfig desired_cost_management_config = 49; + + // DNSConfig contains clusterDNS config for this cluster. + DNSConfig desired_dns_config = 53; + + // 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. + NodePoolAutoscaling desired_node_pool_autoscaling = 9; + + // The desired list of Google Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster's nodes should be located. + // + // This list must always include the cluster's primary zone. + // + // Warning: changing cluster locations will update the locations of all node + // pools and will result in nodes being added and/or removed. + repeated string desired_locations = 10; + + // The desired configuration options for master authorized networks feature. + MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12; + + // Cluster-level autoscaling configuration. + ClusterAutoscaling desired_cluster_autoscaling = 15; + + // The desired configuration options for the Binary Authorization feature. + BinaryAuthorization desired_binary_authorization = 16; + + // The logging service the cluster should use to write logs. + // Currently available options: + // + // * `logging.googleapis.com/kubernetes` - The Cloud Logging + // service with a Kubernetes-native resource model + // * `logging.googleapis.com` - The legacy Cloud Logging service (no longer + // available as of GKE 1.15). + // * `none` - no logs will be exported from the cluster. + // + // If left as an empty string,`logging.googleapis.com/kubernetes` will be + // used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. + string desired_logging_service = 19; + + // The desired configuration for exporting resource usage. + ResourceUsageExportConfig desired_resource_usage_export_config = 21; + + // Cluster-level Vertical Pod Autoscaling configuration. + VerticalPodAutoscaling desired_vertical_pod_autoscaling = 22; + + // The desired private cluster configuration. + PrivateClusterConfig desired_private_cluster_config = 25; + + // The desired config of Intra-node visibility. + IntraNodeVisibilityConfig desired_intra_node_visibility_config = 26; + + // The desired status of whether to disable default sNAT for this cluster. + DefaultSnatStatus desired_default_snat_status = 28; + + // The desired release channel configuration. + ReleaseChannel desired_release_channel = 31; + + // The desired L4 Internal Load Balancer Subsetting configuration. + ILBSubsettingConfig desired_l4ilb_subsetting_config = 39; + + // The desired datapath provider for the cluster. + DatapathProvider desired_datapath_provider = 50; + + // The desired state of IPv6 connectivity to Google Services. + PrivateIPv6GoogleAccess desired_private_ipv6_google_access = 51; + + // The desired notification configuration. + NotificationConfig desired_notification_config = 55; + + // The desired authenticator groups config for the cluster. + AuthenticatorGroupsConfig desired_authenticator_groups_config = 63; + + // The desired logging configuration. + LoggingConfig desired_logging_config = 64; + + // The desired monitoring configuration. + MonitoringConfig desired_monitoring_config = 65; + + // The desired Identity Service component configuration. + IdentityServiceConfig desired_identity_service_config = 66; + + // ServiceExternalIPsConfig specifies the config for the use of Services with + // ExternalIPs field. + ServiceExternalIPsConfig desired_service_external_ips_config = 60; + + // Enable/Disable private endpoint for the cluster's master. + optional bool desired_enable_private_endpoint = 71; + + // 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 + string desired_master_version = 100; + + // The desired GCFS config for the cluster + GcfsConfig desired_gcfs_config = 109; + + // The desired network tags that apply to all auto-provisioned node pools + // in autopilot clusters and node auto-provisioning enabled clusters. + NetworkTags desired_node_pool_auto_config_network_tags = 110; + + // The desired config of Gateway API on this cluster. + GatewayAPIConfig desired_gateway_api_config = 114; + + // The current etag of the cluster. + // If an etag is provided and does not match the current etag of the cluster, + // update will be blocked and an ABORTED error will be returned. + string etag = 115; + + // The desired node pool logging configuration defaults for the cluster. + NodePoolLoggingConfig desired_node_pool_logging_config = 116; + + // The desired fleet configuration for the cluster. + Fleet desired_fleet = 117; + + // The desired stack type of the cluster. + // If a stack type is provided and does not match the current stack type of + // the cluster, update will attempt to change the stack type to the new type. + StackType desired_stack_type = 119; + + // The additional pod ranges to be added to the cluster. These pod ranges + // can be used by node pools to allocate pod IPs. + AdditionalPodRangesConfig additional_pod_ranges_config = 120; + + // The additional pod ranges that are to be removed from the cluster. + // The pod ranges specified here must have been specified earlier in the + // 'additional_pod_ranges_config' argument. + AdditionalPodRangesConfig removed_additional_pod_ranges_config = 121; + + // Kubernetes open source beta apis enabled on the cluster. Only beta apis + K8sBetaAPIConfig enable_k8s_beta_apis = 122; + + // Enable/Disable Security Posture API features for the cluster. + SecurityPostureConfig desired_security_posture_config = 124; + + // The desired network performance config. + NetworkConfig.ClusterNetworkPerformanceConfig + desired_network_performance_config = 125; + + // Enable/Disable FQDN Network Policy for the cluster. + optional bool desired_enable_fqdn_network_policy = 126; + + // The desired workload policy configuration for the autopilot cluster. + WorkloadPolicyConfig desired_autopilot_workload_policy_config = 128; + + // Desired Beta APIs to be enabled for cluster. + K8sBetaAPIConfig desired_k8s_beta_apis = 131; +} + +// AdditionalPodRangesConfig is the configuration for additional pod secondary +// ranges supporting the ClusterUpdate message. +message AdditionalPodRangesConfig { + // Name for pod secondary ipv4 range which has the actual range defined ahead. + repeated string pod_range_names = 1; + + // Output only. [Output only] Information for additional pod range. + repeated RangeInfo pod_range_info = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// RangeInfo contains the range name and the range utilization by this cluster. +message RangeInfo { + // Output only. [Output only] Name of a range. + string range_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output only] The utilization of the range. + double utilization = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// This operation resource represents operations that may have happened or are +// happening on the cluster. All fields are output only. +message Operation { + // Current status of the operation. + enum Status { + // Not set. + STATUS_UNSPECIFIED = 0; + + // The operation has been created. + PENDING = 1; + + // The operation is currently running. + RUNNING = 2; + + // The operation is done, either cancelled or completed. + DONE = 3; + + // The operation is aborting. + ABORTING = 4; + } + + // Operation type categorizes the operation. + enum Type { + // Not set. + TYPE_UNSPECIFIED = 0; + + // The cluster is being created. The cluster should be assumed to be + // unusable until the operation finishes. + // + // In the event of the operation failing, the cluster will enter the [ERROR + // state][Cluster.Status.ERROR] and eventually be deleted. + CREATE_CLUSTER = 1; + + // The cluster is being deleted. The cluster should be assumed to be + // unusable as soon as this operation starts. + // + // In the event of the operation failing, the cluster will enter the [ERROR + // state][Cluster.Status.ERROR] and the deletion will be automatically + // retried until completed. + DELETE_CLUSTER = 2; + + // The [cluster + // version][google.container.v1.ClusterUpdate.desired_master_version] is + // being updated. Note that this includes "upgrades" to the same version, + // which are simply a recreation. This also includes + // [auto-upgrades](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades#upgrading_automatically). + // For more details, see [documentation on cluster + // upgrades](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades#cluster_upgrades). + UPGRADE_MASTER = 3; + + // A node pool is being updated. Despite calling this an "upgrade", this + // includes most forms of updates to node pools. This also includes + // [auto-upgrades](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-upgrades). + // + // This operation sets the + // [progress][google.container.v1.Operation.progress] field and may be + // [canceled][google.container.v1.ClusterManager.CancelOperation]. + // + // The upgrade strategy depends on [node pool + // configuration](https://cloud.google.com/kubernetes-engine/docs/concepts/node-pool-upgrade-strategies). + // The nodes are generally still usable during this operation. + UPGRADE_NODES = 4; + + // A problem has been detected with the control plane and is being repaired. + // This operation type is initiated by GKE. For more details, see + // [documentation on + // repairs](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#repairs). + REPAIR_CLUSTER = 5; + + // The cluster is being updated. This is a broad category of operations and + // includes operations that only change metadata as well as those that must + // recreate the entire cluster. If the control plane must be recreated, this + // will cause temporary downtime for zonal clusters. + // + // Some features require recreating the nodes as well. Those will be + // recreated as separate operations and the update may not be completely + // functional until the node pools recreations finish. Node recreations will + // generally follow [maintenance + // policies](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions). + // + // Some GKE-initiated operations use this type. This includes certain types + // of auto-upgrades and incident mitigations. + UPDATE_CLUSTER = 6; + + // A node pool is being created. The node pool should be assumed to be + // unusable until this operation finishes. In the event of an error, the + // node pool may be partially created. + // + // If enabled, [node + // autoprovisioning](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-provisioning) + // may have automatically initiated such operations. + CREATE_NODE_POOL = 7; + + // The node pool is being deleted. The node pool should be assumed to be + // unusable as soon as this operation starts. + DELETE_NODE_POOL = 8; + + // The node pool's [manamagent][google.container.v1.NodePool.management] + // field is being updated. These operations only update metadata and may be + // concurrent with most other operations. + SET_NODE_POOL_MANAGEMENT = 9; + + // A problem has been detected with nodes and [they are being + // repaired](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-repair). + // This operation type is initiated by GKE, typically automatically. This + // operation may be concurrent with other operations and there may be + // multiple repairs occurring on the same node pool. + AUTO_REPAIR_NODES = 10; + + // Unused. Automatic node upgrade uses + // [UPGRADE_NODES][google.container.v1.Operation.Type.UPGRADE_NODES]. + AUTO_UPGRADE_NODES = 11 [deprecated = true]; + + // Unused. Updating labels uses + // [UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER]. + SET_LABELS = 12 [deprecated = true]; + + // Unused. Updating master auth uses + // [UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER]. + SET_MASTER_AUTH = 13 [deprecated = true]; + + // The node pool is being resized. With the exception of resizing to or from + // size zero, the node pool is generally usable during this operation. + SET_NODE_POOL_SIZE = 14; + + // Unused. Updating network policy uses + // [UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER]. + SET_NETWORK_POLICY = 15 [deprecated = true]; + + // Unused. Updating maintenance policy uses + // [UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER]. + SET_MAINTENANCE_POLICY = 16 [deprecated = true]; + + // The control plane is being resized. This operation type is initiated by + // GKE. These operations are often performed preemptively to ensure that the + // control plane has sufficient resources and is not typically an indication + // of issues. For more details, see + // [documentation on + // resizes](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#repairs). + RESIZE_CLUSTER = 18; + } + + // The server-assigned ID for the operation. + string name = 1; + + // The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // operation is taking place. This field is deprecated, use location instead. + string zone = 2 [deprecated = true]; + + // The operation type. + Type operation_type = 3; + + // The current status of the operation. + Status status = 4; + + // Detailed operation progress, if available. + string detail = 8; + + // Output only. If an error has occurred, a textual description of the error. + // Deprecated. Use the field error instead. + string status_message = 5 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Server-defined URI for the operation. Example: + // `https://container.googleapis.com/v1alpha1/projects/123/locations/us-central1/operations/operation-123`. + string self_link = 6; + + // Server-defined URI for the target of the operation. The format of this is a + // URI to the resource being modified (such as a cluster, node pool, or node). + // For node pool repairs, there may be multiple nodes being repaired, but only + // one will be the target. + // + // Examples: + // + // - + // ## + // `https://container.googleapis.com/v1/projects/123/locations/us-central1/clusters/my-cluster` + // + // ## + // `https://container.googleapis.com/v1/projects/123/zones/us-central1-c/clusters/my-cluster/nodePools/my-np` + // + // `https://container.googleapis.com/v1/projects/123/zones/us-central1-c/clusters/my-cluster/nodePools/my-np/node/my-node` + string target_link = 7; + + // [Output only] The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) + // or + // [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) + // in which the cluster resides. + string location = 9; + + // [Output only] The time the operation started, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + string start_time = 10; + + // [Output only] The time the operation completed, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + string end_time = 11; + + // Output only. [Output only] Progress information for an operation. + OperationProgress progress = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Which conditions caused the current cluster state. + // Deprecated. Use field error instead. + repeated StatusCondition cluster_conditions = 13 [deprecated = true]; + + // Which conditions caused the current node pool state. + // Deprecated. Use field error instead. + repeated StatusCondition nodepool_conditions = 14 [deprecated = true]; + + // The error result of the operation in case of failure. + google.rpc.Status error = 15; +} + +// Information about operation (or operation stage) progress. +message OperationProgress { + // Progress metric is (string, int|float|string) pair. + message Metric { + // Required. Metric name, e.g., "nodes total", "percent done". + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Strictly one of the values is required. + oneof value { + // For metrics with integer value. + int64 int_value = 2; + + // For metrics with floating point value. + double double_value = 3; + + // For metrics with custom values (ratios, visual progress, etc.). + string string_value = 4; + } + } + + // A non-parameterized string describing an operation stage. + // Unset for single-stage operations. + string name = 1; + + // Status of an operation stage. + // Unset for single-stage operations. + Operation.Status status = 2; + + // Progress metric bundle, for example: + // metrics: [{name: "nodes done", int_value: 15}, + // {name: "nodes total", int_value: 32}] + // or + // metrics: [{name: "progress", double_value: 0.56}, + // {name: "progress scale", double_value: 1.0}] + repeated Metric metrics = 3; + + // Substages of an operation or a stage. + repeated OperationProgress stages = 4; +} + +// CreateClusterRequest creates a cluster. +message CreateClusterRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the parent field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the parent + // field. + string zone = 2 [deprecated = true]; + + // Required. A [cluster + // resource](https://cloud.google.com/container-engine/reference/rest/v1/projects.locations.clusters) + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // The parent (project and location) where the cluster will be created. + // Specified in the format `projects/*/locations/*`. + string parent = 5; +} + +// GetClusterRequest gets the settings of a cluster. +message GetClusterRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to retrieve. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // The name (project, location, cluster) of the cluster to retrieve. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 5; +} + +// UpdateClusterRequest updates the settings of a cluster. +message UpdateClusterRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Required. A description of the update. + ClusterUpdate update = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to update. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 5; +} + +// UpdateNodePoolRequests update a node pool's image and/or version. +message UpdateNodePoolRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Deprecated. The name of the node pool to upgrade. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 [deprecated = true]; + + // 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 + string node_version = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. The desired image type for the node pool. Please see + // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for + // available image types. + string image_type = 6 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster, node pool) of the node pool to + // update. Specified in the format + // `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 8; + + // The desired list of Google Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) in which the + // node pool's nodes should be located. Changing the locations for a node pool + // will result in nodes being either created or removed from the node pool, + // depending on whether locations are being added or removed. + repeated string locations = 13; + + // The desired workload metadata config for the node pool. + WorkloadMetadataConfig workload_metadata_config = 14; + + // Upgrade settings control disruption and speed of the upgrade. + NodePool.UpgradeSettings upgrade_settings = 15; + + // The desired network tags to be applied to all nodes in the node pool. + // If this field is not present, the tags will not be changed. Otherwise, + // the existing network tags will be *replaced* with the provided tags. + NetworkTags tags = 16; + + // The desired node taints to be applied to all nodes in the node pool. + // If this field is not present, the taints will not be changed. Otherwise, + // the existing node taints will be *replaced* with the provided taints. + NodeTaints taints = 17; + + // The desired node labels to be applied to all nodes in the node pool. + // If this field is not present, the labels will not be changed. Otherwise, + // the existing node labels will be *replaced* with the provided labels. + NodeLabels labels = 18; + + // Parameters that can be configured on Linux nodes. + LinuxNodeConfig linux_node_config = 19; + + // Node kubelet configs. + NodeKubeletConfig kubelet_config = 20; + + // Node network config. + NodeNetworkConfig node_network_config = 21; + + // GCFS config. + GcfsConfig gcfs_config = 22; + + // Confidential nodes config. + // All the nodes in the node pool will be Confidential VM once enabled. + ConfidentialNodes confidential_nodes = 23; + + // Enable or disable gvnic on the node pool. + VirtualNIC gvnic = 29; + + // The current etag of the node pool. + // If an etag is provided and does not match the current etag of the node + // pool, update will be blocked and an ABORTED error will be returned. + string etag = 30; + + // Enable or disable NCCL fast socket for the node pool. + FastSocket fast_socket = 31; + + // Logging configuration. + NodePoolLoggingConfig logging_config = 32; + + // The resource labels for the node pool to use to annotate any related + // Google Compute Engine resources. + ResourceLabels resource_labels = 33; + + // Parameters that can be configured on Windows nodes. + WindowsNodeConfig windows_node_config = 34; +} + +// SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool. +message SetNodePoolAutoscalingRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Deprecated. The name of the node pool to upgrade. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 [deprecated = true]; + + // Required. Autoscaling configuration for the node pool. + NodePoolAutoscaling autoscaling = 5 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster, node pool) of the node pool to set + // autoscaler settings. Specified in the format + // `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 6; +} + +// SetLoggingServiceRequest sets the logging service of a cluster. +message SetLoggingServiceRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Required. The logging service the cluster should use to write logs. + // Currently available options: + // + // * `logging.googleapis.com/kubernetes` - The Cloud Logging + // service with a Kubernetes-native resource model + // * `logging.googleapis.com` - The legacy Cloud Logging service (no longer + // available as of GKE 1.15). + // * `none` - no logs will be exported from the cluster. + // + // If left as an empty string,`logging.googleapis.com/kubernetes` will be + // used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. + string logging_service = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to set logging. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 5; +} + +// SetMonitoringServiceRequest sets the monitoring service of a cluster. +message SetMonitoringServiceRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Required. The monitoring service the cluster should use to write metrics. + // Currently available options: + // + // * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring + // service with a Kubernetes-native resource model + // * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no + // longer available as of GKE 1.15). + // * `none` - No metrics will be exported from the cluster. + // + // If left as an empty string,`monitoring.googleapis.com/kubernetes` will be + // used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. + string monitoring_service = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to set monitoring. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 6; +} + +// SetAddonsConfigRequest sets the addons associated with the cluster. +message SetAddonsConfigRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Required. The desired configurations for the various addons available to + // run in the cluster. + AddonsConfig addons_config = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to set addons. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 6; +} + +// SetLocationsRequest sets the locations of the cluster. +message SetLocationsRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Required. The desired list of Google Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) 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. + repeated string locations = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to set locations. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 6; +} + +// UpdateMasterRequest updates the master of the cluster. +message UpdateMasterRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // 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 + string master_version = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to update. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 7; +} + +// SetMasterAuthRequest updates the admin password of a cluster. +message SetMasterAuthRequest { + // Operation type: what type update to perform. + enum Action { + // Operation is unknown and will error out. + UNKNOWN = 0; + + // Set the password to a user generated value. + SET_PASSWORD = 1; + + // Generate a new password and set it to that. + GENERATE_PASSWORD = 2; + + // 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. + SET_USERNAME = 3; + } + + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Required. The exact form of action to be taken on the master auth. + Action action = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. A description of the update. + MasterAuth update = 5 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to set auth. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 7; +} + +// DeleteClusterRequest deletes a cluster. +message DeleteClusterRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to delete. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // The name (project, location, cluster) of the cluster to delete. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 4; +} + +// ListClustersRequest lists clusters. +message ListClustersRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the parent field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides, or "-" for all zones. This field has been deprecated and + // replaced by the parent field. + string zone = 2 [deprecated = true]; + + // The parent (project and location) where the clusters will be listed. + // Specified in the format `projects/*/locations/*`. + // Location "-" matches all zones and all regions. + string parent = 4; +} + +// ListClustersResponse is the result of ListClustersRequest. +message ListClustersResponse { + // A list of clusters in the project in the specified zone, or + // across all ones. + repeated Cluster clusters = 1; + + // If any zones are listed here, the list of clusters returned + // may be missing those zones. + repeated string missing_zones = 2; +} + +// GetOperationRequest gets a single operation. +message GetOperationRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The server-assigned `name` of the operation. + // This field has been deprecated and replaced by the name field. + string operation_id = 3 [deprecated = true]; + + // The name (project, location, operation id) of the operation to get. + // Specified in the format `projects/*/locations/*/operations/*`. + string name = 5; +} + +// ListOperationsRequest lists operations. +message ListOperationsRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the parent field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) to return + // operations for, or `-` for all zones. This field has been deprecated and + // replaced by the parent field. + string zone = 2 [deprecated = true]; + + // The parent (project and location) where the operations will be listed. + // Specified in the format `projects/*/locations/*`. + // Location "-" matches all zones and all regions. + string parent = 4; +} + +// CancelOperationRequest cancels a single operation. +message CancelOperationRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // operation resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The server-assigned `name` of the operation. + // This field has been deprecated and replaced by the name field. + string operation_id = 3 [deprecated = true]; + + // The name (project, location, operation id) of the operation to cancel. + // Specified in the format `projects/*/locations/*/operations/*`. + string name = 4; +} + +// ListOperationsResponse is the result of ListOperationsRequest. +message ListOperationsResponse { + // A list of operations in the project in the specified zone. + repeated Operation operations = 1; + + // If any zones are listed here, the list of operations returned + // may be missing the operations from those zones. + repeated string missing_zones = 2; +} + +// Gets the current Kubernetes Engine service configuration. +message GetServerConfigRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) to return + // operations for. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // The name (project and location) of the server config to get, + // specified in the format `projects/*/locations/*`. + string name = 4; +} + +// Kubernetes Engine service configuration. +message ServerConfig { + // ReleaseChannelConfig exposes configuration for a release channel. + message ReleaseChannelConfig { + // The release channel this configuration applies to. + ReleaseChannel.Channel channel = 1; + + // The default version for newly created clusters on the channel. + string default_version = 2; + + // List of valid versions for the channel. + repeated string valid_versions = 4; + } + + // Version of Kubernetes the service deploys by default. + string default_cluster_version = 1; + + // List of valid node upgrade target versions, in descending order. + repeated string valid_node_versions = 3; + + // Default image type. + string default_image_type = 4; + + // List of valid image types. + repeated string valid_image_types = 5; + + // List of valid master versions, in descending order. + repeated string valid_master_versions = 6; + + // List of release channel configurations. + repeated ReleaseChannelConfig channels = 9; +} + +// CreateNodePoolRequest creates a node pool for a cluster. +message CreateNodePoolRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the parent field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the parent + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the parent field. + string cluster_id = 3 [deprecated = true]; + + // Required. The node pool to create. + NodePool node_pool = 4 [(google.api.field_behavior) = REQUIRED]; + + // The parent (project, location, cluster name) where the node pool will be + // created. Specified in the format + // `projects/*/locations/*/clusters/*`. + string parent = 6; +} + +// DeleteNodePoolRequest deletes a node pool for a cluster. +message DeleteNodePoolRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Deprecated. The name of the node pool to delete. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 [deprecated = true]; + + // The name (project, location, cluster, node pool id) of the node pool to + // delete. Specified in the format + // `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 6; +} + +// ListNodePoolsRequest lists the node pool(s) for a cluster. +message ListNodePoolsRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the parent field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the parent + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the parent field. + string cluster_id = 3 [deprecated = true]; + + // The parent (project, location, cluster name) where the node pools will be + // listed. Specified in the format `projects/*/locations/*/clusters/*`. + string parent = 5; +} + +// GetNodePoolRequest retrieves a node pool for a cluster. +message GetNodePoolRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Deprecated. The name of the node pool. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 [deprecated = true]; + + // The name (project, location, cluster, node pool id) of the node pool to + // get. Specified in the format + // `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 6; +} + +// Settings for blue-green upgrade. +message BlueGreenSettings { + // Standard rollout policy is the default policy for blue-green. + message StandardRolloutPolicy { + // Blue pool size to drain in a batch. + oneof update_batch_size { + // Percentage of the blue pool nodes to drain in a batch. + // The range of this field should be (0.0, 1.0]. + float batch_percentage = 1; + + // Number of blue nodes to drain in a batch. + int32 batch_node_count = 2; + } + + // Soak time after each batch gets drained. Default to zero. + optional google.protobuf.Duration batch_soak_duration = 3; + } + + // The rollout policy controls the general rollout progress of blue-green. + oneof rollout_policy { + // Standard policy for the blue-green upgrade. + StandardRolloutPolicy standard_rollout_policy = 1; + } + + // Time needed after draining entire blue pool. After this period, blue pool + // will be cleaned up. + optional google.protobuf.Duration node_pool_soak_duration = 2; +} + +// 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. +message NodePool { + // These upgrade settings control the level of parallelism and the level of + // disruption caused by an upgrade. + // + // maxUnavailable controls the number of nodes that can be simultaneously + // unavailable. + // + // maxSurge controls the number of additional nodes that can be added to the + // node pool temporarily for the time of the upgrade to increase the number of + // available nodes. + // + // (maxUnavailable + maxSurge) determines the level of parallelism (how many + // nodes are being upgraded at the same time). + // + // Note: upgrades inevitably introduce some disruption since workloads need to + // be moved from old nodes to new, upgraded ones. Even if maxUnavailable=0, + // this holds true. (Disruption stays within the limits of + // PodDisruptionBudget, if it is configured.) + // + // Consider a hypothetical node pool with 5 nodes having maxSurge=2, + // maxUnavailable=1. This means the upgrade process upgrades 3 nodes + // simultaneously. It creates 2 additional (upgraded) nodes, then it brings + // down 3 old (not yet upgraded) nodes at the same time. This ensures that + // there are always at least 4 nodes available. + // + // These upgrade settings configure the upgrade strategy for the node pool. + // Use strategy to switch between the strategies applied to the node pool. + // + // If the strategy is ROLLING, use max_surge and max_unavailable to control + // the level of parallelism and the level of disruption caused by upgrade. + // 1. maxSurge controls the number of additional nodes that can be added to + // the node pool temporarily for the time of the upgrade to increase the + // number of available nodes. + // 2. maxUnavailable controls the number of nodes that can be simultaneously + // unavailable. + // 3. (maxUnavailable + maxSurge) determines the level of parallelism (how + // many nodes are being upgraded at the same time). + // + // If the strategy is BLUE_GREEN, use blue_green_settings to configure the + // blue-green upgrade related settings. + // 1. standard_rollout_policy is the default policy. The policy is used to + // control the way blue pool gets drained. The draining is executed in the + // batch mode. The batch size could be specified as either percentage of the + // node pool size or the number of nodes. batch_soak_duration is the soak + // time after each batch gets drained. + // 2. node_pool_soak_duration is the soak time after all blue nodes are + // drained. After this period, the blue pool nodes will be deleted. + message UpgradeSettings { + // The maximum number of nodes that can be created beyond the current size + // of the node pool during the upgrade process. + int32 max_surge = 1; + + // The maximum number of nodes that can be simultaneously unavailable during + // the upgrade process. A node is considered available if its status is + // Ready. + int32 max_unavailable = 2; + + // Update strategy of the node pool. + optional NodePoolUpdateStrategy strategy = 3; + + // Settings for blue-green upgrade strategy. + optional BlueGreenSettings blue_green_settings = 4; + } + + // UpdateInfo contains resource (instance groups, etc), status and other + // intermediate information relevant to a node pool upgrade. + message UpdateInfo { + // Information relevant to blue-green upgrade. + message BlueGreenInfo { + // Phase represents the different stages blue-green upgrade is running in. + enum Phase { + // Unspecified phase. + PHASE_UNSPECIFIED = 0; + + // blue-green upgrade has been initiated. + UPDATE_STARTED = 1; + + // Start creating green pool nodes. + CREATING_GREEN_POOL = 2; + + // Start cordoning blue pool nodes. + CORDONING_BLUE_POOL = 3; + + // Start draining blue pool nodes. + DRAINING_BLUE_POOL = 4; + + // Start soaking time after draining entire blue pool. + NODE_POOL_SOAKING = 5; + + // Start deleting blue nodes. + DELETING_BLUE_POOL = 6; + + // Rollback has been initiated. + ROLLBACK_STARTED = 7; + } + + // Current blue-green upgrade phase. + Phase phase = 1; + + // The resource URLs of the [managed instance groups] + // (/compute/docs/instance-groups/creating-groups-of-managed-instances) + // associated with blue pool. + repeated string blue_instance_group_urls = 2; + + // The resource URLs of the [managed instance groups] + // (/compute/docs/instance-groups/creating-groups-of-managed-instances) + // associated with green pool. + repeated string green_instance_group_urls = 3; + + // Time to start deleting blue pool to complete blue-green upgrade, + // in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + string blue_pool_deletion_start_time = 4; + + // Version of green pool. + string green_pool_version = 5; + } + + // Information of a blue-green upgrade. + BlueGreenInfo blue_green_info = 1; + } + + // The current status of the node pool instance. + enum Status { + // Not set. + STATUS_UNSPECIFIED = 0; + + // The PROVISIONING state indicates the node pool is being created. + PROVISIONING = 1; + + // The RUNNING state indicates the node pool has been created + // and is fully usable. + RUNNING = 2; + + // 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. + RUNNING_WITH_ERROR = 3; + + // 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. + RECONCILING = 4; + + // The STOPPING state indicates the node pool is being deleted. + STOPPING = 5; + + // The ERROR state indicates the node pool may be unusable. Details + // can be found in the `statusMessage` field. + ERROR = 6; + } + + // PlacementPolicy defines the placement policy used by the node pool. + message PlacementPolicy { + // Type defines the type of placement policy. + enum Type { + // TYPE_UNSPECIFIED specifies no requirements on nodes + // placement. + TYPE_UNSPECIFIED = 0; + + // COMPACT specifies node placement in the same availability domain to + // ensure low communication latency. + COMPACT = 1; + } + + // The type of placement. + Type type = 1; + } + + // The name of the node pool. + string name = 1; + + // The node configuration of the pool. + NodeConfig config = 2; + + // The initial node count for the pool. You must ensure that your + // 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; + + // The list of Google Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) in which the + // NodePool's nodes should be located. + // + // If this value is unspecified during node pool creation, the + // [Cluster.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters#Cluster.FIELDS.locations) + // value will be used, instead. + // + // Warning: changing node pool locations will result in nodes being added + // and/or removed. + repeated string locations = 13; + + // Networking configuration for this NodePool. If specified, it overrides the + // cluster-level defaults. + NodeNetworkConfig network_config = 14; + + // [Output only] Server-defined URL for the resource. + string self_link = 100; + + // The version of Kubernetes running on this NodePool's nodes. If unspecified, + // it defaults as described + // [here](https://cloud.google.com/kubernetes-engine/versioning#specifying_node_version). + string version = 101; + + // [Output only] The resource URLs of the [managed instance + // groups](https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-managed-instances) + // associated with this node pool. + // During the node pool blue-green upgrade operation, the URLs contain both + // blue and green resources. + repeated string instance_group_urls = 102; + + // [Output only] The status of the nodes in this pool instance. + Status status = 103; + + // [Output only] Deprecated. Use conditions instead. + // Additional information about the current status of this + // node pool instance, if available. + string status_message = 104 [deprecated = true]; + + // Autoscaler configuration for this NodePool. Autoscaler is enabled + // only if a valid configuration is present. + NodePoolAutoscaling autoscaling = 4; + + // NodeManagement configuration for this NodePool. + NodeManagement management = 5; + + // The constraint on the maximum number of pods that can be run + // simultaneously on a node in the node pool. + MaxPodsConstraint max_pods_constraint = 6; + + // Which conditions caused the current node pool state. + repeated StatusCondition conditions = 105; + + // [Output only] The pod CIDR block size per node in this node pool. + int32 pod_ipv4_cidr_size = 7; + + // Upgrade settings control disruption and speed of the upgrade. + UpgradeSettings upgrade_settings = 107; + + // Specifies the node placement policy. + PlacementPolicy placement_policy = 108; + + // Output only. [Output only] Update info contains relevant information during + // a node pool update. + UpdateInfo update_info = 109 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // This checksum is computed by the server based on the value of node pool + // fields, and may be sent on update requests to ensure the client has an + // up-to-date value before proceeding. + string etag = 110; + + // Enable best effort provisioning for nodes + BestEffortProvisioning best_effort_provisioning = 113; +} + +// NodeManagement defines the set of node management services turned on for the +// node pool. +message NodeManagement { + // 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. + bool auto_upgrade = 1; + + // 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. + bool auto_repair = 2; + + // Specifies the Auto Upgrade knobs for the node pool. + AutoUpgradeOptions upgrade_options = 10; +} + +// Best effort provisioning. +message BestEffortProvisioning { + // When this is enabled, cluster/node pool creations will ignore non-fatal + // errors like stockout to best provision as many nodes as possible right now + // and eventually bring up all target number of nodes + bool enabled = 1; + + // Minimum number of nodes to be provisioned to be considered as succeeded, + // and the rest of nodes will be provisioned gradually and eventually when + // stockout issue has been resolved. + int32 min_provision_nodes = 2; +} + +// AutoUpgradeOptions defines the set of options for the user to control how +// the Auto Upgrades will proceed. +message AutoUpgradeOptions { + // [Output only] This field is set when upgrades are about to commence + // with the approximate start time for the upgrades, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + string auto_upgrade_start_time = 1; + + // [Output only] This field is set when upgrades are about to commence + // with the description of the upgrade. + string description = 2; +} + +// MaintenancePolicy defines the maintenance policy to be used for the cluster. +message MaintenancePolicy { + // Specifies the maintenance window in which maintenance may be performed. + MaintenanceWindow window = 1; + + // 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. + string resource_version = 3; +} + +// MaintenanceWindow defines the maintenance window to be used for the cluster. +message MaintenanceWindow { + oneof policy { + // DailyMaintenanceWindow specifies a daily maintenance operation window. + DailyMaintenanceWindow daily_maintenance_window = 2; + + // 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. + RecurringTimeWindow recurring_window = 3; + } + + // Exceptions to maintenance window. Non-emergency maintenance should not + // occur in these windows. + map maintenance_exclusions = 4; +} + +// Represents an arbitrary window of time. +message TimeWindow { + oneof options { + // MaintenanceExclusionOptions provides maintenance exclusion related + // options. + MaintenanceExclusionOptions maintenance_exclusion_options = 3; + } + + // The time that the window first starts. + google.protobuf.Timestamp start_time = 1; + + // The time that the window ends. The end time should take place after the + // start time. + google.protobuf.Timestamp end_time = 2; +} + +// Represents the Maintenance exclusion option. +message MaintenanceExclusionOptions { + // Scope of exclusion. + enum Scope { + // NO_UPGRADES excludes all upgrades, including patch upgrades and minor + // upgrades across control planes and nodes. This is the default exclusion + // behavior. + NO_UPGRADES = 0; + + // NO_MINOR_UPGRADES excludes all minor upgrades for the cluster, only + // patches are allowed. + NO_MINOR_UPGRADES = 1; + + // NO_MINOR_OR_NODE_UPGRADES excludes all minor upgrades for the cluster, + // and also exclude all node pool upgrades. Only control + // plane patches are allowed. + NO_MINOR_OR_NODE_UPGRADES = 2; + } + + // Scope specifies the upgrade scope which upgrades are blocked by the + // exclusion. + Scope scope = 1; +} + +// Represents an arbitrary window of time that recurs. +message RecurringTimeWindow { + // The window of the first recurrence. + TimeWindow window = 1; + + // 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. + string recurrence = 2; +} + +// Time window specified for daily maintenance operations. +message DailyMaintenanceWindow { + // Time within the maintenance window to start the maintenance operations. + // Time format should be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) + // format "HH:MM", where HH : [00-23] and MM : [00-59] GMT. + string start_time = 2; + + // [Output only] Duration of the time window, automatically chosen to be + // smallest possible in the given scenario. + // Duration will be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) + // format "PTnHnMnS". + string duration = 3; +} + +// SetNodePoolManagementRequest sets the node management properties of a node +// pool. +message SetNodePoolManagementRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to update. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Deprecated. The name of the node pool to update. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 [deprecated = true]; + + // Required. NodeManagement configuration for the node pool. + NodeManagement management = 5 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster, node pool id) of the node pool to set + // management properties. Specified in the format + // `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 7; +} + +// SetNodePoolSizeRequest sets the size of a node pool. +message SetNodePoolSizeRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to update. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Deprecated. The name of the node pool to update. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 [deprecated = true]; + + // Required. The desired node count for the pool. + int32 node_count = 5 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster, node pool id) of the node pool to set + // size. + // Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 7; +} + +// CompleteNodePoolUpgradeRequest sets the name of target node pool to complete +// upgrade. +message CompleteNodePoolUpgradeRequest { + // The name (project, location, cluster, node pool id) of the node pool to + // complete upgrade. + // Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 1; +} + +// RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed +// NodePool upgrade. This will be an no-op if the last upgrade successfully +// completed. +message RollbackNodePoolUpgradeRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to rollback. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Deprecated. The name of the node pool to rollback. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 [deprecated = true]; + + // The name (project, location, cluster, node pool id) of the node poll to + // rollback upgrade. + // Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 6; + + // Option for rollback to ignore the PodDisruptionBudget. + // Default value is false. + bool respect_pdb = 7; +} + +// ListNodePoolsResponse is the result of ListNodePoolsRequest. +message ListNodePoolsResponse { + // A list of node pools for a cluster. + repeated NodePool node_pools = 1; +} + +// 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. +message ClusterAutoscaling { + // Defines possible options for autoscaling_profile field. + enum AutoscalingProfile { + // No change to autoscaling configuration. + PROFILE_UNSPECIFIED = 0; + + // Prioritize optimizing utilization of resources. + OPTIMIZE_UTILIZATION = 1; + + // Use default (balanced) autoscaling configuration. + BALANCED = 2; + } + + // Enables automatic node pool creation and deletion. + bool enable_node_autoprovisioning = 1; + + // Contains global constraints regarding minimum and maximum + // amount of resources in the cluster. + repeated ResourceLimit resource_limits = 2; + + // Defines autoscaling behaviour. + AutoscalingProfile autoscaling_profile = 3; + + // AutoprovisioningNodePoolDefaults contains defaults for a node pool + // created by NAP. + AutoprovisioningNodePoolDefaults autoprovisioning_node_pool_defaults = 4; + + // The list of Google Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) in which the + // NodePool's nodes can be created by NAP. + repeated string autoprovisioning_locations = 5; +} + +// AutoprovisioningNodePoolDefaults contains defaults for a node pool created +// by NAP. +message AutoprovisioningNodePoolDefaults { + // Scopes that are used by NAP when creating node pools. + repeated string oauth_scopes = 1; + + // The Google Cloud Platform Service Account to be used by the node VMs. + string service_account = 2; + + // Specifies the upgrade settings for NAP created node pools + NodePool.UpgradeSettings upgrade_settings = 3; + + // Specifies the node management options for NAP created node-pools. + NodeManagement management = 4; + + // Deprecated. Minimum CPU platform to be used for NAP created node pools. + // 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](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform). + // This field is deprecated, min_cpu_platform should be specified using + // `cloud.google.com/requested-min-cpu-platform` label selector on the pod. + // To unset the min cpu platform field pass "automatic" + // as field value. + string min_cpu_platform = 5 [deprecated = true]; + + // 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. + int32 disk_size_gb = 6; + + // Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or + // 'pd-balanced') + // + // If unspecified, the default disk type is 'pd-standard' + string disk_type = 7; + + // Shielded Instance options. + ShieldedInstanceConfig shielded_instance_config = 8; + + // The Customer Managed Encryption Key used to encrypt the boot disk attached + // to each node in the node pool. This should be of the form + // projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. + // For more information about protecting resources with Cloud KMS Keys please + // see: + // https://cloud.google.com/compute/docs/disks/customer-managed-encryption + string boot_disk_kms_key = 9; + + // The image type to use for NAP created node. Please see + // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for + // available image types. + string image_type = 10; + + // Enable or disable Kubelet read only port. + optional bool insecure_kubelet_readonly_port_enabled = 13; +} + +// Contains information about amount of some resource in the cluster. +// For memory, value should be in GB. +message ResourceLimit { + // Resource name "cpu", "memory" or gpu-specific string. + string resource_type = 1; + + // Minimum amount of the resource in the cluster. + int64 minimum = 2; + + // Maximum amount of the resource in the cluster. + int64 maximum = 3; +} + +// NodePoolAutoscaling contains information required by cluster autoscaler to +// adjust the size of the node pool to the current cluster usage. +message NodePoolAutoscaling { + // Location policy specifies how zones are picked when scaling up the + // nodepool. + enum LocationPolicy { + // Not set. + LOCATION_POLICY_UNSPECIFIED = 0; + + // BALANCED is a best effort policy that aims to balance the sizes of + // different zones. + BALANCED = 1; + + // ANY policy picks zones that have the highest capacity available. + ANY = 2; + } + + // Is autoscaling enabled for this node pool. + bool enabled = 1; + + // Minimum number of nodes for one location in the NodePool. Must be >= 1 and + // <= max_node_count. + int32 min_node_count = 2; + + // Maximum number of nodes for one location in the NodePool. Must be >= + // min_node_count. There has to be enough quota to scale up the cluster. + int32 max_node_count = 3; + + // Can this node pool be deleted automatically. + bool autoprovisioned = 4; + + // Location policy used when scaling up a nodepool. + LocationPolicy location_policy = 5; + + // Minimum number of nodes in the node pool. Must be greater than 1 less than + // total_max_node_count. + // The total_*_node_count fields are mutually exclusive with the *_node_count + // fields. + int32 total_min_node_count = 6; + + // Maximum number of nodes in the node pool. Must be greater than + // total_min_node_count. There has to be enough quota to scale up the cluster. + // The total_*_node_count fields are mutually exclusive with the *_node_count + // fields. + int32 total_max_node_count = 7; +} + +// 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 +message SetLabelsRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Required. The labels to set for that cluster. + map resource_labels = 4 + [(google.api.field_behavior) = REQUIRED]; + + // 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. + string label_fingerprint = 5 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster name) of the cluster to set labels. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 7; +} + +// SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for +// a cluster. +message SetLegacyAbacRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster to update. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Required. Whether ABAC authorization will be enabled in the cluster. + bool enabled = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster name) of the cluster to set legacy + // abac. Specified in the format `projects/*/locations/*/clusters/*`. + string name = 6; +} + +// StartIPRotationRequest creates a new IP for the cluster and then performs +// a node upgrade on each node pool to point to the new IP. +message StartIPRotationRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // The name (project, location, cluster name) of the cluster to start IP + // rotation. Specified in the format `projects/*/locations/*/clusters/*`. + string name = 6; + + // Whether to rotate credentials during IP rotation. + bool rotate_credentials = 7; +} + +// CompleteIPRotationRequest moves the cluster master back into single-IP mode. +message CompleteIPRotationRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // The name (project, location, cluster name) of the cluster to complete IP + // rotation. Specified in the format `projects/*/locations/*/clusters/*`. + string name = 7; +} + +// AcceleratorConfig represents a Hardware Accelerator request. +message AcceleratorConfig { + // The number of the accelerator cards exposed to an instance. + int64 accelerator_count = 1; + + // The accelerator type resource name. List of supported accelerators + // [here](https://cloud.google.com/compute/docs/gpus) + string accelerator_type = 2; + + // Size of partitions to create on the GPU. Valid values are described in the + // NVIDIA [mig user + // guide](https://docs.nvidia.com/datacenter/tesla/mig-user-guide/#partitioning). + string gpu_partition_size = 3; + + // The configuration for GPU sharing options. + optional GPUSharingConfig gpu_sharing_config = 5; + + // The configuration for auto installation of GPU driver. + optional GPUDriverInstallationConfig gpu_driver_installation_config = 6; +} + +// GPUSharingConfig represents the GPU sharing configuration for Hardware +// Accelerators. +message GPUSharingConfig { + // The type of GPU sharing strategy currently provided. + enum GPUSharingStrategy { + // Default value. + GPU_SHARING_STRATEGY_UNSPECIFIED = 0; + + // GPUs are time-shared between containers. + TIME_SHARING = 1; + } + + // The max number of containers that can share a physical GPU. + int64 max_shared_clients_per_gpu = 1; + + // The type of GPU sharing strategy to enable on the GPU node. + optional GPUSharingStrategy gpu_sharing_strategy = 2; +} + +// GPUDriverInstallationConfig specifies the version of GPU driver to be auto +// installed. +message GPUDriverInstallationConfig { + // The GPU driver version to install. + enum GPUDriverVersion { + // Default value is to not install any GPU driver. + GPU_DRIVER_VERSION_UNSPECIFIED = 0; + + // Disable GPU driver auto installation and needs manual installation + INSTALLATION_DISABLED = 1; + + // "Default" GPU driver in COS and Ubuntu. + DEFAULT = 2; + + // "Latest" GPU driver in COS. + LATEST = 3; + } + + // Mode for how the GPU driver is installed. + optional GPUDriverVersion gpu_driver_version = 1; +} + +// WorkloadMetadataConfig defines the metadata configuration to expose to +// workloads on the node pool. +message WorkloadMetadataConfig { + // Mode is the configuration for how to expose metadata to workloads running + // on the node. + enum Mode { + // Not set. + MODE_UNSPECIFIED = 0; + + // Expose all Compute Engine metadata to pods. + GCE_METADATA = 1; + + // Run the GKE Metadata Server on this node. The GKE Metadata Server exposes + // a metadata API to workloads that is compatible with the V1 Compute + // Metadata APIs exposed by the Compute Engine and App Engine Metadata + // Servers. This feature can only be enabled if Workload Identity is enabled + // at the cluster level. + GKE_METADATA = 2; + } + + // Mode is the configuration for how to expose metadata to workloads running + // on the node pool. + Mode mode = 2; +} + +// SetNetworkPolicyRequest enables/disables network policy for a cluster. +message SetNetworkPolicyRequest { + // Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 [deprecated = true]; + + // Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true]; + + // Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 [deprecated = true]; + + // Required. Configuration options for the NetworkPolicy feature. + NetworkPolicy network_policy = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster name) of the cluster to set networking + // policy. Specified in the format `projects/*/locations/*/clusters/*`. + string name = 6; +} + +// SetMaintenancePolicyRequest sets the maintenance policy for a cluster. +message SetMaintenancePolicyRequest { + // Required. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. + string zone = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the cluster to update. + string cluster_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The maintenance policy to be set for the cluster. An empty field + // clears the existing maintenance policy. + MaintenancePolicy maintenance_policy = 4 + [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster name) of the cluster to set + // maintenance policy. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 5; +} + +// StatusCondition describes why a cluster or a node pool has a certain status +// (e.g., ERROR or DEGRADED). +message StatusCondition { + // Code for each condition + enum Code { + // UNKNOWN indicates a generic condition. + UNKNOWN = 0; + + // GCE_STOCKOUT indicates that Google Compute Engine resources are + // temporarily unavailable. + GCE_STOCKOUT = 1; + + // GKE_SERVICE_ACCOUNT_DELETED indicates that the user deleted their robot + // service account. + GKE_SERVICE_ACCOUNT_DELETED = 2; + + // Google Compute Engine quota was exceeded. + GCE_QUOTA_EXCEEDED = 3; + + // Cluster state was manually changed by an SRE due to a system logic error. + SET_BY_OPERATOR = 4; + + // Unable to perform an encrypt operation against the CloudKMS key used for + // etcd level encryption. + CLOUD_KMS_KEY_ERROR = 7; + + // Cluster CA is expiring soon. + CA_EXPIRING = 9; + } + + // Machine-friendly representation of the condition + // Deprecated. Use canonical_code instead. + Code code = 1 [deprecated = true]; + + // Human-friendly representation of the condition + string message = 2; + + // Canonical code of the condition. + google.rpc.Code canonical_code = 3; +} + +// NetworkConfig reports the relative names of network & subnetwork. +message NetworkConfig { + // Configuration of network bandwidth tiers + message ClusterNetworkPerformanceConfig { + // Node network tier + enum Tier { + // Default value + TIER_UNSPECIFIED = 0; + + // Higher bandwidth, actual values based on VM size. + TIER_1 = 1; + } + + // Specifies the total network bandwidth tier for NodePools in the cluster. + optional Tier total_egress_bandwidth_tier = 1; + } + + // Output only. The relative name of the Google Compute Engine + // [network][google.container.v1.NetworkConfig.network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) + // to which the cluster is connected. Example: + // projects/my-project/global/networks/my-network + string network = 1; + + // Output only. The relative name of the Google Compute Engine + // [subnetwork](https://cloud.google.com/compute/docs/vpc) to which the + // cluster is connected. Example: + // projects/my-project/regions/us-central1/subnetworks/my-subnet + string subnetwork = 2; + + // Whether Intra-node visibility is enabled for this cluster. + // This makes same node pod to pod traffic visible for VPC network. + bool enable_intra_node_visibility = 5; + + // Whether the cluster disables default in-node sNAT rules. In-node sNAT rules + // will be disabled when default_snat_status is disabled. When disabled is set + // to false, default IP masquerade rules will be applied to the nodes to + // prevent sNAT on cluster internal traffic. + DefaultSnatStatus default_snat_status = 7; + + // Whether L4ILB Subsetting is enabled for this cluster. + bool enable_l4ilb_subsetting = 10; + + // The desired datapath provider for this cluster. By default, uses the + // IPTables-based kube-proxy implementation. + DatapathProvider datapath_provider = 11; + + // The desired state of IPv6 connectivity to Google Services. + // By default, no private IPv6 access to or from Google Services (all access + // will be via IPv4) + PrivateIPv6GoogleAccess private_ipv6_google_access = 12; + + // DNSConfig contains clusterDNS config for this cluster. + DNSConfig dns_config = 13; + + // ServiceExternalIPsConfig specifies if services with externalIPs field are + // blocked or not. + ServiceExternalIPsConfig service_external_ips_config = 15; + + // GatewayAPIConfig contains the desired config of Gateway API on this + // cluster. + GatewayAPIConfig gateway_api_config = 16; + + // Network bandwidth tier configuration. + ClusterNetworkPerformanceConfig network_performance_config = 18; + + // Whether FQDN Network Policy is enabled on this cluster. + optional bool enable_fqdn_network_policy = 19; +} + +// GatewayAPIConfig contains the desired config of Gateway API on this cluster. +message GatewayAPIConfig { + // Channel describes if/how Gateway API should be installed and implemented in + // a cluster. + enum Channel { + // Default value. + CHANNEL_UNSPECIFIED = 0; + + // Gateway API support is disabled + CHANNEL_DISABLED = 1; + + // Gateway API support is enabled, experimental CRDs are installed + CHANNEL_EXPERIMENTAL = 3; + + // Gateway API support is enabled, standard CRDs are installed + CHANNEL_STANDARD = 4; + } + + // The Gateway API release channel to use for Gateway API. + Channel channel = 1; +} + +// Config to block services with externalIPs field. +message ServiceExternalIPsConfig { + // Whether Services with ExternalIPs field are allowed or not. + bool enabled = 1; +} + +// GetOpenIDConfigRequest gets the OIDC discovery document for the +// cluster. See the OpenID Connect Discovery 1.0 specification for details. +message GetOpenIDConfigRequest { + // The cluster (project, location, cluster name) to get the discovery document + // for. Specified in the format `projects/*/locations/*/clusters/*`. + string parent = 1; +} + +// GetOpenIDConfigResponse is an OIDC discovery document for the cluster. +// See the OpenID Connect Discovery 1.0 specification for details. +message GetOpenIDConfigResponse { + // OIDC Issuer. + string issuer = 1; + + // JSON Web Key uri. + string jwks_uri = 2; + + // Supported response types. + repeated string response_types_supported = 3; + + // Supported subject types. + repeated string subject_types_supported = 4; + + // supported ID Token signing Algorithms. + repeated string id_token_signing_alg_values_supported = 5; + + // Supported claims. + repeated string claims_supported = 6; + + // Supported grant types. + repeated string grant_types = 7; +} + +// GetJSONWebKeysRequest gets the public component of the keys used by the +// cluster to sign token requests. This will be the jwks_uri for the discover +// document returned by getOpenIDConfig. See the OpenID Connect +// Discovery 1.0 specification for details. +message GetJSONWebKeysRequest { + // The cluster (project, location, cluster name) to get keys for. Specified in + // the format `projects/*/locations/*/clusters/*`. + string parent = 1; +} + +// Jwk is a JSON Web Key as specified in RFC 7517 +message Jwk { + // Key Type. + string kty = 1; + + // Algorithm. + string alg = 2; + + // Permitted uses for the public keys. + string use = 3; + + // Key ID. + string kid = 4; + + // Used for RSA keys. + string n = 5; + + // Used for RSA keys. + string e = 6; + + // Used for ECDSA keys. + string x = 7; + + // Used for ECDSA keys. + string y = 8; + + // Used for ECDSA keys. + string crv = 9; +} + +// GetJSONWebKeysResponse is a valid JSON Web Key Set as specififed in rfc 7517 +message GetJSONWebKeysResponse { + // The public component of the keys used by the cluster to sign token + // requests. + repeated Jwk keys = 1; +} + +// CheckAutopilotCompatibilityRequest requests getting the blockers for the +// given operation in the cluster. +message CheckAutopilotCompatibilityRequest { + // The name (project, location, cluster) of the cluster to retrieve. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 1; +} + +// AutopilotCompatibilityIssue contains information about a specific +// compatibility issue with Autopilot mode. +message AutopilotCompatibilityIssue { + // The type of the reported issue. + enum IssueType { + // Default value, should not be used. + UNSPECIFIED = 0; + + // Indicates that the issue is a known incompatibility between the + // cluster and Autopilot mode. + INCOMPATIBILITY = 1; + + // Indicates the issue is an incompatibility if customers take no further + // action to resolve. + ADDITIONAL_CONFIG_REQUIRED = 2; + + // Indicates the issue is not an incompatibility, but depending on the + // workloads business logic, there is a potential that they won't work on + // Autopilot. + PASSED_WITH_OPTIONAL_CONFIG = 3; + } + + // The last time when this issue was observed. + google.protobuf.Timestamp last_observation = 1; + + // The constraint type of the issue. + string constraint_type = 2; + + // The incompatibility type of this issue. + IssueType incompatibility_type = 3; + + // The name of the resources which are subject to this issue. + repeated string subjects = 4; + + // A URL to a public documnetation, which addresses resolving this issue. + string documentation_url = 5; + + // The description of the issue. + string description = 6; +} + +// CheckAutopilotCompatibilityResponse has a list of compatibility issues. +message CheckAutopilotCompatibilityResponse { + // The list of issues for the given operation. + repeated AutopilotCompatibilityIssue issues = 1; + + // The summary of the autopilot compatibility response. + string summary = 2; +} + +// ReleaseChannel indicates which release channel a cluster is +// subscribed to. Release channels are arranged in order of risk. +// +// When a cluster is subscribed to a release channel, Google maintains +// both the master version and the node version. Node auto-upgrade +// defaults to true and cannot be disabled. +message ReleaseChannel { + // Possible values for 'channel'. + enum Channel { + // No channel specified. + UNSPECIFIED = 0; + + // RAPID channel is offered on an early access basis for customers who want + // to test new releases. + // + // WARNING: Versions available in the RAPID Channel may be subject to + // unresolved issues with no known workaround and are not subject to any + // SLAs. + RAPID = 1; + + // Clusters subscribed to REGULAR receive versions that are considered GA + // quality. REGULAR is intended for production users who want to take + // advantage of new features. + REGULAR = 2; + + // Clusters subscribed to STABLE receive versions that are known to be + // stable and reliable in production. + STABLE = 3; + } + + // channel specifies which release channel the cluster is subscribed to. + Channel channel = 1; +} + +// Configuration for fine-grained cost management feature. +message CostManagementConfig { + // Whether the feature is enabled or not. + bool enabled = 1; +} + +// IntraNodeVisibilityConfig contains the desired config of the intra-node +// visibility on this cluster. +message IntraNodeVisibilityConfig { + // Enables intra node visibility for this cluster. + bool enabled = 1; +} + +// ILBSubsettingConfig contains the desired config of L4 Internal LoadBalancer +// subsetting on this cluster. +message ILBSubsettingConfig { + // Enables l4 ILB subsetting for this cluster. + bool enabled = 1; +} + +// DNSConfig contains the desired set of options for configuring clusterDNS. +message DNSConfig { + // Provider lists the various in-cluster DNS providers. + enum Provider { + // Default value + PROVIDER_UNSPECIFIED = 0; + + // Use GKE default DNS provider(kube-dns) for DNS resolution. + PLATFORM_DEFAULT = 1; + + // Use CloudDNS for DNS resolution. + CLOUD_DNS = 2; + + // Use KubeDNS for DNS resolution. + KUBE_DNS = 3; + } + + // DNSScope lists the various scopes of access to cluster DNS records. + enum DNSScope { + // Default value, will be inferred as cluster scope. + DNS_SCOPE_UNSPECIFIED = 0; + + // DNS records are accessible from within the cluster. + CLUSTER_SCOPE = 1; + + // DNS records are accessible from within the VPC. + VPC_SCOPE = 2; + } + + // cluster_dns indicates which in-cluster DNS provider should be used. + Provider cluster_dns = 1; + + // cluster_dns_scope indicates the scope of access to cluster DNS records. + DNSScope cluster_dns_scope = 2; + + // cluster_dns_domain is the suffix used for all cluster service records. + string cluster_dns_domain = 3; +} + +// Constraints applied to pods. +message MaxPodsConstraint { + // Constraint enforced on the max num of pods per node. + int64 max_pods_per_node = 1; +} + +// Configuration for the use of Kubernetes Service Accounts in GCP IAM +// policies. +message WorkloadIdentityConfig { + // The workload pool to attach all Kubernetes service accounts to. + string workload_pool = 2; +} + +// IdentityServiceConfig is configuration for Identity Service which allows +// customers to use external identity providers with the K8S API +message IdentityServiceConfig { + // Whether to enable the Identity Service component + bool enabled = 1; +} + +// Configuration for issuance of mTLS keys and certificates to Kubernetes pods. +message MeshCertificates { + // enable_certificates controls issuance of workload mTLS certificates. + // + // If set, the GKE Workload Identity Certificates controller and node agent + // will be deployed in the cluster, which can then be configured by creating a + // WorkloadCertificateConfig Custom Resource. + // + // Requires Workload Identity + // ([workload_pool][google.container.v1.WorkloadIdentityConfig.workload_pool] + // must be non-empty). + google.protobuf.BoolValue enable_certificates = 1; +} + +// Configuration of etcd encryption. +message DatabaseEncryption { + // State of etcd encryption. + enum State { + // Should never be set + UNKNOWN = 0; + + // Secrets in etcd are encrypted. + ENCRYPTED = 1; + + // Secrets in etcd are stored in plain text (at etcd level) - this is + // unrelated to Compute Engine level full disk encryption. + DECRYPTED = 2; + } + + // 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 + string key_name = 1; + + // The desired state of etcd encryption. + State state = 2; +} + +// ListUsableSubnetworksRequest requests the list of usable subnetworks +// available to a user for creating clusters. +message ListUsableSubnetworksRequest { + // The parent project where subnetworks are usable. + // Specified in the format `projects/*`. + string parent = 1; + + // 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. + string filter = 2; + + // 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) + int32 page_size = 3; + + // Specifies a page token to use. Set this to the nextPageToken returned by + // previous list requests to get the next page of results. + string page_token = 4; +} + +// ListUsableSubnetworksResponse is the response of +// ListUsableSubnetworksRequest. +message ListUsableSubnetworksResponse { + // A list of usable subnetworks in the specified network project. + repeated UsableSubnetwork subnetworks = 1; + + // 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. + string next_page_token = 2; +} + +// Secondary IP range of a usable subnetwork. +message UsableSubnetworkSecondaryRange { + // Status shows the current usage of a secondary IP range. + enum Status { + // UNKNOWN is the zero value of the Status enum. It's not a valid status. + UNKNOWN = 0; + + // UNUSED denotes that this range is unclaimed by any cluster. + UNUSED = 1; + + // IN_USE_SERVICE denotes that this range is claimed by cluster(s) for + // services. User-managed services range can be shared between clusters + // within the same subnetwork. + IN_USE_SERVICE = 2; + + // 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_SHAREABLE_POD = 3; + + // IN_USE_MANAGED_POD denotes this range was created by GKE and is claimed + // for pods. It cannot be used for other clusters. + IN_USE_MANAGED_POD = 4; + } + + // The name associated with this subnetwork secondary range, used when adding + // an alias IP range to a VM instance. + string range_name = 1; + + // The range of IP addresses belonging to this subnetwork secondary range. + string ip_cidr_range = 2; + + // This field is to determine the status of the secondary range programmably. + Status status = 3; +} + +// UsableSubnetwork resource returns the subnetwork name, its associated network +// and the primary CIDR range. +message UsableSubnetwork { + // Subnetwork Name. + // Example: projects/my-project/regions/us-central1/subnetworks/my-subnet + string subnetwork = 1; + + // Network Name. + // Example: projects/my-project/global/networks/my-network + string network = 2; + + // The range of internal addresses that are owned by this subnetwork. + string ip_cidr_range = 3; + + // Secondary IP ranges. + repeated UsableSubnetworkSecondaryRange secondary_ip_ranges = 4; + + // 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. + string status_message = 5; +} + +// Configuration for exporting cluster resource usages. +message ResourceUsageExportConfig { + // Parameters for using BigQuery as the destination of resource usage export. + message BigQueryDestination { + // The ID of a BigQuery Dataset. + string dataset_id = 1; + } + + // Parameters for controlling consumption metering. + message ConsumptionMeteringConfig { + // Whether to enable consumption metering for this cluster. If enabled, a + // second BigQuery table will be created to hold resource consumption + // records. + bool enabled = 1; + } + + // Configuration to use BigQuery as usage export destination. + BigQueryDestination bigquery_destination = 1; + + // Whether to enable network egress metering for this cluster. If enabled, a + // daemonset will be created in the cluster to meter network egress traffic. + bool enable_network_egress_metering = 2; + + // Configuration to enable resource consumption metering. + ConsumptionMeteringConfig consumption_metering_config = 3; +} + +// VerticalPodAutoscaling contains global, per-cluster information +// required by Vertical Pod Autoscaler to automatically adjust +// the resources of pods controlled by it. +message VerticalPodAutoscaling { + // Enables vertical pod autoscaling. + bool enabled = 1; +} + +// DefaultSnatStatus contains the desired state of whether default sNAT should +// be disabled on the cluster. +message DefaultSnatStatus { + // Disables cluster default sNAT rules. + bool disabled = 1; +} + +// Configuration of Shielded Nodes feature. +message ShieldedNodes { + // Whether Shielded Nodes features are enabled on all nodes in this cluster. + bool enabled = 1; +} + +// Configuration of gVNIC feature. +message VirtualNIC { + // Whether gVNIC features are enabled in the node pool. + bool enabled = 1; +} + +// Configuration of Fast Socket feature. +message FastSocket { + // Whether Fast Socket features are enabled in the node pool. + bool enabled = 1; +} + +// PrivateIPv6GoogleAccess controls whether and how the pods can communicate +// with Google Services through gRPC over IPv6. +enum PrivateIPv6GoogleAccess { + // Default value. Same as DISABLED + PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0; + + // No private access to or from Google Services + PRIVATE_IPV6_GOOGLE_ACCESS_DISABLED = 1; + + // Enables private IPv6 access to Google Services from GKE + PRIVATE_IPV6_GOOGLE_ACCESS_TO_GOOGLE = 2; + + // Enables private IPv6 access to and from Google Services + PRIVATE_IPV6_GOOGLE_ACCESS_BIDIRECTIONAL = 3; +} + +// NotificationConfig is the configuration of notifications. +message NotificationConfig { + // Types of notifications currently supported. Can be used to filter what + // notifications are sent. + enum EventType { + // Not set, will be ignored. + EVENT_TYPE_UNSPECIFIED = 0; + + // Corresponds with UpgradeAvailableEvent. + UPGRADE_AVAILABLE_EVENT = 1; + + // Corresponds with UpgradeEvent. + UPGRADE_EVENT = 2; + + // Corresponds with SecurityBulletinEvent. + SECURITY_BULLETIN_EVENT = 3; + } + + // Pub/Sub specific notification config. + message PubSub { + // Enable notifications for Pub/Sub. + bool enabled = 1; + + // The desired Pub/Sub topic to which notifications will be + // sent by GKE. Format is `projects/{project}/topics/{topic}`. + string topic = 2 [ + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; + + // Allows filtering to one or more specific event types. If no filter is + // specified, or if a filter is specified with no event types, all event + // types will be sent + Filter filter = 3; + } + + // Allows filtering to one or more specific event types. If event types are + // present, those and only those event types will be transmitted to the + // cluster. Other types will be skipped. If no filter is specified, or no + // event types are present, all event types will be sent + message Filter { + // Event types to allowlist. + repeated EventType event_type = 1; + } + + // Notification config for Pub/Sub. + PubSub pubsub = 1; +} + +// ConfidentialNodes is configuration for the confidential nodes feature, which +// makes nodes run on confidential VMs. +message ConfidentialNodes { + // Whether Confidential Nodes feature is enabled. + bool enabled = 1; +} + +// UpgradeResourceType is the resource type that is upgrading. It is used +// in upgrade notifications. +enum UpgradeResourceType { + // Default value. This shouldn't be used. + UPGRADE_RESOURCE_TYPE_UNSPECIFIED = 0; + + // Master / control plane + MASTER = 1; + + // Node pool + NODE_POOL = 2; +} + +// UpgradeEvent is a notification sent to customers by the cluster server when +// a resource is upgrading. +message UpgradeEvent { + // The resource type that is upgrading. + UpgradeResourceType resource_type = 1; + + // The operation associated with this upgrade. + string operation = 2; + + // The time when the operation was started. + google.protobuf.Timestamp operation_start_time = 3; + + // The current version before the upgrade. + string current_version = 4; + + // The target version for the upgrade. + string target_version = 5; + + // Optional relative path to the resource. For example in node pool upgrades, + // the relative path of the node pool. + string resource = 6; +} + +// UpgradeAvailableEvent is a notification sent to customers when a new +// available version is released. +message UpgradeAvailableEvent { + // The release version available for upgrade. + string version = 1; + + // The resource type of the release version. + UpgradeResourceType resource_type = 2; + + // The release channel of the version. If empty, it means a non-channel + // release. + ReleaseChannel release_channel = 3; + + // Optional relative path to the resource. For example, the relative path of + // the node pool. + string resource = 4; +} + +// SecurityBulletinEvent is a notification sent to customers when a security +// bulletin has been posted that they are vulnerable to. +message SecurityBulletinEvent { + // The resource type (node/control plane) that has the vulnerability. Multiple + // notifications (1 notification per resource type) will be sent for a + // vulnerability that affects > 1 resource type. + string resource_type_affected = 1; + + // The ID of the bulletin corresponding to the vulnerability. + string bulletin_id = 2; + + // The CVEs associated with this bulletin. + repeated string cve_ids = 3; + + // The severity of this bulletin as it relates to GKE. + string severity = 4; + + // The URI link to the bulletin on the website for more information. + string bulletin_uri = 5; + + // A brief description of the bulletin. See the bulletin pointed to by the + // bulletin_uri field for an expanded description. + string brief_description = 6; + + // The GKE minor versions affected by this vulnerability. + repeated string affected_supported_minors = 7; + + // The GKE versions where this vulnerability is patched. + repeated string patched_versions = 8; + + // This represents a version selected from the patched_versions field that + // the cluster receiving this notification should most likely want to upgrade + // to based on its current version. Note that if this notification is being + // received by a given cluster, it means that this version is currently + // available as an upgrade target in that cluster's location. + string suggested_upgrade_target = 9; + + // If this field is specified, it means there are manual steps that the user + // must take to make their clusters safe. + bool manual_steps_required = 10; +} + +// Autopilot is the configuration for Autopilot settings on the cluster. +message Autopilot { + // Enable Autopilot + bool enabled = 1; + + // Workload policy configuration for Autopilot. + WorkloadPolicyConfig workload_policy_config = 2; +} + +// WorkloadPolicyConfig is the configuration of workload policy for autopilot +// clusters. +message WorkloadPolicyConfig { + // If true, workloads can use NET_ADMIN capability. + optional bool allow_net_admin = 1; +} + +// LoggingConfig is cluster logging configuration. +message LoggingConfig { + // Logging components configuration + LoggingComponentConfig component_config = 1; +} + +// LoggingComponentConfig is cluster logging component configuration. +message LoggingComponentConfig { + // GKE components exposing logs + enum Component { + // Default value. This shouldn't be used. + COMPONENT_UNSPECIFIED = 0; + + // system components + SYSTEM_COMPONENTS = 1; + + // workloads + WORKLOADS = 2; + + // kube-apiserver + APISERVER = 3; + + // kube-scheduler + SCHEDULER = 4; + + // kube-controller-manager + CONTROLLER_MANAGER = 5; + } + + // Select components to collect logs. An empty set would disable all logging. + repeated Component enable_components = 1; +} + +// MonitoringConfig is cluster monitoring configuration. +message MonitoringConfig { + // Monitoring components configuration + MonitoringComponentConfig component_config = 1; + + // Enable Google Cloud Managed Service for Prometheus + // in the cluster. + ManagedPrometheusConfig managed_prometheus_config = 2; + + // Configuration of Advanced Datapath Observability features. + AdvancedDatapathObservabilityConfig advanced_datapath_observability_config = + 3; +} + +// AdvancedDatapathObservabilityConfig specifies configuration of observability +// features of advanced datapath. +message AdvancedDatapathObservabilityConfig { + // Supported Relay modes + enum RelayMode { + // Default value. This shouldn't be used. + RELAY_MODE_UNSPECIFIED = 0; + + // disabled + DISABLED = 1; + + // exposed via internal load balancer + INTERNAL_VPC_LB = 3; + + // exposed via external load balancer + EXTERNAL_LB = 4; + } + + // Expose flow metrics on nodes + bool enable_metrics = 1; + + // Method used to make Relay available + RelayMode relay_mode = 2; +} + +// NodePoolLoggingConfig specifies logging configuration for nodepools. +message NodePoolLoggingConfig { + // Logging variant configuration. + LoggingVariantConfig variant_config = 1; +} + +// LoggingVariantConfig specifies the behaviour of the logging component. +message LoggingVariantConfig { + // Logging component variants. + enum Variant { + // Default value. This shouldn't be used. + VARIANT_UNSPECIFIED = 0; + + // default logging variant. + DEFAULT = 1; + + // maximum logging throughput variant. + MAX_THROUGHPUT = 2; + } + + // Logging variant deployed on nodes. + Variant variant = 1; +} + +// MonitoringComponentConfig is cluster monitoring component configuration. +message MonitoringComponentConfig { + // GKE components exposing metrics + enum Component { + // Default value. This shouldn't be used. + COMPONENT_UNSPECIFIED = 0; + + // system components + SYSTEM_COMPONENTS = 1; + + // kube-apiserver + APISERVER = 3; + + // kube-scheduler + SCHEDULER = 4; + + // kube-controller-manager + CONTROLLER_MANAGER = 5; + } + + // Select components to collect metrics. An empty set would disable all + // monitoring. + repeated Component enable_components = 1; +} + +// The datapath provider selects the implementation of the Kubernetes networking +// model for service resolution and network policy enforcement. +enum DatapathProvider { + // Default value. + DATAPATH_PROVIDER_UNSPECIFIED = 0; + + // Use the IPTables implementation based on kube-proxy. + LEGACY_DATAPATH = 1; + + // Use the eBPF based GKE Dataplane V2 with additional features. See the [GKE + // Dataplane V2 + // documentation](https://cloud.google.com/kubernetes-engine/docs/how-to/dataplane-v2) + // for more. + ADVANCED_DATAPATH = 2; +} + +// Strategy used for node pool update. +enum NodePoolUpdateStrategy { + // Default value if unset. GKE internally defaults the update strategy to + // SURGE for unspecified strategies. + NODE_POOL_UPDATE_STRATEGY_UNSPECIFIED = 0; + + // blue-green upgrade. + BLUE_GREEN = 2; + + // SURGE is the traditional way of upgrade a node pool. + // max_surge and max_unavailable determines the level of upgrade parallelism. + SURGE = 3; +} + +// ManagedPrometheusConfig defines the configuration for +// Google Cloud Managed Service for Prometheus. +message ManagedPrometheusConfig { + // Enable Managed Collection. + bool enabled = 1; +} + +// Fleet is the fleet configuration for the cluster. +message Fleet { + // The Fleet host project(project ID or project number) where this cluster + // will be registered to. This field cannot be changed after the cluster has + // been registered. + string project = 1; + + // [Output only] The full resource name of the registered fleet membership of + // the cluster, in the format + // `//gkehub.googleapis.com/projects/*/locations/*/memberships/*`. + string membership = 2; + + // [Output only] Whether the cluster has been registered through the fleet + // API. + bool pre_registered = 3; +} + +// Possible values for IP stack type +enum StackType { + // Default value, will be defaulted as IPV4 only + STACK_TYPE_UNSPECIFIED = 0; + + // Cluster is IPV4 only + IPV4 = 1; + + // Cluster can use both IPv4 and IPv6 + IPV4_IPV6 = 2; +} + +// Possible values for IPv6 access type +enum IPv6AccessType { + // Default value, will be defaulted as type external. + IPV6_ACCESS_TYPE_UNSPECIFIED = 0; + + // Access type internal (all v6 addresses are internal IPs) + INTERNAL = 1; + + // Access type external (all v6 addresses are external IPs) + EXTERNAL = 2; +} + +// LocalNvmeSsdBlockConfig contains configuration for using raw-block local +// NVMe SSD. +message LocalNvmeSsdBlockConfig { + // The number of raw-block local NVMe SSD disks to be attached to the node. + // Each local SSD is 375 GB in size. If zero, it means no raw-block local NVMe + // 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. + int32 local_ssd_count = 1; +} + +// EphemeralStorageLocalSsdConfig contains configuration for the node ephemeral +// storage using Local SSD. +message EphemeralStorageLocalSsdConfig { + // Number of local SSDs to use to back ephemeral storage. Uses NVMe + // interfaces. Each local SSD is 375 GB in size. + // If zero, it means to disable using local SSDs as ephemeral storage. + // 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. + int32 local_ssd_count = 1; +} diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.cancel_operation.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.cancel_operation.js new file mode 100644 index 00000000000..e556c2aaf76 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.cancel_operation.js @@ -0,0 +1,61 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_CancelOperation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, operation id) of the operation to cancel. + * Specified in the format `projects/* /locations/* /operations/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCancelOperation() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.cancelOperation(request); + console.log(response); + } + + callCancelOperation(); + // [END container_v1_generated_ClusterManager_CancelOperation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js new file mode 100644 index 00000000000..e4d731fc2d0 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js @@ -0,0 +1,61 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_CheckAutopilotCompatibility_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster) of the cluster to retrieve. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCheckAutopilotCompatibility() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.checkAutopilotCompatibility(request); + console.log(response); + } + + callCheckAutopilotCompatibility(); + // [END container_v1_generated_ClusterManager_CheckAutopilotCompatibility_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_i_p_rotation.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_i_p_rotation.js new file mode 100644 index 00000000000..82b71531860 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_i_p_rotation.js @@ -0,0 +1,61 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_CompleteIPRotation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster name) of the cluster to complete IP + * rotation. Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCompleteIPRotation() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.completeIPRotation(request); + console.log(response); + } + + callCompleteIPRotation(); + // [END container_v1_generated_ClusterManager_CompleteIPRotation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js new file mode 100644 index 00000000000..8cf74642faf --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js @@ -0,0 +1,62 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_CompleteNodePoolUpgrade_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster, node pool id) of the node pool to + * complete upgrade. + * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCompleteNodePoolUpgrade() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.completeNodePoolUpgrade(request); + console.log(response); + } + + callCompleteNodePoolUpgrade(); + // [END container_v1_generated_ClusterManager_CompleteNodePoolUpgrade_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_cluster.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_cluster.js new file mode 100644 index 00000000000..bc132fbb109 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_cluster.js @@ -0,0 +1,67 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(cluster) { + // [START container_v1_generated_ClusterManager_CreateCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A cluster + * resource (https://cloud.google.com/container-engine/reference/rest/v1/projects.locations.clusters) + */ + // const cluster = {} + /** + * The parent (project and location) where the cluster will be created. + * Specified in the format `projects/* /locations/*`. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCreateCluster() { + // Construct request + const request = { + cluster, + }; + + // Run request + const response = await containerClient.createCluster(request); + console.log(response); + } + + callCreateCluster(); + // [END container_v1_generated_ClusterManager_CreateCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_node_pool.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_node_pool.js new file mode 100644 index 00000000000..c2526e72425 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_node_pool.js @@ -0,0 +1,67 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(nodePool) { + // [START container_v1_generated_ClusterManager_CreateNodePool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The node pool to create. + */ + // const nodePool = {} + /** + * The parent (project, location, cluster name) where the node pool will be + * created. Specified in the format + * `projects/* /locations/* /clusters/*`. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCreateNodePool() { + // Construct request + const request = { + nodePool, + }; + + // Run request + const response = await containerClient.createNodePool(request); + console.log(response); + } + + callCreateNodePool(); + // [END container_v1_generated_ClusterManager_CreateNodePool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_cluster.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_cluster.js new file mode 100644 index 00000000000..b7f789d7b80 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_cluster.js @@ -0,0 +1,61 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_DeleteCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster) of the cluster to delete. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callDeleteCluster() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.deleteCluster(request); + console.log(response); + } + + callDeleteCluster(); + // [END container_v1_generated_ClusterManager_DeleteCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_node_pool.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_node_pool.js new file mode 100644 index 00000000000..1d286e9963b --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_node_pool.js @@ -0,0 +1,62 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_DeleteNodePool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster, node pool id) of the node pool to + * delete. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callDeleteNodePool() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.deleteNodePool(request); + console.log(response); + } + + callDeleteNodePool(); + // [END container_v1_generated_ClusterManager_DeleteNodePool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_cluster.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_cluster.js new file mode 100644 index 00000000000..565479929b5 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_cluster.js @@ -0,0 +1,61 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_GetCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster) of the cluster to retrieve. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callGetCluster() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.getCluster(request); + console.log(response); + } + + callGetCluster(); + // [END container_v1_generated_ClusterManager_GetCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_j_s_o_n_web_keys.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_j_s_o_n_web_keys.js new file mode 100644 index 00000000000..ce76d378ce1 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_j_s_o_n_web_keys.js @@ -0,0 +1,61 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_GetJSONWebKeys_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The cluster (project, location, cluster name) to get keys for. Specified in + * the format `projects/* /locations/* /clusters/*`. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callGetJSONWebKeys() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.getJSONWebKeys(request); + console.log(response); + } + + callGetJSONWebKeys(); + // [END container_v1_generated_ClusterManager_GetJSONWebKeys_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_node_pool.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_node_pool.js new file mode 100644 index 00000000000..fb3301234b1 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_node_pool.js @@ -0,0 +1,62 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_GetNodePool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster, node pool id) of the node pool to + * get. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callGetNodePool() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.getNodePool(request); + console.log(response); + } + + callGetNodePool(); + // [END container_v1_generated_ClusterManager_GetNodePool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_operation.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_operation.js new file mode 100644 index 00000000000..58a774ae645 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_operation.js @@ -0,0 +1,61 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_GetOperation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, operation id) of the operation to get. + * Specified in the format `projects/* /locations/* /operations/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callGetOperation() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.getOperation(request); + console.log(response); + } + + callGetOperation(); + // [END container_v1_generated_ClusterManager_GetOperation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_server_config.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_server_config.js new file mode 100644 index 00000000000..6a1e2ef0e69 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_server_config.js @@ -0,0 +1,61 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_GetServerConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project and location) of the server config to get, + * specified in the format `projects/* /locations/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callGetServerConfig() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.getServerConfig(request); + console.log(response); + } + + callGetServerConfig(); + // [END container_v1_generated_ClusterManager_GetServerConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_clusters.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_clusters.js new file mode 100644 index 00000000000..fb7dbc835b2 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_clusters.js @@ -0,0 +1,62 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_ListClusters_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The parent (project and location) where the clusters will be listed. + * Specified in the format `projects/* /locations/*`. + * Location "-" matches all zones and all regions. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callListClusters() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.listClusters(request); + console.log(response); + } + + callListClusters(); + // [END container_v1_generated_ClusterManager_ListClusters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_node_pools.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_node_pools.js new file mode 100644 index 00000000000..fa48c06009a --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_node_pools.js @@ -0,0 +1,61 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_ListNodePools_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The parent (project, location, cluster name) where the node pools will be + * listed. Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callListNodePools() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.listNodePools(request); + console.log(response); + } + + callListNodePools(); + // [END container_v1_generated_ClusterManager_ListNodePools_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_operations.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_operations.js new file mode 100644 index 00000000000..69eb1730393 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_operations.js @@ -0,0 +1,62 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_ListOperations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The parent (project and location) where the operations will be listed. + * Specified in the format `projects/* /locations/*`. + * Location "-" matches all zones and all regions. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callListOperations() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.listOperations(request); + console.log(response); + } + + callListOperations(); + // [END container_v1_generated_ClusterManager_ListOperations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_usable_subnetworks.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_usable_subnetworks.js new file mode 100644 index 00000000000..a70af157bf3 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_usable_subnetworks.js @@ -0,0 +1,82 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_ListUsableSubnetworks_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The parent project where subnetworks are usable. + * Specified in the format `projects/*`. + */ + // const parent = 'abc123' + /** + * 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. + */ + // const filter = 'abc123' + /** + * 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) + */ + // const pageSize = 1234 + /** + * Specifies a page token to use. Set this to the nextPageToken returned by + * previous list requests to get the next page of results. + */ + // const pageToken = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callListUsableSubnetworks() { + // Construct request + const request = { + }; + + // Run request + const iterable = await containerClient.listUsableSubnetworksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListUsableSubnetworks(); + // [END container_v1_generated_ClusterManager_ListUsableSubnetworks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.rollback_node_pool_upgrade.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.rollback_node_pool_upgrade.js new file mode 100644 index 00000000000..3356c397660 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.rollback_node_pool_upgrade.js @@ -0,0 +1,67 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_RollbackNodePoolUpgrade_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster, node pool id) of the node poll to + * rollback upgrade. + * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + /** + * Option for rollback to ignore the PodDisruptionBudget. + * Default value is false. + */ + // const respectPdb = true + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callRollbackNodePoolUpgrade() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.rollbackNodePoolUpgrade(request); + console.log(response); + } + + callRollbackNodePoolUpgrade(); + // [END container_v1_generated_ClusterManager_RollbackNodePoolUpgrade_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_addons_config.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_addons_config.js new file mode 100644 index 00000000000..c6e24e63456 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_addons_config.js @@ -0,0 +1,67 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(addonsConfig) { + // [START container_v1_generated_ClusterManager_SetAddonsConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The desired configurations for the various addons available to + * run in the cluster. + */ + // const addonsConfig = {} + /** + * The name (project, location, cluster) of the cluster to set addons. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetAddonsConfig() { + // Construct request + const request = { + addonsConfig, + }; + + // Run request + const response = await containerClient.setAddonsConfig(request); + console.log(response); + } + + callSetAddonsConfig(); + // [END container_v1_generated_ClusterManager_SetAddonsConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_labels.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_labels.js new file mode 100644 index 00000000000..dd281c82cc6 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_labels.js @@ -0,0 +1,76 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resourceLabels, labelFingerprint) { + // [START container_v1_generated_ClusterManager_SetLabels_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The labels to set for that cluster. + */ + // const resourceLabels = 1234 + /** + * 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. + */ + // const labelFingerprint = 'abc123' + /** + * The name (project, location, cluster name) of the cluster to set labels. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetLabels() { + // Construct request + const request = { + resourceLabels, + labelFingerprint, + }; + + // Run request + const response = await containerClient.setLabels(request); + console.log(response); + } + + callSetLabels(); + // [END container_v1_generated_ClusterManager_SetLabels_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_legacy_abac.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_legacy_abac.js new file mode 100644 index 00000000000..9c2a450c361 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_legacy_abac.js @@ -0,0 +1,66 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(enabled) { + // [START container_v1_generated_ClusterManager_SetLegacyAbac_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Whether ABAC authorization will be enabled in the cluster. + */ + // const enabled = true + /** + * The name (project, location, cluster name) of the cluster to set legacy + * abac. Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetLegacyAbac() { + // Construct request + const request = { + enabled, + }; + + // Run request + const response = await containerClient.setLegacyAbac(request); + console.log(response); + } + + callSetLegacyAbac(); + // [END container_v1_generated_ClusterManager_SetLegacyAbac_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_locations.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_locations.js new file mode 100644 index 00000000000..a5f7a5f0349 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_locations.js @@ -0,0 +1,71 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(locations) { + // [START container_v1_generated_ClusterManager_SetLocations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The desired list of Google Compute Engine + * zones (https://cloud.google.com/compute/docs/zones#available) 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. + */ + // const locations = 'abc123' + /** + * The name (project, location, cluster) of the cluster to set locations. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetLocations() { + // Construct request + const request = { + locations, + }; + + // Run request + const response = await containerClient.setLocations(request); + console.log(response); + } + + callSetLocations(); + // [END container_v1_generated_ClusterManager_SetLocations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_logging_service.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_logging_service.js new file mode 100644 index 00000000000..3333d0219c5 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_logging_service.js @@ -0,0 +1,74 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(loggingService) { + // [START container_v1_generated_ClusterManager_SetLoggingService_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The logging service the cluster should use to write logs. + * Currently available options: + * * `logging.googleapis.com/kubernetes` - The Cloud Logging + * service with a Kubernetes-native resource model + * * `logging.googleapis.com` - The legacy Cloud Logging service (no longer + * available as of GKE 1.15). + * * `none` - no logs will be exported from the cluster. + * If left as an empty string,`logging.googleapis.com/kubernetes` will be + * used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. + */ + // const loggingService = 'abc123' + /** + * The name (project, location, cluster) of the cluster to set logging. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetLoggingService() { + // Construct request + const request = { + loggingService, + }; + + // Run request + const response = await containerClient.setLoggingService(request); + console.log(response); + } + + callSetLoggingService(); + // [END container_v1_generated_ClusterManager_SetLoggingService_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_maintenance_policy.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_maintenance_policy.js new file mode 100644 index 00000000000..4e675414de2 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_maintenance_policy.js @@ -0,0 +1,86 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, maintenancePolicy) { + // [START container_v1_generated_ClusterManager_SetMaintenancePolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The Google Developers Console project ID or project + * number (https://cloud.google.com/resource-manager/docs/creating-managing-projects). + */ + // const projectId = 'abc123' + /** + * Required. The name of the Google Compute Engine + * zone (https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. + */ + // const zone = 'abc123' + /** + * Required. The name of the cluster to update. + */ + // const clusterId = 'abc123' + /** + * Required. The maintenance policy to be set for the cluster. An empty field + * clears the existing maintenance policy. + */ + // const maintenancePolicy = {} + /** + * The name (project, location, cluster name) of the cluster to set + * maintenance policy. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetMaintenancePolicy() { + // Construct request + const request = { + projectId, + zone, + clusterId, + maintenancePolicy, + }; + + // Run request + const response = await containerClient.setMaintenancePolicy(request); + console.log(response); + } + + callSetMaintenancePolicy(); + // [END container_v1_generated_ClusterManager_SetMaintenancePolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_master_auth.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_master_auth.js new file mode 100644 index 00000000000..4376ebb1adc --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_master_auth.js @@ -0,0 +1,71 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(action, update) { + // [START container_v1_generated_ClusterManager_SetMasterAuth_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The exact form of action to be taken on the master auth. + */ + // const action = {} + /** + * Required. A description of the update. + */ + // const update = {} + /** + * The name (project, location, cluster) of the cluster to set auth. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetMasterAuth() { + // Construct request + const request = { + action, + update, + }; + + // Run request + const response = await containerClient.setMasterAuth(request); + console.log(response); + } + + callSetMasterAuth(); + // [END container_v1_generated_ClusterManager_SetMasterAuth_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_monitoring_service.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_monitoring_service.js new file mode 100644 index 00000000000..5767da6da8f --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_monitoring_service.js @@ -0,0 +1,74 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(monitoringService) { + // [START container_v1_generated_ClusterManager_SetMonitoringService_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The monitoring service the cluster should use to write metrics. + * Currently available options: + * * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring + * service with a Kubernetes-native resource model + * * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no + * longer available as of GKE 1.15). + * * `none` - No metrics will be exported from the cluster. + * If left as an empty string,`monitoring.googleapis.com/kubernetes` will be + * used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. + */ + // const monitoringService = 'abc123' + /** + * The name (project, location, cluster) of the cluster to set monitoring. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetMonitoringService() { + // Construct request + const request = { + monitoringService, + }; + + // Run request + const response = await containerClient.setMonitoringService(request); + console.log(response); + } + + callSetMonitoringService(); + // [END container_v1_generated_ClusterManager_SetMonitoringService_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_network_policy.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_network_policy.js new file mode 100644 index 00000000000..70e4a954cd3 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_network_policy.js @@ -0,0 +1,66 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(networkPolicy) { + // [START container_v1_generated_ClusterManager_SetNetworkPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Configuration options for the NetworkPolicy feature. + */ + // const networkPolicy = {} + /** + * The name (project, location, cluster name) of the cluster to set networking + * policy. Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetNetworkPolicy() { + // Construct request + const request = { + networkPolicy, + }; + + // Run request + const response = await containerClient.setNetworkPolicy(request); + console.log(response); + } + + callSetNetworkPolicy(); + // [END container_v1_generated_ClusterManager_SetNetworkPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_autoscaling.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_autoscaling.js new file mode 100644 index 00000000000..fde99e8483c --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_autoscaling.js @@ -0,0 +1,67 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(autoscaling) { + // [START container_v1_generated_ClusterManager_SetNodePoolAutoscaling_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Autoscaling configuration for the node pool. + */ + // const autoscaling = {} + /** + * The name (project, location, cluster, node pool) of the node pool to set + * autoscaler settings. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetNodePoolAutoscaling() { + // Construct request + const request = { + autoscaling, + }; + + // Run request + const response = await containerClient.setNodePoolAutoscaling(request); + console.log(response); + } + + callSetNodePoolAutoscaling(); + // [END container_v1_generated_ClusterManager_SetNodePoolAutoscaling_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_management.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_management.js new file mode 100644 index 00000000000..e1ea4030588 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_management.js @@ -0,0 +1,67 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(management) { + // [START container_v1_generated_ClusterManager_SetNodePoolManagement_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. NodeManagement configuration for the node pool. + */ + // const management = {} + /** + * The name (project, location, cluster, node pool id) of the node pool to set + * management properties. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetNodePoolManagement() { + // Construct request + const request = { + management, + }; + + // Run request + const response = await containerClient.setNodePoolManagement(request); + console.log(response); + } + + callSetNodePoolManagement(); + // [END container_v1_generated_ClusterManager_SetNodePoolManagement_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_size.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_size.js new file mode 100644 index 00000000000..aedfdd9f71b --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_size.js @@ -0,0 +1,67 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(nodeCount) { + // [START container_v1_generated_ClusterManager_SetNodePoolSize_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The desired node count for the pool. + */ + // const nodeCount = 1234 + /** + * The name (project, location, cluster, node pool id) of the node pool to set + * size. + * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetNodePoolSize() { + // Construct request + const request = { + nodeCount, + }; + + // Run request + const response = await containerClient.setNodePoolSize(request); + console.log(response); + } + + callSetNodePoolSize(); + // [END container_v1_generated_ClusterManager_SetNodePoolSize_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.start_i_p_rotation.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.start_i_p_rotation.js new file mode 100644 index 00000000000..a8f65196353 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.start_i_p_rotation.js @@ -0,0 +1,65 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_StartIPRotation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster name) of the cluster to start IP + * rotation. Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + /** + * Whether to rotate credentials during IP rotation. + */ + // const rotateCredentials = true + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callStartIPRotation() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.startIPRotation(request); + console.log(response); + } + + callStartIPRotation(); + // [END container_v1_generated_ClusterManager_StartIPRotation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_cluster.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_cluster.js new file mode 100644 index 00000000000..b0280b7fea6 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_cluster.js @@ -0,0 +1,66 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(update) { + // [START container_v1_generated_ClusterManager_UpdateCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A description of the update. + */ + // const update = {} + /** + * The name (project, location, cluster) of the cluster to update. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callUpdateCluster() { + // Construct request + const request = { + update, + }; + + // Run request + const response = await containerClient.updateCluster(request); + console.log(response); + } + + callUpdateCluster(); + // [END container_v1_generated_ClusterManager_UpdateCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_master.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_master.js new file mode 100644 index 00000000000..37f555312f8 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_master.js @@ -0,0 +1,73 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(masterVersion) { + // [START container_v1_generated_ClusterManager_UpdateMaster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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 + */ + // const masterVersion = 'abc123' + /** + * The name (project, location, cluster) of the cluster to update. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callUpdateMaster() { + // Construct request + const request = { + masterVersion, + }; + + // Run request + const response = await containerClient.updateMaster(request); + console.log(response); + } + + callUpdateMaster(); + // [END container_v1_generated_ClusterManager_UpdateMaster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_node_pool.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_node_pool.js new file mode 100644 index 00000000000..10715ac0d85 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_node_pool.js @@ -0,0 +1,164 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(nodeVersion, imageType) { + // [START container_v1_generated_ClusterManager_UpdateNodePool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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 + */ + // const nodeVersion = 'abc123' + /** + * Required. The desired image type for the node pool. Please see + * https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for + * available image types. + */ + // const imageType = 'abc123' + /** + * The name (project, location, cluster, node pool) of the node pool to + * update. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + /** + * The desired list of Google Compute Engine + * zones (https://cloud.google.com/compute/docs/zones#available) in which the + * node pool's nodes should be located. Changing the locations for a node pool + * will result in nodes being either created or removed from the node pool, + * depending on whether locations are being added or removed. + */ + // const locations = 'abc123' + /** + * The desired workload metadata config for the node pool. + */ + // const workloadMetadataConfig = {} + /** + * Upgrade settings control disruption and speed of the upgrade. + */ + // const upgradeSettings = {} + /** + * The desired network tags to be applied to all nodes in the node pool. + * If this field is not present, the tags will not be changed. Otherwise, + * the existing network tags will be *replaced* with the provided tags. + */ + // const tags = {} + /** + * The desired node taints to be applied to all nodes in the node pool. + * If this field is not present, the taints will not be changed. Otherwise, + * the existing node taints will be *replaced* with the provided taints. + */ + // const taints = {} + /** + * The desired node labels to be applied to all nodes in the node pool. + * If this field is not present, the labels will not be changed. Otherwise, + * the existing node labels will be *replaced* with the provided labels. + */ + // const labels = {} + /** + * Parameters that can be configured on Linux nodes. + */ + // const linuxNodeConfig = {} + /** + * Node kubelet configs. + */ + // const kubeletConfig = {} + /** + * Node network config. + */ + // const nodeNetworkConfig = {} + /** + * GCFS config. + */ + // const gcfsConfig = {} + /** + * Confidential nodes config. + * All the nodes in the node pool will be Confidential VM once enabled. + */ + // const confidentialNodes = {} + /** + * Enable or disable gvnic on the node pool. + */ + // const gvnic = {} + /** + * The current etag of the node pool. + * If an etag is provided and does not match the current etag of the node + * pool, update will be blocked and an ABORTED error will be returned. + */ + // const etag = 'abc123' + /** + * Enable or disable NCCL fast socket for the node pool. + */ + // const fastSocket = {} + /** + * Logging configuration. + */ + // const loggingConfig = {} + /** + * The resource labels for the node pool to use to annotate any related + * Google Compute Engine resources. + */ + // const resourceLabels = {} + /** + * Parameters that can be configured on Windows nodes. + */ + // const windowsNodeConfig = {} + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callUpdateNodePool() { + // Construct request + const request = { + nodeVersion, + imageType, + }; + + // Run request + const response = await containerClient.updateNodePool(request); + console.log(response); + } + + callUpdateNodePool(); + // [END container_v1_generated_ClusterManager_UpdateNodePool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/snippet_metadata.google.container.v1.json b/owl-bot-staging/google-container/v1/samples/generated/v1/snippet_metadata.google.container.v1.json new file mode 100644 index 00000000000..66a864e5ad7 --- /dev/null +++ b/owl-bot-staging/google-container/v1/samples/generated/v1/snippet_metadata.google.container.v1.json @@ -0,0 +1,1915 @@ +{ + "clientLibrary": { + "name": "nodejs-container", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.container.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "container_v1_generated_ClusterManager_ListClusters_async", + "title": "ClusterManager listClusters Sample", + "origin": "API_DEFINITION", + "description": " Lists all clusters owned by a project in either the specified zone or all zones.", + "canonical": true, + "file": "cluster_manager.list_clusters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListClusters", + "fullName": "google.container.v1.ClusterManager.ListClusters", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.ListClustersResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "ListClusters", + "fullName": "google.container.v1.ClusterManager.ListClusters", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_GetCluster_async", + "title": "ClusterManager getCluster Sample", + "origin": "API_DEFINITION", + "description": " Gets the details of a specific cluster.", + "canonical": true, + "file": "cluster_manager.get_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCluster", + "fullName": "google.container.v1.ClusterManager.GetCluster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Cluster", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "GetCluster", + "fullName": "google.container.v1.ClusterManager.GetCluster", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_CreateCluster_async", + "title": "ClusterManager createCluster Sample", + "origin": "API_DEFINITION", + "description": " 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](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). 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.", + "canonical": true, + "file": "cluster_manager.create_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCluster", + "fullName": "google.container.v1.ClusterManager.CreateCluster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster", + "type": ".google.container.v1.Cluster" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "CreateCluster", + "fullName": "google.container.v1.ClusterManager.CreateCluster", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_UpdateCluster_async", + "title": "ClusterManager updateCluster Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a specific cluster.", + "canonical": true, + "file": "cluster_manager.update_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCluster", + "fullName": "google.container.v1.ClusterManager.UpdateCluster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "update", + "type": ".google.container.v1.ClusterUpdate" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "UpdateCluster", + "fullName": "google.container.v1.ClusterManager.UpdateCluster", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_UpdateNodePool_async", + "title": "ClusterManager updateNodePool Sample", + "origin": "API_DEFINITION", + "description": " Updates the version and/or image type for the specified node pool.", + "canonical": true, + "file": "cluster_manager.update_node_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 156, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateNodePool", + "fullName": "google.container.v1.ClusterManager.UpdateNodePool", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "node_version", + "type": "TYPE_STRING" + }, + { + "name": "image_type", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "locations", + "type": "TYPE_STRING[]" + }, + { + "name": "workload_metadata_config", + "type": ".google.container.v1.WorkloadMetadataConfig" + }, + { + "name": "upgrade_settings", + "type": ".google.container.v1.NodePool.UpgradeSettings" + }, + { + "name": "tags", + "type": ".google.container.v1.NetworkTags" + }, + { + "name": "taints", + "type": ".google.container.v1.NodeTaints" + }, + { + "name": "labels", + "type": ".google.container.v1.NodeLabels" + }, + { + "name": "linux_node_config", + "type": ".google.container.v1.LinuxNodeConfig" + }, + { + "name": "kubelet_config", + "type": ".google.container.v1.NodeKubeletConfig" + }, + { + "name": "node_network_config", + "type": ".google.container.v1.NodeNetworkConfig" + }, + { + "name": "gcfs_config", + "type": ".google.container.v1.GcfsConfig" + }, + { + "name": "confidential_nodes", + "type": ".google.container.v1.ConfidentialNodes" + }, + { + "name": "gvnic", + "type": ".google.container.v1.VirtualNIC" + }, + { + "name": "etag", + "type": "TYPE_STRING" + }, + { + "name": "fast_socket", + "type": ".google.container.v1.FastSocket" + }, + { + "name": "logging_config", + "type": ".google.container.v1.NodePoolLoggingConfig" + }, + { + "name": "resource_labels", + "type": ".google.container.v1.ResourceLabels" + }, + { + "name": "windows_node_config", + "type": ".google.container.v1.WindowsNodeConfig" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "UpdateNodePool", + "fullName": "google.container.v1.ClusterManager.UpdateNodePool", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_SetNodePoolAutoscaling_async", + "title": "ClusterManager setNodePoolAutoscaling Sample", + "origin": "API_DEFINITION", + "description": " Sets the autoscaling settings for the specified node pool.", + "canonical": true, + "file": "cluster_manager.set_node_pool_autoscaling.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetNodePoolAutoscaling", + "fullName": "google.container.v1.ClusterManager.SetNodePoolAutoscaling", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "autoscaling", + "type": ".google.container.v1.NodePoolAutoscaling" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "SetNodePoolAutoscaling", + "fullName": "google.container.v1.ClusterManager.SetNodePoolAutoscaling", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_SetLoggingService_async", + "title": "ClusterManager setLoggingService Sample", + "origin": "API_DEFINITION", + "description": " Sets the logging service for a specific cluster.", + "canonical": true, + "file": "cluster_manager.set_logging_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetLoggingService", + "fullName": "google.container.v1.ClusterManager.SetLoggingService", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "logging_service", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "SetLoggingService", + "fullName": "google.container.v1.ClusterManager.SetLoggingService", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_SetMonitoringService_async", + "title": "ClusterManager setMonitoringService Sample", + "origin": "API_DEFINITION", + "description": " Sets the monitoring service for a specific cluster.", + "canonical": true, + "file": "cluster_manager.set_monitoring_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetMonitoringService", + "fullName": "google.container.v1.ClusterManager.SetMonitoringService", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "monitoring_service", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "SetMonitoringService", + "fullName": "google.container.v1.ClusterManager.SetMonitoringService", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_SetAddonsConfig_async", + "title": "ClusterManager setAddonsConfig Sample", + "origin": "API_DEFINITION", + "description": " Sets the addons for a specific cluster.", + "canonical": true, + "file": "cluster_manager.set_addons_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetAddonsConfig", + "fullName": "google.container.v1.ClusterManager.SetAddonsConfig", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "addons_config", + "type": ".google.container.v1.AddonsConfig" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "SetAddonsConfig", + "fullName": "google.container.v1.ClusterManager.SetAddonsConfig", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_SetLocations_async", + "title": "ClusterManager setLocations Sample", + "origin": "API_DEFINITION", + "description": " Sets the locations for a specific cluster. Deprecated. Use [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update) instead.", + "canonical": true, + "file": "cluster_manager.set_locations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetLocations", + "fullName": "google.container.v1.ClusterManager.SetLocations", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "locations", + "type": "TYPE_STRING[]" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "SetLocations", + "fullName": "google.container.v1.ClusterManager.SetLocations", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_UpdateMaster_async", + "title": "ClusterManager updateMaster Sample", + "origin": "API_DEFINITION", + "description": " Updates the master for a specific cluster.", + "canonical": true, + "file": "cluster_manager.update_master.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateMaster", + "fullName": "google.container.v1.ClusterManager.UpdateMaster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "master_version", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "UpdateMaster", + "fullName": "google.container.v1.ClusterManager.UpdateMaster", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_SetMasterAuth_async", + "title": "ClusterManager setMasterAuth Sample", + "origin": "API_DEFINITION", + "description": " Sets master auth materials. Currently supports changing the admin password or a specific cluster, either via password generation or explicitly setting the password.", + "canonical": true, + "file": "cluster_manager.set_master_auth.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetMasterAuth", + "fullName": "google.container.v1.ClusterManager.SetMasterAuth", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "action", + "type": ".google.container.v1.SetMasterAuthRequest.Action" + }, + { + "name": "update", + "type": ".google.container.v1.MasterAuth" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "SetMasterAuth", + "fullName": "google.container.v1.ClusterManager.SetMasterAuth", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_DeleteCluster_async", + "title": "ClusterManager deleteCluster Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "cluster_manager.delete_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCluster", + "fullName": "google.container.v1.ClusterManager.DeleteCluster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "DeleteCluster", + "fullName": "google.container.v1.ClusterManager.DeleteCluster", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_ListOperations_async", + "title": "ClusterManager listOperations Sample", + "origin": "API_DEFINITION", + "description": " Lists all operations in a project in a specific zone or all zones.", + "canonical": true, + "file": "cluster_manager.list_operations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListOperations", + "fullName": "google.container.v1.ClusterManager.ListOperations", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.ListOperationsResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "ListOperations", + "fullName": "google.container.v1.ClusterManager.ListOperations", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_GetOperation_async", + "title": "ClusterManager getOperation Sample", + "origin": "API_DEFINITION", + "description": " Gets the specified operation.", + "canonical": true, + "file": "cluster_manager.get_operation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetOperation", + "fullName": "google.container.v1.ClusterManager.GetOperation", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "operation_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "GetOperation", + "fullName": "google.container.v1.ClusterManager.GetOperation", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_CancelOperation_async", + "title": "ClusterManager cancelOperation Sample", + "origin": "API_DEFINITION", + "description": " Cancels the specified operation.", + "canonical": true, + "file": "cluster_manager.cancel_operation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CancelOperation", + "fullName": "google.container.v1.ClusterManager.CancelOperation", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "operation_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "CancelOperation", + "fullName": "google.container.v1.ClusterManager.CancelOperation", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_GetServerConfig_async", + "title": "ClusterManager getServerConfig Sample", + "origin": "API_DEFINITION", + "description": " Returns configuration info about the Google Kubernetes Engine service.", + "canonical": true, + "file": "cluster_manager.get_server_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetServerConfig", + "fullName": "google.container.v1.ClusterManager.GetServerConfig", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.ServerConfig", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "GetServerConfig", + "fullName": "google.container.v1.ClusterManager.GetServerConfig", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_GetJSONWebKeys_async", + "title": "ClusterManager getJSONWebKeys Sample", + "origin": "API_DEFINITION", + "description": " Gets the public component of the cluster signing keys in JSON Web Key format. This API is not yet intended for general use, and is not available for all clusters.", + "canonical": true, + "file": "cluster_manager.get_j_s_o_n_web_keys.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetJSONWebKeys", + "fullName": "google.container.v1.ClusterManager.GetJSONWebKeys", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.GetJSONWebKeysResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "GetJSONWebKeys", + "fullName": "google.container.v1.ClusterManager.GetJSONWebKeys", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_ListNodePools_async", + "title": "ClusterManager listNodePools Sample", + "origin": "API_DEFINITION", + "description": " Lists the node pools for a cluster.", + "canonical": true, + "file": "cluster_manager.list_node_pools.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListNodePools", + "fullName": "google.container.v1.ClusterManager.ListNodePools", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.ListNodePoolsResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "ListNodePools", + "fullName": "google.container.v1.ClusterManager.ListNodePools", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_GetNodePool_async", + "title": "ClusterManager getNodePool Sample", + "origin": "API_DEFINITION", + "description": " Retrieves the requested node pool.", + "canonical": true, + "file": "cluster_manager.get_node_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetNodePool", + "fullName": "google.container.v1.ClusterManager.GetNodePool", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.NodePool", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "GetNodePool", + "fullName": "google.container.v1.ClusterManager.GetNodePool", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_CreateNodePool_async", + "title": "ClusterManager createNodePool Sample", + "origin": "API_DEFINITION", + "description": " Creates a node pool for a cluster.", + "canonical": true, + "file": "cluster_manager.create_node_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateNodePool", + "fullName": "google.container.v1.ClusterManager.CreateNodePool", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool", + "type": ".google.container.v1.NodePool" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "CreateNodePool", + "fullName": "google.container.v1.ClusterManager.CreateNodePool", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_DeleteNodePool_async", + "title": "ClusterManager deleteNodePool Sample", + "origin": "API_DEFINITION", + "description": " Deletes a node pool from a cluster.", + "canonical": true, + "file": "cluster_manager.delete_node_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteNodePool", + "fullName": "google.container.v1.ClusterManager.DeleteNodePool", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "DeleteNodePool", + "fullName": "google.container.v1.ClusterManager.DeleteNodePool", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_CompleteNodePoolUpgrade_async", + "title": "ClusterManager completeNodePoolUpgrade Sample", + "origin": "API_DEFINITION", + "description": " CompleteNodePoolUpgrade will signal an on-going node pool upgrade to complete.", + "canonical": true, + "file": "cluster_manager.complete_node_pool_upgrade.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CompleteNodePoolUpgrade", + "fullName": "google.container.v1.ClusterManager.CompleteNodePoolUpgrade", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "CompleteNodePoolUpgrade", + "fullName": "google.container.v1.ClusterManager.CompleteNodePoolUpgrade", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_RollbackNodePoolUpgrade_async", + "title": "ClusterManager rollbackNodePoolUpgrade Sample", + "origin": "API_DEFINITION", + "description": " Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last upgrade successfully completed.", + "canonical": true, + "file": "cluster_manager.rollback_node_pool_upgrade.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RollbackNodePoolUpgrade", + "fullName": "google.container.v1.ClusterManager.RollbackNodePoolUpgrade", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "respect_pdb", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "RollbackNodePoolUpgrade", + "fullName": "google.container.v1.ClusterManager.RollbackNodePoolUpgrade", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_SetNodePoolManagement_async", + "title": "ClusterManager setNodePoolManagement Sample", + "origin": "API_DEFINITION", + "description": " Sets the NodeManagement options for a node pool.", + "canonical": true, + "file": "cluster_manager.set_node_pool_management.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetNodePoolManagement", + "fullName": "google.container.v1.ClusterManager.SetNodePoolManagement", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "management", + "type": ".google.container.v1.NodeManagement" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "SetNodePoolManagement", + "fullName": "google.container.v1.ClusterManager.SetNodePoolManagement", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_SetLabels_async", + "title": "ClusterManager setLabels Sample", + "origin": "API_DEFINITION", + "description": " Sets labels on a cluster.", + "canonical": true, + "file": "cluster_manager.set_labels.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetLabels", + "fullName": "google.container.v1.ClusterManager.SetLabels", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "resource_labels", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "label_fingerprint", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "SetLabels", + "fullName": "google.container.v1.ClusterManager.SetLabels", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_SetLegacyAbac_async", + "title": "ClusterManager setLegacyAbac Sample", + "origin": "API_DEFINITION", + "description": " Enables or disables the ABAC authorization mechanism on a cluster.", + "canonical": true, + "file": "cluster_manager.set_legacy_abac.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetLegacyAbac", + "fullName": "google.container.v1.ClusterManager.SetLegacyAbac", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "enabled", + "type": "TYPE_BOOL" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "SetLegacyAbac", + "fullName": "google.container.v1.ClusterManager.SetLegacyAbac", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_StartIPRotation_async", + "title": "ClusterManager startIPRotation Sample", + "origin": "API_DEFINITION", + "description": " Starts master IP rotation.", + "canonical": true, + "file": "cluster_manager.start_i_p_rotation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StartIPRotation", + "fullName": "google.container.v1.ClusterManager.StartIPRotation", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "rotate_credentials", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "StartIPRotation", + "fullName": "google.container.v1.ClusterManager.StartIPRotation", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_CompleteIPRotation_async", + "title": "ClusterManager completeIPRotation Sample", + "origin": "API_DEFINITION", + "description": " Completes master IP rotation.", + "canonical": true, + "file": "cluster_manager.complete_i_p_rotation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CompleteIPRotation", + "fullName": "google.container.v1.ClusterManager.CompleteIPRotation", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "CompleteIPRotation", + "fullName": "google.container.v1.ClusterManager.CompleteIPRotation", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_SetNodePoolSize_async", + "title": "ClusterManager setNodePoolSize Sample", + "origin": "API_DEFINITION", + "description": " Sets the size for a specific node pool. The new size will be used for all replicas, including future replicas created by modifying [NodePool.locations][google.container.v1.NodePool.locations].", + "canonical": true, + "file": "cluster_manager.set_node_pool_size.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetNodePoolSize", + "fullName": "google.container.v1.ClusterManager.SetNodePoolSize", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "node_count", + "type": "TYPE_INT32" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "SetNodePoolSize", + "fullName": "google.container.v1.ClusterManager.SetNodePoolSize", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_SetNetworkPolicy_async", + "title": "ClusterManager setNetworkPolicy Sample", + "origin": "API_DEFINITION", + "description": " Enables or disables Network Policy for a cluster.", + "canonical": true, + "file": "cluster_manager.set_network_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetNetworkPolicy", + "fullName": "google.container.v1.ClusterManager.SetNetworkPolicy", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "network_policy", + "type": ".google.container.v1.NetworkPolicy" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "SetNetworkPolicy", + "fullName": "google.container.v1.ClusterManager.SetNetworkPolicy", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_SetMaintenancePolicy_async", + "title": "ClusterManager setMaintenancePolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the maintenance policy for a cluster.", + "canonical": true, + "file": "cluster_manager.set_maintenance_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetMaintenancePolicy", + "fullName": "google.container.v1.ClusterManager.SetMaintenancePolicy", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "maintenance_policy", + "type": ".google.container.v1.MaintenancePolicy" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "SetMaintenancePolicy", + "fullName": "google.container.v1.ClusterManager.SetMaintenancePolicy", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_ListUsableSubnetworks_async", + "title": "ClusterManager listUsableSubnetworks Sample", + "origin": "API_DEFINITION", + "description": " Lists subnetworks that are usable for creating clusters in a project.", + "canonical": true, + "file": "cluster_manager.list_usable_subnetworks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListUsableSubnetworks", + "fullName": "google.container.v1.ClusterManager.ListUsableSubnetworks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.ListUsableSubnetworksResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "ListUsableSubnetworks", + "fullName": "google.container.v1.ClusterManager.ListUsableSubnetworks", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1_generated_ClusterManager_CheckAutopilotCompatibility_async", + "title": "ClusterManager checkAutopilotCompatibility Sample", + "origin": "API_DEFINITION", + "description": " Checks the cluster compatibility with Autopilot mode, and returns a list of compatibility issues.", + "canonical": true, + "file": "cluster_manager.check_autopilot_compatibility.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CheckAutopilotCompatibility", + "fullName": "google.container.v1.ClusterManager.CheckAutopilotCompatibility", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.CheckAutopilotCompatibilityResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "CheckAutopilotCompatibility", + "fullName": "google.container.v1.ClusterManager.CheckAutopilotCompatibility", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-container/v1/src/index.ts b/owl-bot-staging/google-container/v1/src/index.ts new file mode 100644 index 00000000000..7f3539e2b2d --- /dev/null +++ b/owl-bot-staging/google-container/v1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +const ClusterManagerClient = v1.ClusterManagerClient; +type ClusterManagerClient = v1.ClusterManagerClient; +export {v1, ClusterManagerClient}; +export default {v1, ClusterManagerClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-container/v1/src/v1/cluster_manager_client.ts b/owl-bot-staging/google-container/v1/src/v1/cluster_manager_client.ts new file mode 100644 index 00000000000..6805bf5ddf2 --- /dev/null +++ b/owl-bot-staging/google-container/v1/src/v1/cluster_manager_client.ts @@ -0,0 +1,3551 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/cluster_manager_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './cluster_manager_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Google Kubernetes Engine Cluster Manager v1 + * @class + * @memberof v1 + */ +export class ClusterManagerClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + clusterManagerStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ClusterManagerClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new ClusterManagerClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ClusterManagerClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listUsableSubnetworks: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'subnetworks') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.container.v1.ClusterManager', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.clusterManagerStub) { + return this.clusterManagerStub; + } + + // Put together the "service stub" for + // google.container.v1.ClusterManager. + this.clusterManagerStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.container.v1.ClusterManager') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.container.v1.ClusterManager, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const clusterManagerStubMethods = + ['listClusters', 'getCluster', 'createCluster', 'updateCluster', 'updateNodePool', 'setNodePoolAutoscaling', 'setLoggingService', 'setMonitoringService', 'setAddonsConfig', 'setLocations', 'updateMaster', 'setMasterAuth', 'deleteCluster', 'listOperations', 'getOperation', 'cancelOperation', 'getServerConfig', 'getJsonWebKeys', 'listNodePools', 'getNodePool', 'createNodePool', 'deleteNodePool', 'completeNodePoolUpgrade', 'rollbackNodePoolUpgrade', 'setNodePoolManagement', 'setLabels', 'setLegacyAbac', 'startIpRotation', 'completeIpRotation', 'setNodePoolSize', 'setNetworkPolicy', 'setMaintenancePolicy', 'listUsableSubnetworks', 'checkAutopilotCompatibility']; + for (const methodName of clusterManagerStubMethods) { + const callPromise = this.clusterManagerStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.clusterManagerStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'container.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'container.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Lists all clusters owned by a project in either the specified zone or all + * zones. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the parent field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides, or "-" for all zones. This field has been deprecated and + * replaced by the parent field. + * @param {string} request.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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.ListClustersResponse | ListClustersResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.list_clusters.js + * region_tag:container_v1_generated_ClusterManager_ListClusters_async + */ + listClusters( + request?: protos.google.container.v1.IListClustersRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IListClustersResponse, + protos.google.container.v1.IListClustersRequest|undefined, {}|undefined + ]>; + listClusters( + request: protos.google.container.v1.IListClustersRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IListClustersResponse, + protos.google.container.v1.IListClustersRequest|null|undefined, + {}|null|undefined>): void; + listClusters( + request: protos.google.container.v1.IListClustersRequest, + callback: Callback< + protos.google.container.v1.IListClustersResponse, + protos.google.container.v1.IListClustersRequest|null|undefined, + {}|null|undefined>): void; + listClusters( + request?: protos.google.container.v1.IListClustersRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IListClustersResponse, + protos.google.container.v1.IListClustersRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IListClustersResponse, + protos.google.container.v1.IListClustersRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IListClustersResponse, + protos.google.container.v1.IListClustersRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + }); + this.initialize(); + return this.innerApiCalls.listClusters(request, options, callback); + } +/** + * Gets the details of a specific cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to retrieve. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to retrieve. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Cluster | Cluster}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.get_cluster.js + * region_tag:container_v1_generated_ClusterManager_GetCluster_async + */ + getCluster( + request?: protos.google.container.v1.IGetClusterRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.ICluster, + protos.google.container.v1.IGetClusterRequest|undefined, {}|undefined + ]>; + getCluster( + request: protos.google.container.v1.IGetClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.ICluster, + protos.google.container.v1.IGetClusterRequest|null|undefined, + {}|null|undefined>): void; + getCluster( + request: protos.google.container.v1.IGetClusterRequest, + callback: Callback< + protos.google.container.v1.ICluster, + protos.google.container.v1.IGetClusterRequest|null|undefined, + {}|null|undefined>): void; + getCluster( + request?: protos.google.container.v1.IGetClusterRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.ICluster, + protos.google.container.v1.IGetClusterRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.ICluster, + protos.google.container.v1.IGetClusterRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.ICluster, + protos.google.container.v1.IGetClusterRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.getCluster(request, options, callback); + } +/** + * 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](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). + * + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the parent field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the parent + * field. + * @param {google.container.v1.Cluster} request.cluster + * Required. A [cluster + * resource](https://cloud.google.com/container-engine/reference/rest/v1/projects.locations.clusters) + * @param {string} request.parent + * The parent (project and location) where the cluster will be created. + * Specified in the format `projects/* /locations/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.create_cluster.js + * region_tag:container_v1_generated_ClusterManager_CreateCluster_async + */ + createCluster( + request?: protos.google.container.v1.ICreateClusterRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ICreateClusterRequest|undefined, {}|undefined + ]>; + createCluster( + request: protos.google.container.v1.ICreateClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ICreateClusterRequest|null|undefined, + {}|null|undefined>): void; + createCluster( + request: protos.google.container.v1.ICreateClusterRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ICreateClusterRequest|null|undefined, + {}|null|undefined>): void; + createCluster( + request?: protos.google.container.v1.ICreateClusterRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ICreateClusterRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ICreateClusterRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ICreateClusterRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + }); + this.initialize(); + return this.innerApiCalls.createCluster(request, options, callback); + } +/** + * Updates the settings of a specific cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {google.container.v1.ClusterUpdate} request.update + * Required. A description of the update. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to update. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.update_cluster.js + * region_tag:container_v1_generated_ClusterManager_UpdateCluster_async + */ + updateCluster( + request?: protos.google.container.v1.IUpdateClusterRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateClusterRequest|undefined, {}|undefined + ]>; + updateCluster( + request: protos.google.container.v1.IUpdateClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateClusterRequest|null|undefined, + {}|null|undefined>): void; + updateCluster( + request: protos.google.container.v1.IUpdateClusterRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateClusterRequest|null|undefined, + {}|null|undefined>): void; + updateCluster( + request?: protos.google.container.v1.IUpdateClusterRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateClusterRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateClusterRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateClusterRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateCluster(request, options, callback); + } +/** + * Updates the version and/or image type for the specified node pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Deprecated. The name of the node pool to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodeVersion + * 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 + * @param {string} request.imageType + * Required. The desired image type for the node pool. Please see + * https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for + * available image types. + * @param {string} request.name + * The name (project, location, cluster, node pool) of the node pool to + * update. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {string[]} request.locations + * The desired list of Google Compute Engine + * [zones](https://cloud.google.com/compute/docs/zones#available) in which the + * node pool's nodes should be located. Changing the locations for a node pool + * will result in nodes being either created or removed from the node pool, + * depending on whether locations are being added or removed. + * @param {google.container.v1.WorkloadMetadataConfig} request.workloadMetadataConfig + * The desired workload metadata config for the node pool. + * @param {google.container.v1.NodePool.UpgradeSettings} request.upgradeSettings + * Upgrade settings control disruption and speed of the upgrade. + * @param {google.container.v1.NetworkTags} request.tags + * The desired network tags to be applied to all nodes in the node pool. + * If this field is not present, the tags will not be changed. Otherwise, + * the existing network tags will be *replaced* with the provided tags. + * @param {google.container.v1.NodeTaints} request.taints + * The desired node taints to be applied to all nodes in the node pool. + * If this field is not present, the taints will not be changed. Otherwise, + * the existing node taints will be *replaced* with the provided taints. + * @param {google.container.v1.NodeLabels} request.labels + * The desired node labels to be applied to all nodes in the node pool. + * If this field is not present, the labels will not be changed. Otherwise, + * the existing node labels will be *replaced* with the provided labels. + * @param {google.container.v1.LinuxNodeConfig} request.linuxNodeConfig + * Parameters that can be configured on Linux nodes. + * @param {google.container.v1.NodeKubeletConfig} request.kubeletConfig + * Node kubelet configs. + * @param {google.container.v1.NodeNetworkConfig} request.nodeNetworkConfig + * Node network config. + * @param {google.container.v1.GcfsConfig} request.gcfsConfig + * GCFS config. + * @param {google.container.v1.ConfidentialNodes} request.confidentialNodes + * Confidential nodes config. + * All the nodes in the node pool will be Confidential VM once enabled. + * @param {google.container.v1.VirtualNIC} request.gvnic + * Enable or disable gvnic on the node pool. + * @param {string} request.etag + * The current etag of the node pool. + * If an etag is provided and does not match the current etag of the node + * pool, update will be blocked and an ABORTED error will be returned. + * @param {google.container.v1.FastSocket} request.fastSocket + * Enable or disable NCCL fast socket for the node pool. + * @param {google.container.v1.NodePoolLoggingConfig} request.loggingConfig + * Logging configuration. + * @param {google.container.v1.ResourceLabels} request.resourceLabels + * The resource labels for the node pool to use to annotate any related + * Google Compute Engine resources. + * @param {google.container.v1.WindowsNodeConfig} request.windowsNodeConfig + * Parameters that can be configured on Windows nodes. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.update_node_pool.js + * region_tag:container_v1_generated_ClusterManager_UpdateNodePool_async + */ + updateNodePool( + request?: protos.google.container.v1.IUpdateNodePoolRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateNodePoolRequest|undefined, {}|undefined + ]>; + updateNodePool( + request: protos.google.container.v1.IUpdateNodePoolRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateNodePoolRequest|null|undefined, + {}|null|undefined>): void; + updateNodePool( + request: protos.google.container.v1.IUpdateNodePoolRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateNodePoolRequest|null|undefined, + {}|null|undefined>): void; + updateNodePool( + request?: protos.google.container.v1.IUpdateNodePoolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateNodePoolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateNodePoolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateNodePoolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateNodePool(request, options, callback); + } +/** + * Sets the autoscaling settings for the specified node pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Deprecated. The name of the node pool to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {google.container.v1.NodePoolAutoscaling} request.autoscaling + * Required. Autoscaling configuration for the node pool. + * @param {string} request.name + * The name (project, location, cluster, node pool) of the node pool to set + * autoscaler settings. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.set_node_pool_autoscaling.js + * region_tag:container_v1_generated_ClusterManager_SetNodePoolAutoscaling_async + */ + setNodePoolAutoscaling( + request?: protos.google.container.v1.ISetNodePoolAutoscalingRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolAutoscalingRequest|undefined, {}|undefined + ]>; + setNodePoolAutoscaling( + request: protos.google.container.v1.ISetNodePoolAutoscalingRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolAutoscalingRequest|null|undefined, + {}|null|undefined>): void; + setNodePoolAutoscaling( + request: protos.google.container.v1.ISetNodePoolAutoscalingRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolAutoscalingRequest|null|undefined, + {}|null|undefined>): void; + setNodePoolAutoscaling( + request?: protos.google.container.v1.ISetNodePoolAutoscalingRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolAutoscalingRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolAutoscalingRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolAutoscalingRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setNodePoolAutoscaling(request, options, callback); + } +/** + * Sets the logging service for a specific cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string} request.loggingService + * Required. The logging service the cluster should use to write logs. + * Currently available options: + * + * * `logging.googleapis.com/kubernetes` - The Cloud Logging + * service with a Kubernetes-native resource model + * * `logging.googleapis.com` - The legacy Cloud Logging service (no longer + * available as of GKE 1.15). + * * `none` - no logs will be exported from the cluster. + * + * If left as an empty string,`logging.googleapis.com/kubernetes` will be + * used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to set logging. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.set_logging_service.js + * region_tag:container_v1_generated_ClusterManager_SetLoggingService_async + */ + setLoggingService( + request?: protos.google.container.v1.ISetLoggingServiceRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLoggingServiceRequest|undefined, {}|undefined + ]>; + setLoggingService( + request: protos.google.container.v1.ISetLoggingServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLoggingServiceRequest|null|undefined, + {}|null|undefined>): void; + setLoggingService( + request: protos.google.container.v1.ISetLoggingServiceRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLoggingServiceRequest|null|undefined, + {}|null|undefined>): void; + setLoggingService( + request?: protos.google.container.v1.ISetLoggingServiceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLoggingServiceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLoggingServiceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLoggingServiceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setLoggingService(request, options, callback); + } +/** + * Sets the monitoring service for a specific cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string} request.monitoringService + * Required. The monitoring service the cluster should use to write metrics. + * Currently available options: + * + * * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring + * service with a Kubernetes-native resource model + * * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no + * longer available as of GKE 1.15). + * * `none` - No metrics will be exported from the cluster. + * + * If left as an empty string,`monitoring.googleapis.com/kubernetes` will be + * used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to set monitoring. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.set_monitoring_service.js + * region_tag:container_v1_generated_ClusterManager_SetMonitoringService_async + */ + setMonitoringService( + request?: protos.google.container.v1.ISetMonitoringServiceRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMonitoringServiceRequest|undefined, {}|undefined + ]>; + setMonitoringService( + request: protos.google.container.v1.ISetMonitoringServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMonitoringServiceRequest|null|undefined, + {}|null|undefined>): void; + setMonitoringService( + request: protos.google.container.v1.ISetMonitoringServiceRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMonitoringServiceRequest|null|undefined, + {}|null|undefined>): void; + setMonitoringService( + request?: protos.google.container.v1.ISetMonitoringServiceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMonitoringServiceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMonitoringServiceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMonitoringServiceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setMonitoringService(request, options, callback); + } +/** + * Sets the addons for a specific cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {google.container.v1.AddonsConfig} request.addonsConfig + * Required. The desired configurations for the various addons available to + * run in the cluster. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to set addons. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.set_addons_config.js + * region_tag:container_v1_generated_ClusterManager_SetAddonsConfig_async + */ + setAddonsConfig( + request?: protos.google.container.v1.ISetAddonsConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetAddonsConfigRequest|undefined, {}|undefined + ]>; + setAddonsConfig( + request: protos.google.container.v1.ISetAddonsConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetAddonsConfigRequest|null|undefined, + {}|null|undefined>): void; + setAddonsConfig( + request: protos.google.container.v1.ISetAddonsConfigRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetAddonsConfigRequest|null|undefined, + {}|null|undefined>): void; + setAddonsConfig( + request?: protos.google.container.v1.ISetAddonsConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetAddonsConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetAddonsConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetAddonsConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setAddonsConfig(request, options, callback); + } +/** + * Sets the locations for a specific cluster. + * Deprecated. Use + * [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update) + * instead. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string[]} request.locations + * Required. The desired list of Google Compute Engine + * [zones](https://cloud.google.com/compute/docs/zones#available) 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. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to set locations. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.set_locations.js + * region_tag:container_v1_generated_ClusterManager_SetLocations_async + * @deprecated SetLocations is deprecated and may be removed in a future version. + */ + setLocations( + request?: protos.google.container.v1.ISetLocationsRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLocationsRequest|undefined, {}|undefined + ]>; + setLocations( + request: protos.google.container.v1.ISetLocationsRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLocationsRequest|null|undefined, + {}|null|undefined>): void; + setLocations( + request: protos.google.container.v1.ISetLocationsRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLocationsRequest|null|undefined, + {}|null|undefined>): void; + setLocations( + request?: protos.google.container.v1.ISetLocationsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLocationsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLocationsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLocationsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + this.warn('DEP$ClusterManager-$SetLocations','SetLocations is deprecated and may be removed in a future version.', 'DeprecationWarning'); + return this.innerApiCalls.setLocations(request, options, callback); + } +/** + * Updates the master for a specific cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string} request.masterVersion + * 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 + * @param {string} request.name + * The name (project, location, cluster) of the cluster to update. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.update_master.js + * region_tag:container_v1_generated_ClusterManager_UpdateMaster_async + */ + updateMaster( + request?: protos.google.container.v1.IUpdateMasterRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateMasterRequest|undefined, {}|undefined + ]>; + updateMaster( + request: protos.google.container.v1.IUpdateMasterRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateMasterRequest|null|undefined, + {}|null|undefined>): void; + updateMaster( + request: protos.google.container.v1.IUpdateMasterRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateMasterRequest|null|undefined, + {}|null|undefined>): void; + updateMaster( + request?: protos.google.container.v1.IUpdateMasterRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateMasterRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateMasterRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IUpdateMasterRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateMaster(request, options, callback); + } +/** + * Sets master auth materials. Currently supports changing the admin password + * or a specific cluster, either via password generation or explicitly setting + * the password. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {google.container.v1.SetMasterAuthRequest.Action} request.action + * Required. The exact form of action to be taken on the master auth. + * @param {google.container.v1.MasterAuth} request.update + * Required. A description of the update. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to set auth. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.set_master_auth.js + * region_tag:container_v1_generated_ClusterManager_SetMasterAuth_async + */ + setMasterAuth( + request?: protos.google.container.v1.ISetMasterAuthRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMasterAuthRequest|undefined, {}|undefined + ]>; + setMasterAuth( + request: protos.google.container.v1.ISetMasterAuthRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMasterAuthRequest|null|undefined, + {}|null|undefined>): void; + setMasterAuth( + request: protos.google.container.v1.ISetMasterAuthRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMasterAuthRequest|null|undefined, + {}|null|undefined>): void; + setMasterAuth( + request?: protos.google.container.v1.ISetMasterAuthRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMasterAuthRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMasterAuthRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMasterAuthRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setMasterAuth(request, options, callback); + } +/** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to delete. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to delete. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.delete_cluster.js + * region_tag:container_v1_generated_ClusterManager_DeleteCluster_async + */ + deleteCluster( + request?: protos.google.container.v1.IDeleteClusterRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IDeleteClusterRequest|undefined, {}|undefined + ]>; + deleteCluster( + request: protos.google.container.v1.IDeleteClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IDeleteClusterRequest|null|undefined, + {}|null|undefined>): void; + deleteCluster( + request: protos.google.container.v1.IDeleteClusterRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IDeleteClusterRequest|null|undefined, + {}|null|undefined>): void; + deleteCluster( + request?: protos.google.container.v1.IDeleteClusterRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IDeleteClusterRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IDeleteClusterRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IDeleteClusterRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteCluster(request, options, callback); + } +/** + * Lists all operations in a project in a specific zone or all zones. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the parent field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) to return + * operations for, or `-` for all zones. This field has been deprecated and + * replaced by the parent field. + * @param {string} request.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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.ListOperationsResponse | ListOperationsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.list_operations.js + * region_tag:container_v1_generated_ClusterManager_ListOperations_async + */ + listOperations( + request?: protos.google.container.v1.IListOperationsRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IListOperationsResponse, + protos.google.container.v1.IListOperationsRequest|undefined, {}|undefined + ]>; + listOperations( + request: protos.google.container.v1.IListOperationsRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IListOperationsResponse, + protos.google.container.v1.IListOperationsRequest|null|undefined, + {}|null|undefined>): void; + listOperations( + request: protos.google.container.v1.IListOperationsRequest, + callback: Callback< + protos.google.container.v1.IListOperationsResponse, + protos.google.container.v1.IListOperationsRequest|null|undefined, + {}|null|undefined>): void; + listOperations( + request?: protos.google.container.v1.IListOperationsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IListOperationsResponse, + protos.google.container.v1.IListOperationsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IListOperationsResponse, + protos.google.container.v1.IListOperationsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IListOperationsResponse, + protos.google.container.v1.IListOperationsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + }); + this.initialize(); + return this.innerApiCalls.listOperations(request, options, callback); + } +/** + * Gets the specified operation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.operationId + * Deprecated. The server-assigned `name` of the operation. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, operation id) of the operation to get. + * Specified in the format `projects/* /locations/* /operations/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.get_operation.js + * region_tag:container_v1_generated_ClusterManager_GetOperation_async + */ + getOperation( + request?: protos.google.container.v1.IGetOperationRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IGetOperationRequest|undefined, {}|undefined + ]>; + getOperation( + request: protos.google.container.v1.IGetOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IGetOperationRequest|null|undefined, + {}|null|undefined>): void; + getOperation( + request: protos.google.container.v1.IGetOperationRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IGetOperationRequest|null|undefined, + {}|null|undefined>): void; + getOperation( + request?: protos.google.container.v1.IGetOperationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IGetOperationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IGetOperationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IGetOperationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'operation_id': request.operationId ?? '', + }); + this.initialize(); + return this.innerApiCalls.getOperation(request, options, callback); + } +/** + * Cancels the specified operation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * operation resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.operationId + * Deprecated. The server-assigned `name` of the operation. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, operation id) of the operation to cancel. + * Specified in the format `projects/* /locations/* /operations/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.cancel_operation.js + * region_tag:container_v1_generated_ClusterManager_CancelOperation_async + */ + cancelOperation( + request?: protos.google.container.v1.ICancelOperationRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.container.v1.ICancelOperationRequest|undefined, {}|undefined + ]>; + cancelOperation( + request: protos.google.container.v1.ICancelOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1.ICancelOperationRequest|null|undefined, + {}|null|undefined>): void; + cancelOperation( + request: protos.google.container.v1.ICancelOperationRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1.ICancelOperationRequest|null|undefined, + {}|null|undefined>): void; + cancelOperation( + request?: protos.google.container.v1.ICancelOperationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1.ICancelOperationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1.ICancelOperationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.container.v1.ICancelOperationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'operation_id': request.operationId ?? '', + }); + this.initialize(); + return this.innerApiCalls.cancelOperation(request, options, callback); + } +/** + * Returns configuration info about the Google Kubernetes Engine service. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) to return + * operations for. This field has been deprecated and replaced by the name + * field. + * @param {string} request.name + * The name (project and location) of the server config to get, + * specified in the format `projects/* /locations/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.ServerConfig | ServerConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.get_server_config.js + * region_tag:container_v1_generated_ClusterManager_GetServerConfig_async + */ + getServerConfig( + request?: protos.google.container.v1.IGetServerConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IServerConfig, + protos.google.container.v1.IGetServerConfigRequest|undefined, {}|undefined + ]>; + getServerConfig( + request: protos.google.container.v1.IGetServerConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IServerConfig, + protos.google.container.v1.IGetServerConfigRequest|null|undefined, + {}|null|undefined>): void; + getServerConfig( + request: protos.google.container.v1.IGetServerConfigRequest, + callback: Callback< + protos.google.container.v1.IServerConfig, + protos.google.container.v1.IGetServerConfigRequest|null|undefined, + {}|null|undefined>): void; + getServerConfig( + request?: protos.google.container.v1.IGetServerConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IServerConfig, + protos.google.container.v1.IGetServerConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IServerConfig, + protos.google.container.v1.IGetServerConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IServerConfig, + protos.google.container.v1.IGetServerConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + }); + this.initialize(); + return this.innerApiCalls.getServerConfig(request, options, callback); + } +/** + * Gets the public component of the cluster signing keys in + * JSON Web Key format. + * This API is not yet intended for general use, and is not available for all + * clusters. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The cluster (project, location, cluster name) to get keys for. Specified in + * the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.GetJSONWebKeysResponse | GetJSONWebKeysResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.get_j_s_o_n_web_keys.js + * region_tag:container_v1_generated_ClusterManager_GetJSONWebKeys_async + */ + getJSONWebKeys( + request?: protos.google.container.v1.IGetJSONWebKeysRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IGetJSONWebKeysResponse, + protos.google.container.v1.IGetJSONWebKeysRequest|undefined, {}|undefined + ]>; + getJSONWebKeys( + request: protos.google.container.v1.IGetJSONWebKeysRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IGetJSONWebKeysResponse, + protos.google.container.v1.IGetJSONWebKeysRequest|null|undefined, + {}|null|undefined>): void; + getJSONWebKeys( + request: protos.google.container.v1.IGetJSONWebKeysRequest, + callback: Callback< + protos.google.container.v1.IGetJSONWebKeysResponse, + protos.google.container.v1.IGetJSONWebKeysRequest|null|undefined, + {}|null|undefined>): void; + getJSONWebKeys( + request?: protos.google.container.v1.IGetJSONWebKeysRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IGetJSONWebKeysResponse, + protos.google.container.v1.IGetJSONWebKeysRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IGetJSONWebKeysResponse, + protos.google.container.v1.IGetJSONWebKeysRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IGetJSONWebKeysResponse, + protos.google.container.v1.IGetJSONWebKeysRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.getJsonWebKeys(request, options, callback); + } +/** + * Lists the node pools for a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the parent field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the parent + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the parent field. + * @param {string} request.parent + * The parent (project, location, cluster name) where the node pools will be + * listed. Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.ListNodePoolsResponse | ListNodePoolsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.list_node_pools.js + * region_tag:container_v1_generated_ClusterManager_ListNodePools_async + */ + listNodePools( + request?: protos.google.container.v1.IListNodePoolsRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IListNodePoolsResponse, + protos.google.container.v1.IListNodePoolsRequest|undefined, {}|undefined + ]>; + listNodePools( + request: protos.google.container.v1.IListNodePoolsRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IListNodePoolsResponse, + protos.google.container.v1.IListNodePoolsRequest|null|undefined, + {}|null|undefined>): void; + listNodePools( + request: protos.google.container.v1.IListNodePoolsRequest, + callback: Callback< + protos.google.container.v1.IListNodePoolsResponse, + protos.google.container.v1.IListNodePoolsRequest|null|undefined, + {}|null|undefined>): void; + listNodePools( + request?: protos.google.container.v1.IListNodePoolsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IListNodePoolsResponse, + protos.google.container.v1.IListNodePoolsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IListNodePoolsResponse, + protos.google.container.v1.IListNodePoolsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IListNodePoolsResponse, + protos.google.container.v1.IListNodePoolsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.listNodePools(request, options, callback); + } +/** + * Retrieves the requested node pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Deprecated. The name of the node pool. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster, node pool id) of the node pool to + * get. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.NodePool | NodePool}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.get_node_pool.js + * region_tag:container_v1_generated_ClusterManager_GetNodePool_async + */ + getNodePool( + request?: protos.google.container.v1.IGetNodePoolRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.INodePool, + protos.google.container.v1.IGetNodePoolRequest|undefined, {}|undefined + ]>; + getNodePool( + request: protos.google.container.v1.IGetNodePoolRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.INodePool, + protos.google.container.v1.IGetNodePoolRequest|null|undefined, + {}|null|undefined>): void; + getNodePool( + request: protos.google.container.v1.IGetNodePoolRequest, + callback: Callback< + protos.google.container.v1.INodePool, + protos.google.container.v1.IGetNodePoolRequest|null|undefined, + {}|null|undefined>): void; + getNodePool( + request?: protos.google.container.v1.IGetNodePoolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.INodePool, + protos.google.container.v1.IGetNodePoolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.INodePool, + protos.google.container.v1.IGetNodePoolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.INodePool, + protos.google.container.v1.IGetNodePoolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.getNodePool(request, options, callback); + } +/** + * Creates a node pool for a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the parent field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the parent + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the parent field. + * @param {google.container.v1.NodePool} request.nodePool + * Required. The node pool to create. + * @param {string} request.parent + * The parent (project, location, cluster name) where the node pool will be + * created. Specified in the format + * `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.create_node_pool.js + * region_tag:container_v1_generated_ClusterManager_CreateNodePool_async + */ + createNodePool( + request?: protos.google.container.v1.ICreateNodePoolRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ICreateNodePoolRequest|undefined, {}|undefined + ]>; + createNodePool( + request: protos.google.container.v1.ICreateNodePoolRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ICreateNodePoolRequest|null|undefined, + {}|null|undefined>): void; + createNodePool( + request: protos.google.container.v1.ICreateNodePoolRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ICreateNodePoolRequest|null|undefined, + {}|null|undefined>): void; + createNodePool( + request?: protos.google.container.v1.ICreateNodePoolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ICreateNodePoolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ICreateNodePoolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ICreateNodePoolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.createNodePool(request, options, callback); + } +/** + * Deletes a node pool from a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Deprecated. The name of the node pool to delete. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster, node pool id) of the node pool to + * delete. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.delete_node_pool.js + * region_tag:container_v1_generated_ClusterManager_DeleteNodePool_async + */ + deleteNodePool( + request?: protos.google.container.v1.IDeleteNodePoolRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IDeleteNodePoolRequest|undefined, {}|undefined + ]>; + deleteNodePool( + request: protos.google.container.v1.IDeleteNodePoolRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IDeleteNodePoolRequest|null|undefined, + {}|null|undefined>): void; + deleteNodePool( + request: protos.google.container.v1.IDeleteNodePoolRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IDeleteNodePoolRequest|null|undefined, + {}|null|undefined>): void; + deleteNodePool( + request?: protos.google.container.v1.IDeleteNodePoolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IDeleteNodePoolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IDeleteNodePoolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IDeleteNodePoolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteNodePool(request, options, callback); + } +/** + * CompleteNodePoolUpgrade will signal an on-going node pool upgrade to + * complete. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The name (project, location, cluster, node pool id) of the node pool to + * complete upgrade. + * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js + * region_tag:container_v1_generated_ClusterManager_CompleteNodePoolUpgrade_async + */ + completeNodePoolUpgrade( + request?: protos.google.container.v1.ICompleteNodePoolUpgradeRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.container.v1.ICompleteNodePoolUpgradeRequest|undefined, {}|undefined + ]>; + completeNodePoolUpgrade( + request: protos.google.container.v1.ICompleteNodePoolUpgradeRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1.ICompleteNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>): void; + completeNodePoolUpgrade( + request: protos.google.container.v1.ICompleteNodePoolUpgradeRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1.ICompleteNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>): void; + completeNodePoolUpgrade( + request?: protos.google.container.v1.ICompleteNodePoolUpgradeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1.ICompleteNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1.ICompleteNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.container.v1.ICompleteNodePoolUpgradeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.completeNodePoolUpgrade(request, options, callback); + } +/** + * Rolls back a previously Aborted or Failed NodePool upgrade. + * This makes no changes if the last upgrade successfully completed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to rollback. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Deprecated. The name of the node pool to rollback. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster, node pool id) of the node poll to + * rollback upgrade. + * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {boolean} request.respectPdb + * Option for rollback to ignore the PodDisruptionBudget. + * Default value is false. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.rollback_node_pool_upgrade.js + * region_tag:container_v1_generated_ClusterManager_RollbackNodePoolUpgrade_async + */ + rollbackNodePoolUpgrade( + request?: protos.google.container.v1.IRollbackNodePoolUpgradeRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IRollbackNodePoolUpgradeRequest|undefined, {}|undefined + ]>; + rollbackNodePoolUpgrade( + request: protos.google.container.v1.IRollbackNodePoolUpgradeRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IRollbackNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>): void; + rollbackNodePoolUpgrade( + request: protos.google.container.v1.IRollbackNodePoolUpgradeRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IRollbackNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>): void; + rollbackNodePoolUpgrade( + request?: protos.google.container.v1.IRollbackNodePoolUpgradeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IRollbackNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IRollbackNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IRollbackNodePoolUpgradeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.rollbackNodePoolUpgrade(request, options, callback); + } +/** + * Sets the NodeManagement options for a node pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to update. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Deprecated. The name of the node pool to update. + * This field has been deprecated and replaced by the name field. + * @param {google.container.v1.NodeManagement} request.management + * Required. NodeManagement configuration for the node pool. + * @param {string} request.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/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.set_node_pool_management.js + * region_tag:container_v1_generated_ClusterManager_SetNodePoolManagement_async + */ + setNodePoolManagement( + request?: protos.google.container.v1.ISetNodePoolManagementRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolManagementRequest|undefined, {}|undefined + ]>; + setNodePoolManagement( + request: protos.google.container.v1.ISetNodePoolManagementRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolManagementRequest|null|undefined, + {}|null|undefined>): void; + setNodePoolManagement( + request: protos.google.container.v1.ISetNodePoolManagementRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolManagementRequest|null|undefined, + {}|null|undefined>): void; + setNodePoolManagement( + request?: protos.google.container.v1.ISetNodePoolManagementRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolManagementRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolManagementRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolManagementRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setNodePoolManagement(request, options, callback); + } +/** + * Sets labels on a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the name field. + * @param {number[]} request.resourceLabels + * Required. The labels to set for that cluster. + * @param {string} request.labelFingerprint + * 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. + * @param {string} request.name + * The name (project, location, cluster name) of the cluster to set labels. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.set_labels.js + * region_tag:container_v1_generated_ClusterManager_SetLabels_async + */ + setLabels( + request?: protos.google.container.v1.ISetLabelsRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLabelsRequest|undefined, {}|undefined + ]>; + setLabels( + request: protos.google.container.v1.ISetLabelsRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLabelsRequest|null|undefined, + {}|null|undefined>): void; + setLabels( + request: protos.google.container.v1.ISetLabelsRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLabelsRequest|null|undefined, + {}|null|undefined>): void; + setLabels( + request?: protos.google.container.v1.ISetLabelsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLabelsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLabelsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLabelsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setLabels(request, options, callback); + } +/** + * Enables or disables the ABAC authorization mechanism on a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to update. + * This field has been deprecated and replaced by the name field. + * @param {boolean} request.enabled + * Required. Whether ABAC authorization will be enabled in the cluster. + * @param {string} request.name + * The name (project, location, cluster name) of the cluster to set legacy + * abac. Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.set_legacy_abac.js + * region_tag:container_v1_generated_ClusterManager_SetLegacyAbac_async + */ + setLegacyAbac( + request?: protos.google.container.v1.ISetLegacyAbacRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLegacyAbacRequest|undefined, {}|undefined + ]>; + setLegacyAbac( + request: protos.google.container.v1.ISetLegacyAbacRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLegacyAbacRequest|null|undefined, + {}|null|undefined>): void; + setLegacyAbac( + request: protos.google.container.v1.ISetLegacyAbacRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLegacyAbacRequest|null|undefined, + {}|null|undefined>): void; + setLegacyAbac( + request?: protos.google.container.v1.ISetLegacyAbacRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLegacyAbacRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLegacyAbacRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetLegacyAbacRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setLegacyAbac(request, options, callback); + } +/** + * Starts master IP rotation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster name) of the cluster to start IP + * rotation. Specified in the format `projects/* /locations/* /clusters/*`. + * @param {boolean} request.rotateCredentials + * Whether to rotate credentials during IP rotation. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.start_i_p_rotation.js + * region_tag:container_v1_generated_ClusterManager_StartIPRotation_async + */ + startIPRotation( + request?: protos.google.container.v1.IStartIPRotationRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IStartIPRotationRequest|undefined, {}|undefined + ]>; + startIPRotation( + request: protos.google.container.v1.IStartIPRotationRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IStartIPRotationRequest|null|undefined, + {}|null|undefined>): void; + startIPRotation( + request: protos.google.container.v1.IStartIPRotationRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IStartIPRotationRequest|null|undefined, + {}|null|undefined>): void; + startIPRotation( + request?: protos.google.container.v1.IStartIPRotationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IStartIPRotationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.IStartIPRotationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.IStartIPRotationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.startIpRotation(request, options, callback); + } +/** + * Completes master IP rotation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster name) of the cluster to complete IP + * rotation. Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.complete_i_p_rotation.js + * region_tag:container_v1_generated_ClusterManager_CompleteIPRotation_async + */ + completeIPRotation( + request?: protos.google.container.v1.ICompleteIPRotationRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ICompleteIPRotationRequest|undefined, {}|undefined + ]>; + completeIPRotation( + request: protos.google.container.v1.ICompleteIPRotationRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ICompleteIPRotationRequest|null|undefined, + {}|null|undefined>): void; + completeIPRotation( + request: protos.google.container.v1.ICompleteIPRotationRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ICompleteIPRotationRequest|null|undefined, + {}|null|undefined>): void; + completeIPRotation( + request?: protos.google.container.v1.ICompleteIPRotationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ICompleteIPRotationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ICompleteIPRotationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ICompleteIPRotationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.completeIpRotation(request, options, callback); + } +/** + * Sets the size for a specific node pool. The new size will be used for all + * replicas, including future replicas created by modifying + * {@link google.container.v1.NodePool.locations|NodePool.locations}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster to update. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Deprecated. The name of the node pool to update. + * This field has been deprecated and replaced by the name field. + * @param {number} request.nodeCount + * Required. The desired node count for the pool. + * @param {string} request.name + * The name (project, location, cluster, node pool id) of the node pool to set + * size. + * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.set_node_pool_size.js + * region_tag:container_v1_generated_ClusterManager_SetNodePoolSize_async + */ + setNodePoolSize( + request?: protos.google.container.v1.ISetNodePoolSizeRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolSizeRequest|undefined, {}|undefined + ]>; + setNodePoolSize( + request: protos.google.container.v1.ISetNodePoolSizeRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolSizeRequest|null|undefined, + {}|null|undefined>): void; + setNodePoolSize( + request: protos.google.container.v1.ISetNodePoolSizeRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolSizeRequest|null|undefined, + {}|null|undefined>): void; + setNodePoolSize( + request?: protos.google.container.v1.ISetNodePoolSizeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolSizeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolSizeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNodePoolSizeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setNodePoolSize(request, options, callback); + } +/** + * Enables or disables Network Policy for a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the name field. + * @param {google.container.v1.NetworkPolicy} request.networkPolicy + * Required. Configuration options for the NetworkPolicy feature. + * @param {string} request.name + * The name (project, location, cluster name) of the cluster to set networking + * policy. Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.set_network_policy.js + * region_tag:container_v1_generated_ClusterManager_SetNetworkPolicy_async + */ + setNetworkPolicy( + request?: protos.google.container.v1.ISetNetworkPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNetworkPolicyRequest|undefined, {}|undefined + ]>; + setNetworkPolicy( + request: protos.google.container.v1.ISetNetworkPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNetworkPolicyRequest|null|undefined, + {}|null|undefined>): void; + setNetworkPolicy( + request: protos.google.container.v1.ISetNetworkPolicyRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNetworkPolicyRequest|null|undefined, + {}|null|undefined>): void; + setNetworkPolicy( + request?: protos.google.container.v1.ISetNetworkPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNetworkPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNetworkPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetNetworkPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setNetworkPolicy(request, options, callback); + } +/** + * Sets the maintenance policy for a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * @param {string} request.zone + * Required. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. + * @param {string} request.clusterId + * Required. The name of the cluster to update. + * @param {google.container.v1.MaintenancePolicy} request.maintenancePolicy + * Required. The maintenance policy to be set for the cluster. An empty field + * clears the existing maintenance policy. + * @param {string} request.name + * The name (project, location, cluster name) of the cluster to set + * maintenance policy. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.set_maintenance_policy.js + * region_tag:container_v1_generated_ClusterManager_SetMaintenancePolicy_async + */ + setMaintenancePolicy( + request?: protos.google.container.v1.ISetMaintenancePolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMaintenancePolicyRequest|undefined, {}|undefined + ]>; + setMaintenancePolicy( + request: protos.google.container.v1.ISetMaintenancePolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMaintenancePolicyRequest|null|undefined, + {}|null|undefined>): void; + setMaintenancePolicy( + request: protos.google.container.v1.ISetMaintenancePolicyRequest, + callback: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMaintenancePolicyRequest|null|undefined, + {}|null|undefined>): void; + setMaintenancePolicy( + request?: protos.google.container.v1.ISetMaintenancePolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMaintenancePolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMaintenancePolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.IOperation, + protos.google.container.v1.ISetMaintenancePolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setMaintenancePolicy(request, options, callback); + } +/** + * Checks the cluster compatibility with Autopilot mode, and returns a list of + * compatibility issues. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to retrieve. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1.CheckAutopilotCompatibilityResponse | CheckAutopilotCompatibilityResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.check_autopilot_compatibility.js + * region_tag:container_v1_generated_ClusterManager_CheckAutopilotCompatibility_async + */ + checkAutopilotCompatibility( + request?: protos.google.container.v1.ICheckAutopilotCompatibilityRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.ICheckAutopilotCompatibilityResponse, + protos.google.container.v1.ICheckAutopilotCompatibilityRequest|undefined, {}|undefined + ]>; + checkAutopilotCompatibility( + request: protos.google.container.v1.ICheckAutopilotCompatibilityRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.ICheckAutopilotCompatibilityResponse, + protos.google.container.v1.ICheckAutopilotCompatibilityRequest|null|undefined, + {}|null|undefined>): void; + checkAutopilotCompatibility( + request: protos.google.container.v1.ICheckAutopilotCompatibilityRequest, + callback: Callback< + protos.google.container.v1.ICheckAutopilotCompatibilityResponse, + protos.google.container.v1.ICheckAutopilotCompatibilityRequest|null|undefined, + {}|null|undefined>): void; + checkAutopilotCompatibility( + request?: protos.google.container.v1.ICheckAutopilotCompatibilityRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1.ICheckAutopilotCompatibilityResponse, + protos.google.container.v1.ICheckAutopilotCompatibilityRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1.ICheckAutopilotCompatibilityResponse, + protos.google.container.v1.ICheckAutopilotCompatibilityRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1.ICheckAutopilotCompatibilityResponse, + protos.google.container.v1.ICheckAutopilotCompatibilityRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.checkAutopilotCompatibility(request, options, callback); + } + + /** + * Lists subnetworks that are usable for creating clusters in a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The parent project where subnetworks are usable. + * Specified in the format `projects/*`. + * @param {string} request.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. + * @param {number} request.pageSize + * 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) + * @param {string} request.pageToken + * Specifies a page token to use. Set this to the nextPageToken returned by + * previous list requests to get the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.container.v1.UsableSubnetwork | UsableSubnetwork}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listUsableSubnetworksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listUsableSubnetworks( + request?: protos.google.container.v1.IListUsableSubnetworksRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1.IUsableSubnetwork[], + protos.google.container.v1.IListUsableSubnetworksRequest|null, + protos.google.container.v1.IListUsableSubnetworksResponse + ]>; + listUsableSubnetworks( + request: protos.google.container.v1.IListUsableSubnetworksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.container.v1.IListUsableSubnetworksRequest, + protos.google.container.v1.IListUsableSubnetworksResponse|null|undefined, + protos.google.container.v1.IUsableSubnetwork>): void; + listUsableSubnetworks( + request: protos.google.container.v1.IListUsableSubnetworksRequest, + callback: PaginationCallback< + protos.google.container.v1.IListUsableSubnetworksRequest, + protos.google.container.v1.IListUsableSubnetworksResponse|null|undefined, + protos.google.container.v1.IUsableSubnetwork>): void; + listUsableSubnetworks( + request?: protos.google.container.v1.IListUsableSubnetworksRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.container.v1.IListUsableSubnetworksRequest, + protos.google.container.v1.IListUsableSubnetworksResponse|null|undefined, + protos.google.container.v1.IUsableSubnetwork>, + callback?: PaginationCallback< + protos.google.container.v1.IListUsableSubnetworksRequest, + protos.google.container.v1.IListUsableSubnetworksResponse|null|undefined, + protos.google.container.v1.IUsableSubnetwork>): + Promise<[ + protos.google.container.v1.IUsableSubnetwork[], + protos.google.container.v1.IListUsableSubnetworksRequest|null, + protos.google.container.v1.IListUsableSubnetworksResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listUsableSubnetworks(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The parent project where subnetworks are usable. + * Specified in the format `projects/*`. + * @param {string} request.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. + * @param {number} request.pageSize + * 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) + * @param {string} request.pageToken + * Specifies a page token to use. Set this to the nextPageToken returned by + * previous list requests to get the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.container.v1.UsableSubnetwork | UsableSubnetwork} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listUsableSubnetworksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listUsableSubnetworksStream( + request?: protos.google.container.v1.IListUsableSubnetworksRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUsableSubnetworks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listUsableSubnetworks.createStream( + this.innerApiCalls.listUsableSubnetworks as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listUsableSubnetworks`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The parent project where subnetworks are usable. + * Specified in the format `projects/*`. + * @param {string} request.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. + * @param {number} request.pageSize + * 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) + * @param {string} request.pageToken + * Specifies a page token to use. Set this to the nextPageToken returned by + * previous list requests to get the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.container.v1.UsableSubnetwork | UsableSubnetwork}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.list_usable_subnetworks.js + * region_tag:container_v1_generated_ClusterManager_ListUsableSubnetworks_async + */ + listUsableSubnetworksAsync( + request?: protos.google.container.v1.IListUsableSubnetworksRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUsableSubnetworks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listUsableSubnetworks.asyncIterate( + this.innerApiCalls['listUsableSubnetworks'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.clusterManagerStub && !this._terminated) { + return this.clusterManagerStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-container/v1/src/v1/cluster_manager_client_config.json b/owl-bot-staging/google-container/v1/src/v1/cluster_manager_client_config.json new file mode 100644 index 00000000000..33fb266b6bd --- /dev/null +++ b/owl-bot-staging/google-container/v1/src/v1/cluster_manager_client_config.json @@ -0,0 +1,192 @@ +{ + "interfaces": { + "google.container.v1.ClusterManager": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListClusters": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetCluster": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateCluster": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCluster": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateNodePool": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetNodePoolAutoscaling": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLoggingService": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetMonitoringService": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetAddonsConfig": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLocations": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateMaster": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetMasterAuth": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCluster": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListOperations": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetOperation": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CancelOperation": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetServerConfig": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetJSONWebKeys": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListNodePools": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetNodePool": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateNodePool": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteNodePool": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CompleteNodePoolUpgrade": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RollbackNodePoolUpgrade": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetNodePoolManagement": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLabels": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLegacyAbac": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StartIPRotation": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CompleteIPRotation": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetNodePoolSize": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetNetworkPolicy": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetMaintenancePolicy": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListUsableSubnetworks": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CheckAutopilotCompatibility": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-container/v1/src/v1/cluster_manager_proto_list.json b/owl-bot-staging/google-container/v1/src/v1/cluster_manager_proto_list.json new file mode 100644 index 00000000000..aa69748e51b --- /dev/null +++ b/owl-bot-staging/google-container/v1/src/v1/cluster_manager_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/container/v1/cluster_service.proto" +] diff --git a/owl-bot-staging/google-container/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-container/v1/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..c08b06ded09 --- /dev/null +++ b/owl-bot-staging/google-container/v1/src/v1/gapic_metadata.json @@ -0,0 +1,367 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.container.v1", + "libraryPackage": "@google-cloud/container", + "services": { + "ClusterManager": { + "clients": { + "grpc": { + "libraryClient": "ClusterManagerClient", + "rpcs": { + "ListClusters": { + "methods": [ + "listClusters" + ] + }, + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "UpdateNodePool": { + "methods": [ + "updateNodePool" + ] + }, + "SetNodePoolAutoscaling": { + "methods": [ + "setNodePoolAutoscaling" + ] + }, + "SetLoggingService": { + "methods": [ + "setLoggingService" + ] + }, + "SetMonitoringService": { + "methods": [ + "setMonitoringService" + ] + }, + "SetAddonsConfig": { + "methods": [ + "setAddonsConfig" + ] + }, + "SetLocations": { + "methods": [ + "setLocations" + ] + }, + "UpdateMaster": { + "methods": [ + "updateMaster" + ] + }, + "SetMasterAuth": { + "methods": [ + "setMasterAuth" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "ListOperations": { + "methods": [ + "listOperations" + ] + }, + "GetOperation": { + "methods": [ + "getOperation" + ] + }, + "CancelOperation": { + "methods": [ + "cancelOperation" + ] + }, + "GetServerConfig": { + "methods": [ + "getServerConfig" + ] + }, + "GetJSONWebKeys": { + "methods": [ + "getJSONWebKeys" + ] + }, + "ListNodePools": { + "methods": [ + "listNodePools" + ] + }, + "GetNodePool": { + "methods": [ + "getNodePool" + ] + }, + "CreateNodePool": { + "methods": [ + "createNodePool" + ] + }, + "DeleteNodePool": { + "methods": [ + "deleteNodePool" + ] + }, + "CompleteNodePoolUpgrade": { + "methods": [ + "completeNodePoolUpgrade" + ] + }, + "RollbackNodePoolUpgrade": { + "methods": [ + "rollbackNodePoolUpgrade" + ] + }, + "SetNodePoolManagement": { + "methods": [ + "setNodePoolManagement" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "SetLegacyAbac": { + "methods": [ + "setLegacyAbac" + ] + }, + "StartIPRotation": { + "methods": [ + "startIPRotation" + ] + }, + "CompleteIPRotation": { + "methods": [ + "completeIPRotation" + ] + }, + "SetNodePoolSize": { + "methods": [ + "setNodePoolSize" + ] + }, + "SetNetworkPolicy": { + "methods": [ + "setNetworkPolicy" + ] + }, + "SetMaintenancePolicy": { + "methods": [ + "setMaintenancePolicy" + ] + }, + "CheckAutopilotCompatibility": { + "methods": [ + "checkAutopilotCompatibility" + ] + }, + "ListUsableSubnetworks": { + "methods": [ + "listUsableSubnetworks", + "listUsableSubnetworksStream", + "listUsableSubnetworksAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ClusterManagerClient", + "rpcs": { + "ListClusters": { + "methods": [ + "listClusters" + ] + }, + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "UpdateNodePool": { + "methods": [ + "updateNodePool" + ] + }, + "SetNodePoolAutoscaling": { + "methods": [ + "setNodePoolAutoscaling" + ] + }, + "SetLoggingService": { + "methods": [ + "setLoggingService" + ] + }, + "SetMonitoringService": { + "methods": [ + "setMonitoringService" + ] + }, + "SetAddonsConfig": { + "methods": [ + "setAddonsConfig" + ] + }, + "SetLocations": { + "methods": [ + "setLocations" + ] + }, + "UpdateMaster": { + "methods": [ + "updateMaster" + ] + }, + "SetMasterAuth": { + "methods": [ + "setMasterAuth" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "ListOperations": { + "methods": [ + "listOperations" + ] + }, + "GetOperation": { + "methods": [ + "getOperation" + ] + }, + "CancelOperation": { + "methods": [ + "cancelOperation" + ] + }, + "GetServerConfig": { + "methods": [ + "getServerConfig" + ] + }, + "GetJSONWebKeys": { + "methods": [ + "getJSONWebKeys" + ] + }, + "ListNodePools": { + "methods": [ + "listNodePools" + ] + }, + "GetNodePool": { + "methods": [ + "getNodePool" + ] + }, + "CreateNodePool": { + "methods": [ + "createNodePool" + ] + }, + "DeleteNodePool": { + "methods": [ + "deleteNodePool" + ] + }, + "CompleteNodePoolUpgrade": { + "methods": [ + "completeNodePoolUpgrade" + ] + }, + "RollbackNodePoolUpgrade": { + "methods": [ + "rollbackNodePoolUpgrade" + ] + }, + "SetNodePoolManagement": { + "methods": [ + "setNodePoolManagement" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "SetLegacyAbac": { + "methods": [ + "setLegacyAbac" + ] + }, + "StartIPRotation": { + "methods": [ + "startIPRotation" + ] + }, + "CompleteIPRotation": { + "methods": [ + "completeIPRotation" + ] + }, + "SetNodePoolSize": { + "methods": [ + "setNodePoolSize" + ] + }, + "SetNetworkPolicy": { + "methods": [ + "setNetworkPolicy" + ] + }, + "SetMaintenancePolicy": { + "methods": [ + "setMaintenancePolicy" + ] + }, + "CheckAutopilotCompatibility": { + "methods": [ + "checkAutopilotCompatibility" + ] + }, + "ListUsableSubnetworks": { + "methods": [ + "listUsableSubnetworks", + "listUsableSubnetworksStream", + "listUsableSubnetworksAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-container/v1/src/v1/index.ts b/owl-bot-staging/google-container/v1/src/v1/index.ts new file mode 100644 index 00000000000..b1b39233034 --- /dev/null +++ b/owl-bot-staging/google-container/v1/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {ClusterManagerClient} from './cluster_manager_client'; diff --git a/owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..1101d781caa --- /dev/null +++ b/owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const container = require('@google-cloud/container'); + +function main() { + const clusterManagerClient = new container.ClusterManagerClient(); +} + +main(); diff --git a/owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..6685b8649e6 --- /dev/null +++ b/owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {ClusterManagerClient} from '@google-cloud/container'; + +// check that the client class type name can be used +function doStuffWithClusterManagerClient(client: ClusterManagerClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const clusterManagerClient = new ClusterManagerClient(); + doStuffWithClusterManagerClient(clusterManagerClient); +} + +main(); diff --git a/owl-bot-staging/google-container/v1/system-test/install.ts b/owl-bot-staging/google-container/v1/system-test/install.ts new file mode 100644 index 00000000000..c8f81b25a86 --- /dev/null +++ b/owl-bot-staging/google-container/v1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-container/v1/test/gapic_cluster_manager_v1.ts b/owl-bot-staging/google-container/v1/test/gapic_cluster_manager_v1.ts new file mode 100644 index 00000000000..9632e377d3a --- /dev/null +++ b/owl-bot-staging/google-container/v1/test/gapic_cluster_manager_v1.ts @@ -0,0 +1,5130 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as clustermanagerModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.ClusterManagerClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = clustermanagerModule.v1.ClusterManagerClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = clustermanagerModule.v1.ClusterManagerClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = clustermanagerModule.v1.ClusterManagerClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new clustermanagerModule.v1.ClusterManagerClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.clusterManagerStub, undefined); + await client.initialize(); + assert(client.clusterManagerStub); + }); + + it('has close method for the initialized client', done => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.clusterManagerStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.clusterManagerStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('listClusters', () => { + it('invokes listClusters without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.ListClustersResponse() + ); + client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); + const [response] = await client.listClusters(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.ListClustersResponse() + ); + client.innerApiCalls.listClusters = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listClusters( + request, + (err?: Error|null, result?: protos.google.container.v1.IListClustersResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listClusters = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listClusters(request), expectedError); + const actualRequest = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['zone']); + request.zone = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listClusters(request), expectedError); + }); + }); + + describe('getCluster', () => { + it('invokes getCluster without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Cluster() + ); + client.innerApiCalls.getCluster = stubSimpleCall(expectedResponse); + const [response] = await client.getCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Cluster() + ); + client.innerApiCalls.getCluster = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCluster( + request, + (err?: Error|null, result?: protos.google.container.v1.ICluster|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCluster = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCluster(request), expectedError); + }); + }); + + describe('createCluster', () => { + it('invokes createCluster without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.createCluster = stubSimpleCall(expectedResponse); + const [response] = await client.createCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.createCluster = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCluster( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCluster = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['zone']); + request.zone = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createCluster(request), expectedError); + }); + }); + + describe('updateCluster', () => { + it('invokes updateCluster without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.UpdateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.updateCluster = stubSimpleCall(expectedResponse); + const [response] = await client.updateCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.UpdateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.updateCluster = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCluster( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.UpdateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCluster = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.UpdateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateCluster(request), expectedError); + }); + }); + + describe('updateNodePool', () => { + it('invokes updateNodePool without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.UpdateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.updateNodePool = stubSimpleCall(expectedResponse); + const [response] = await client.updateNodePool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateNodePool without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.UpdateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.updateNodePool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateNodePool( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateNodePool with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.UpdateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateNodePool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateNodePool(request), expectedError); + const actualRequest = (client.innerApiCalls.updateNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateNodePool with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.UpdateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateNodePool(request), expectedError); + }); + }); + + describe('setNodePoolAutoscaling', () => { + it('invokes setNodePoolAutoscaling without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNodePoolAutoscalingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCall(expectedResponse); + const [response] = await client.setNodePoolAutoscaling(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolAutoscaling without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNodePoolAutoscalingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setNodePoolAutoscaling( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolAutoscaling with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNodePoolAutoscalingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setNodePoolAutoscaling(request), expectedError); + const actualRequest = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolAutoscaling with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNodePoolAutoscalingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setNodePoolAutoscaling(request), expectedError); + }); + }); + + describe('setLoggingService', () => { + it('invokes setLoggingService without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLoggingServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setLoggingService = stubSimpleCall(expectedResponse); + const [response] = await client.setLoggingService(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLoggingService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLoggingService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLoggingService without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLoggingServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setLoggingService = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLoggingService( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLoggingService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLoggingService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLoggingService with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLoggingServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setLoggingService = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLoggingService(request), expectedError); + const actualRequest = (client.innerApiCalls.setLoggingService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLoggingService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLoggingService with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLoggingServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setLoggingService(request), expectedError); + }); + }); + + describe('setMonitoringService', () => { + it('invokes setMonitoringService without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetMonitoringServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setMonitoringService = stubSimpleCall(expectedResponse); + const [response] = await client.setMonitoringService(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMonitoringService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMonitoringService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMonitoringService without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetMonitoringServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setMonitoringService = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setMonitoringService( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMonitoringService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMonitoringService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMonitoringService with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetMonitoringServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setMonitoringService = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setMonitoringService(request), expectedError); + const actualRequest = (client.innerApiCalls.setMonitoringService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMonitoringService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMonitoringService with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetMonitoringServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setMonitoringService(request), expectedError); + }); + }); + + describe('setAddonsConfig', () => { + it('invokes setAddonsConfig without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetAddonsConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setAddonsConfig = stubSimpleCall(expectedResponse); + const [response] = await client.setAddonsConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setAddonsConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setAddonsConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setAddonsConfig without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetAddonsConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setAddonsConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setAddonsConfig( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setAddonsConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setAddonsConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setAddonsConfig with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetAddonsConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setAddonsConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setAddonsConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.setAddonsConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setAddonsConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setAddonsConfig with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetAddonsConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setAddonsConfig(request), expectedError); + }); + }); + + describe('setLocations', () => { + it('invokes setLocations without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLocationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setLocations = stubSimpleCall(expectedResponse); + const [response] = await client.setLocations(request); + assert(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLocations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLocations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLocations without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLocationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setLocations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLocations( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLocations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLocations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLocations with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLocationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setLocations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLocations(request), expectedError); + assert(stub.calledOnce); + const actualRequest = (client.innerApiCalls.setLocations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLocations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLocations with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLocationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setLocations(request), expectedError); + assert(stub.calledOnce); + }); + }); + + describe('updateMaster', () => { + it('invokes updateMaster without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.UpdateMasterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.updateMaster = stubSimpleCall(expectedResponse); + const [response] = await client.updateMaster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateMaster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMaster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMaster without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.UpdateMasterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.updateMaster = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateMaster( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateMaster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMaster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMaster with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.UpdateMasterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMaster = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateMaster(request), expectedError); + const actualRequest = (client.innerApiCalls.updateMaster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMaster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMaster with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.UpdateMasterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateMaster(request), expectedError); + }); + }); + + describe('setMasterAuth', () => { + it('invokes setMasterAuth without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetMasterAuthRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setMasterAuth = stubSimpleCall(expectedResponse); + const [response] = await client.setMasterAuth(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMasterAuth as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMasterAuth as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMasterAuth without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetMasterAuthRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setMasterAuth = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setMasterAuth( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMasterAuth as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMasterAuth as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMasterAuth with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetMasterAuthRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setMasterAuth = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setMasterAuth(request), expectedError); + const actualRequest = (client.innerApiCalls.setMasterAuth as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMasterAuth as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMasterAuth with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetMasterAuthRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setMasterAuth(request), expectedError); + }); + }); + + describe('deleteCluster', () => { + it('invokes deleteCluster without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.deleteCluster = stubSimpleCall(expectedResponse); + const [response] = await client.deleteCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.deleteCluster = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCluster( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCluster = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteCluster(request), expectedError); + }); + }); + + describe('listOperations', () => { + it('invokes listOperations without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.ListOperationsResponse() + ); + client.innerApiCalls.listOperations = stubSimpleCall(expectedResponse); + const [response] = await client.listOperations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOperations without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.ListOperationsResponse() + ); + client.innerApiCalls.listOperations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listOperations( + request, + (err?: Error|null, result?: protos.google.container.v1.IListOperationsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOperations with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listOperations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listOperations(request), expectedError); + const actualRequest = (client.innerApiCalls.listOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOperations with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['zone']); + request.zone = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listOperations(request), expectedError); + }); + }); + + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.getOperation = stubSimpleCall(expectedResponse); + const [response] = await client.getOperation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOperation without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.getOperation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getOperation( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOperation with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getOperation(request), expectedError); + const actualRequest = (client.innerApiCalls.getOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOperation with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getOperation(request), expectedError); + }); + }); + + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CancelOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelOperation = stubSimpleCall(expectedResponse); + const [response] = await client.cancelOperation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelOperation without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CancelOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelOperation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelOperation( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelOperation with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CancelOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelOperation(request), expectedError); + const actualRequest = (client.innerApiCalls.cancelOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelOperation with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CancelOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelOperation(request), expectedError); + }); + }); + + describe('getServerConfig', () => { + it('invokes getServerConfig without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetServerConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.ServerConfig() + ); + client.innerApiCalls.getServerConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getServerConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getServerConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getServerConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getServerConfig without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetServerConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.ServerConfig() + ); + client.innerApiCalls.getServerConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getServerConfig( + request, + (err?: Error|null, result?: protos.google.container.v1.IServerConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getServerConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getServerConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getServerConfig with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetServerConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getServerConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getServerConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.getServerConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getServerConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getServerConfig with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetServerConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['zone']); + request.zone = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getServerConfig(request), expectedError); + }); + }); + + describe('getJSONWebKeys', () => { + it('invokes getJSONWebKeys without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetJSONWebKeysRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetJSONWebKeysRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.GetJSONWebKeysResponse() + ); + client.innerApiCalls.getJsonWebKeys = stubSimpleCall(expectedResponse); + const [response] = await client.getJSONWebKeys(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJsonWebKeys as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJsonWebKeys as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJSONWebKeys without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetJSONWebKeysRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetJSONWebKeysRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.GetJSONWebKeysResponse() + ); + client.innerApiCalls.getJsonWebKeys = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getJSONWebKeys( + request, + (err?: Error|null, result?: protos.google.container.v1.IGetJSONWebKeysResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJsonWebKeys as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJsonWebKeys as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJSONWebKeys with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetJSONWebKeysRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetJSONWebKeysRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getJsonWebKeys = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getJSONWebKeys(request), expectedError); + const actualRequest = (client.innerApiCalls.getJsonWebKeys as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJsonWebKeys as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJSONWebKeys with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetJSONWebKeysRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetJSONWebKeysRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getJSONWebKeys(request), expectedError); + }); + }); + + describe('listNodePools', () => { + it('invokes listNodePools without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListNodePoolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.ListNodePoolsResponse() + ); + client.innerApiCalls.listNodePools = stubSimpleCall(expectedResponse); + const [response] = await client.listNodePools(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listNodePools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listNodePools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNodePools without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListNodePoolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.ListNodePoolsResponse() + ); + client.innerApiCalls.listNodePools = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listNodePools( + request, + (err?: Error|null, result?: protos.google.container.v1.IListNodePoolsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listNodePools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listNodePools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNodePools with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListNodePoolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listNodePools = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listNodePools(request), expectedError); + const actualRequest = (client.innerApiCalls.listNodePools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listNodePools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNodePools with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListNodePoolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listNodePools(request), expectedError); + }); + }); + + describe('getNodePool', () => { + it('invokes getNodePool without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.NodePool() + ); + client.innerApiCalls.getNodePool = stubSimpleCall(expectedResponse); + const [response] = await client.getNodePool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNodePool without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.NodePool() + ); + client.innerApiCalls.getNodePool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getNodePool( + request, + (err?: Error|null, result?: protos.google.container.v1.INodePool|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNodePool with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getNodePool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getNodePool(request), expectedError); + const actualRequest = (client.innerApiCalls.getNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNodePool with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.GetNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getNodePool(request), expectedError); + }); + }); + + describe('createNodePool', () => { + it('invokes createNodePool without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CreateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.createNodePool = stubSimpleCall(expectedResponse); + const [response] = await client.createNodePool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNodePool without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CreateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.createNodePool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createNodePool( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNodePool with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CreateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createNodePool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createNodePool(request), expectedError); + const actualRequest = (client.innerApiCalls.createNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNodePool with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CreateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createNodePool(request), expectedError); + }); + }); + + describe('deleteNodePool', () => { + it('invokes deleteNodePool without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.DeleteNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.deleteNodePool = stubSimpleCall(expectedResponse); + const [response] = await client.deleteNodePool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNodePool without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.DeleteNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.deleteNodePool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteNodePool( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNodePool with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.DeleteNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteNodePool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteNodePool(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNodePool with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.DeleteNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteNodePool(request), expectedError); + }); + }); + + describe('completeNodePoolUpgrade', () => { + it('invokes completeNodePoolUpgrade without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CompleteNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CompleteNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.completeNodePoolUpgrade = stubSimpleCall(expectedResponse); + const [response] = await client.completeNodePoolUpgrade(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeNodePoolUpgrade without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CompleteNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CompleteNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.completeNodePoolUpgrade = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.completeNodePoolUpgrade( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeNodePoolUpgrade with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CompleteNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CompleteNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.completeNodePoolUpgrade = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.completeNodePoolUpgrade(request), expectedError); + const actualRequest = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeNodePoolUpgrade with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CompleteNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CompleteNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.completeNodePoolUpgrade(request), expectedError); + }); + }); + + describe('rollbackNodePoolUpgrade', () => { + it('invokes rollbackNodePoolUpgrade without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.RollbackNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCall(expectedResponse); + const [response] = await client.rollbackNodePoolUpgrade(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackNodePoolUpgrade without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.RollbackNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.rollbackNodePoolUpgrade( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackNodePoolUpgrade with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.RollbackNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.rollbackNodePoolUpgrade(request), expectedError); + const actualRequest = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackNodePoolUpgrade with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.RollbackNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.rollbackNodePoolUpgrade(request), expectedError); + }); + }); + + describe('setNodePoolManagement', () => { + it('invokes setNodePoolManagement without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNodePoolManagementRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setNodePoolManagement = stubSimpleCall(expectedResponse); + const [response] = await client.setNodePoolManagement(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNodePoolManagement as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolManagement as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolManagement without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNodePoolManagementRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setNodePoolManagement = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setNodePoolManagement( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNodePoolManagement as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolManagement as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolManagement with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNodePoolManagementRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setNodePoolManagement = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setNodePoolManagement(request), expectedError); + const actualRequest = (client.innerApiCalls.setNodePoolManagement as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolManagement as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolManagement with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNodePoolManagementRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setNodePoolManagement(request), expectedError); + }); + }); + + describe('setLabels', () => { + it('invokes setLabels without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLabelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); + const [response] = await client.setLabels(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLabels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLabels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLabels without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLabelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setLabels = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLabels( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLabels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLabels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLabels with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLabelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setLabels = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLabels(request), expectedError); + const actualRequest = (client.innerApiCalls.setLabels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLabels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLabels with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLabelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setLabels(request), expectedError); + }); + }); + + describe('setLegacyAbac', () => { + it('invokes setLegacyAbac without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLegacyAbacRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setLegacyAbac = stubSimpleCall(expectedResponse); + const [response] = await client.setLegacyAbac(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLegacyAbac as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLegacyAbac as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLegacyAbac without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLegacyAbacRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setLegacyAbac = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLegacyAbac( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLegacyAbac as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLegacyAbac as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLegacyAbac with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLegacyAbacRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setLegacyAbac = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLegacyAbac(request), expectedError); + const actualRequest = (client.innerApiCalls.setLegacyAbac as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLegacyAbac as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLegacyAbac with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetLegacyAbacRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setLegacyAbac(request), expectedError); + }); + }); + + describe('startIPRotation', () => { + it('invokes startIPRotation without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.StartIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.startIpRotation = stubSimpleCall(expectedResponse); + const [response] = await client.startIPRotation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.startIpRotation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startIpRotation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startIPRotation without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.StartIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.startIpRotation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.startIPRotation( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.startIpRotation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startIpRotation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startIPRotation with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.StartIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startIpRotation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.startIPRotation(request), expectedError); + const actualRequest = (client.innerApiCalls.startIpRotation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startIpRotation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startIPRotation with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.StartIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.startIPRotation(request), expectedError); + }); + }); + + describe('completeIPRotation', () => { + it('invokes completeIPRotation without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CompleteIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.completeIpRotation = stubSimpleCall(expectedResponse); + const [response] = await client.completeIPRotation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.completeIpRotation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeIpRotation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeIPRotation without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CompleteIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.completeIpRotation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.completeIPRotation( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.completeIpRotation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeIpRotation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeIPRotation with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CompleteIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.completeIpRotation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.completeIPRotation(request), expectedError); + const actualRequest = (client.innerApiCalls.completeIpRotation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeIpRotation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeIPRotation with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CompleteIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.completeIPRotation(request), expectedError); + }); + }); + + describe('setNodePoolSize', () => { + it('invokes setNodePoolSize without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNodePoolSizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setNodePoolSize = stubSimpleCall(expectedResponse); + const [response] = await client.setNodePoolSize(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNodePoolSize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolSize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolSize without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNodePoolSizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setNodePoolSize = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setNodePoolSize( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNodePoolSize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolSize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolSize with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNodePoolSizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setNodePoolSize = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setNodePoolSize(request), expectedError); + const actualRequest = (client.innerApiCalls.setNodePoolSize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolSize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolSize with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNodePoolSizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setNodePoolSize(request), expectedError); + }); + }); + + describe('setNetworkPolicy', () => { + it('invokes setNetworkPolicy without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNetworkPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setNetworkPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setNetworkPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNetworkPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNetworkPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNetworkPolicy without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNetworkPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setNetworkPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setNetworkPolicy( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNetworkPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNetworkPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNetworkPolicy with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNetworkPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setNetworkPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setNetworkPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.setNetworkPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNetworkPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNetworkPolicy with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetNetworkPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setNetworkPolicy(request), expectedError); + }); + }); + + describe('setMaintenancePolicy', () => { + it('invokes setMaintenancePolicy without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetMaintenancePolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setMaintenancePolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setMaintenancePolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMaintenancePolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMaintenancePolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMaintenancePolicy without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetMaintenancePolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.Operation() + ); + client.innerApiCalls.setMaintenancePolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setMaintenancePolicy( + request, + (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMaintenancePolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMaintenancePolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMaintenancePolicy with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetMaintenancePolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setMaintenancePolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setMaintenancePolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.setMaintenancePolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMaintenancePolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMaintenancePolicy with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.SetMaintenancePolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setMaintenancePolicy(request), expectedError); + }); + }); + + describe('checkAutopilotCompatibility', () => { + it('invokes checkAutopilotCompatibility without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CheckAutopilotCompatibilityRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CheckAutopilotCompatibilityRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.CheckAutopilotCompatibilityResponse() + ); + client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCall(expectedResponse); + const [response] = await client.checkAutopilotCompatibility(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAutopilotCompatibility without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CheckAutopilotCompatibilityRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CheckAutopilotCompatibilityRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.CheckAutopilotCompatibilityResponse() + ); + client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.checkAutopilotCompatibility( + request, + (err?: Error|null, result?: protos.google.container.v1.ICheckAutopilotCompatibilityResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAutopilotCompatibility with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CheckAutopilotCompatibilityRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CheckAutopilotCompatibilityRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkAutopilotCompatibility(request), expectedError); + const actualRequest = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAutopilotCompatibility with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CheckAutopilotCompatibilityRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.CheckAutopilotCompatibilityRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.checkAutopilotCompatibility(request), expectedError); + }); + }); + + describe('listUsableSubnetworks', () => { + it('invokes listUsableSubnetworks without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), + ]; + client.innerApiCalls.listUsableSubnetworks = stubSimpleCall(expectedResponse); + const [response] = await client.listUsableSubnetworks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUsableSubnetworks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUsableSubnetworks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsableSubnetworks without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), + ]; + client.innerApiCalls.listUsableSubnetworks = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listUsableSubnetworks( + request, + (err?: Error|null, result?: protos.google.container.v1.IUsableSubnetwork[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUsableSubnetworks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUsableSubnetworks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsableSubnetworks with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listUsableSubnetworks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listUsableSubnetworks(request), expectedError); + const actualRequest = (client.innerApiCalls.listUsableSubnetworks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUsableSubnetworks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsableSubnetworksStream without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), + ]; + client.descriptors.page.listUsableSubnetworks.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listUsableSubnetworksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.container.v1.UsableSubnetwork[] = []; + stream.on('data', (response: protos.google.container.v1.UsableSubnetwork) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUsableSubnetworks, request)); + assert( + (client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listUsableSubnetworksStream with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listUsableSubnetworks.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listUsableSubnetworksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.container.v1.UsableSubnetwork[] = []; + stream.on('data', (response: protos.google.container.v1.UsableSubnetwork) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUsableSubnetworks, request)); + assert( + (client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUsableSubnetworks without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), + ]; + client.descriptors.page.listUsableSubnetworks.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.container.v1.IUsableSubnetwork[] = []; + const iterable = client.listUsableSubnetworksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUsableSubnetworks with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listUsableSubnetworks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listUsableSubnetworksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.container.v1.IUsableSubnetwork[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); +}); diff --git a/owl-bot-staging/google-container/v1/tsconfig.json b/owl-bot-staging/google-container/v1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-container/v1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/google-container/v1/webpack.config.js b/owl-bot-staging/google-container/v1/webpack.config.js new file mode 100644 index 00000000000..9032271af9d --- /dev/null +++ b/owl-bot-staging/google-container/v1/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 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. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'ClusterManager', + filename: './cluster-manager.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; diff --git a/owl-bot-staging/google-container/v1beta1/.eslintignore b/owl-bot-staging/google-container/v1beta1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-container/v1beta1/.eslintrc.json b/owl-bot-staging/google-container/v1beta1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-container/v1beta1/.gitignore b/owl-bot-staging/google-container/v1beta1/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-container/v1beta1/.jsdoc.js b/owl-bot-staging/google-container/v1beta1/.jsdoc.js new file mode 100644 index 00000000000..6dc18e81193 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2023 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/container', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-container/v1beta1/.mocharc.js b/owl-bot-staging/google-container/v1beta1/.mocharc.js new file mode 100644 index 00000000000..1a38f257db7 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-container/v1beta1/.prettierrc.js b/owl-bot-staging/google-container/v1beta1/.prettierrc.js new file mode 100644 index 00000000000..55639e70f9e --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-container/v1beta1/README.md b/owl-bot-staging/google-container/v1beta1/README.md new file mode 100644 index 00000000000..f32441d7e6b --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/README.md @@ -0,0 +1 @@ +Container: Nodejs Client diff --git a/owl-bot-staging/google-container/v1beta1/linkinator.config.json b/owl-bot-staging/google-container/v1beta1/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/owl-bot-staging/google-container/v1beta1/package.json b/owl-bot-staging/google-container/v1beta1/package.json new file mode 100644 index 00000000000..9795068794e --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/package.json @@ -0,0 +1,64 @@ +{ + "name": "@google-cloud/container", + "version": "0.1.0", + "description": "Container client for Node.js", + "repository": "googleapis/nodejs-container", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google container", + "container", + "cluster manager" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^3.5.7" + }, + "devDependencies": { + "@types/mocha": "^10.0.1", + "@types/node": "^18.11.18", + "@types/sinon": "^10.0.13", + "c8": "^7.12.0", + "gts": "^3.1.1", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.1", + "jsdoc-region-tag": "^2.0.1", + "linkinator": "^4.1.2", + "mocha": "^10.2.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^15.0.1", + "ts-loader": "^8.4.0", + "typescript": "^4.8.4", + "webpack": "^4.46.0", + "webpack-cli": "^4.10.0" + }, + "engines": { + "node": ">=v12" + } +} diff --git a/owl-bot-staging/google-container/v1beta1/protos/google/container/v1beta1/cluster_service.proto b/owl-bot-staging/google-container/v1beta1/protos/google/container/v1beta1/cluster_service.proto new file mode 100644 index 00000000000..d35034ce072 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/protos/google/container/v1beta1/cluster_service.proto @@ -0,0 +1,5617 @@ +// Copyright 2023 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. + +syntax = "proto3"; + +package google.container.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/rpc/code.proto"; +import "google/rpc/status.proto"; +import "google/type/date.proto"; + +option csharp_namespace = "Google.Cloud.Container.V1Beta1"; +option go_package = "cloud.google.com/go/container/apiv1beta1/containerpb;containerpb"; +option java_multiple_files = true; +option java_outer_classname = "ClusterServiceProto"; +option java_package = "com.google.container.v1beta1"; +option php_namespace = "Google\\Cloud\\Container\\V1beta1"; +option ruby_package = "Google::Cloud::Container::V1beta1"; +option (google.api.resource_definition) = { + type: "pubsub.googleapis.com/Topic" + pattern: "projects/{project}/topics/{topic}" +}; + +// Google Kubernetes Engine Cluster Manager v1beta1 +service ClusterManager { + option (google.api.default_host) = "container.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists all clusters owned by a project in either the specified zone or all + // zones. + rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/clusters" + additional_bindings { + get: "/v1beta1/projects/{project_id}/zones/{zone}/clusters" + } + }; + option (google.api.method_signature) = "project_id,zone"; + } + + // Gets the details for a specific cluster. + rpc GetCluster(GetClusterRequest) returns (Cluster) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/clusters/*}" + additional_bindings { + get: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id"; + } + + // 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](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). + // + // 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. + rpc CreateCluster(CreateClusterRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/clusters" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster"; + } + + // Updates the settings for a specific cluster. + rpc UpdateCluster(UpdateClusterRequest) returns (Operation) { + option (google.api.http) = { + put: "/v1beta1/{name=projects/*/locations/*/clusters/*}" + body: "*" + additional_bindings { + put: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id,update"; + } + + // Updates the version and/or image type of a specific node pool. + rpc UpdateNodePool(UpdateNodePoolRequest) returns (Operation) { + option (google.api.http) = { + put: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/update" + body: "*" + } + }; + } + + // Sets the autoscaling settings of a specific node pool. + rpc SetNodePoolAutoscaling(SetNodePoolAutoscalingRequest) + returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setAutoscaling" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/autoscaling" + body: "*" + } + }; + } + + // Sets the logging service for a specific cluster. + rpc SetLoggingService(SetLoggingServiceRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setLogging" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/logging" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,logging_service"; + } + + // Sets the monitoring service for a specific cluster. + rpc SetMonitoringService(SetMonitoringServiceRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setMonitoring" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/monitoring" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,monitoring_service"; + } + + // Sets the addons for a specific cluster. + rpc SetAddonsConfig(SetAddonsConfigRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setAddons" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/addons" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,addons_config"; + } + + // Sets the locations for a specific cluster. + // Deprecated. Use + // [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters/update) + // instead. + rpc SetLocations(SetLocationsRequest) returns (Operation) { + option deprecated = true; + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setLocations" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/locations" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,locations"; + } + + // Updates the master for a specific cluster. + rpc UpdateMaster(UpdateMasterRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:updateMaster" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/master" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,master_version"; + } + + // Sets master auth materials. Currently supports changing the admin password + // or a specific cluster, either via password generation or explicitly setting + // the password. + rpc SetMasterAuth(SetMasterAuthRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setMasterAuth" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setMasterAuth" + body: "*" + } + }; + } + + // 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. + rpc DeleteCluster(DeleteClusterRequest) returns (Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/clusters/*}" + additional_bindings { + delete: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id"; + } + + // Lists all operations in a project in the specified zone or all zones. + rpc ListOperations(ListOperationsRequest) returns (ListOperationsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/operations" + additional_bindings { + get: "/v1beta1/projects/{project_id}/zones/{zone}/operations" + } + }; + option (google.api.method_signature) = "project_id,zone"; + } + + // Gets the specified operation. + rpc GetOperation(GetOperationRequest) returns (Operation) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/operations/*}" + additional_bindings { + get: "/v1beta1/projects/{project_id}/zones/{zone}/operations/{operation_id}" + } + }; + option (google.api.method_signature) = "project_id,zone,operation_id"; + } + + // Cancels the specified operation. + rpc CancelOperation(CancelOperationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/operations/*}:cancel" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/operations/{operation_id}:cancel" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,zone,operation_id"; + } + + // Returns configuration info about the Google Kubernetes Engine service. + rpc GetServerConfig(GetServerConfigRequest) returns (ServerConfig) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*}/serverConfig" + additional_bindings { + get: "/v1beta1/projects/{project_id}/zones/{zone}/serverconfig" + } + }; + option (google.api.method_signature) = "project_id,zone"; + } + + // Gets the public component of the cluster signing keys in + // JSON Web Key format. + // This API is not yet intended for general use, and is not available for all + // clusters. + rpc GetJSONWebKeys(GetJSONWebKeysRequest) returns (GetJSONWebKeysResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/clusters/*}/jwks" + }; + } + + // Lists the node pools for a cluster. + rpc ListNodePools(ListNodePoolsRequest) returns (ListNodePoolsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/clusters/*}/nodePools" + additional_bindings { + get: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id"; + } + + // Retrieves the requested node pool. + rpc GetNodePool(GetNodePoolRequest) returns (NodePool) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}" + additional_bindings { + get: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,node_pool_id"; + } + + // Creates a node pool for a cluster. + rpc CreateNodePool(CreateNodePoolRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/clusters/*}/nodePools" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,node_pool"; + } + + // Deletes a node pool from a cluster. + rpc DeleteNodePool(DeleteNodePoolRequest) returns (Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}" + additional_bindings { + delete: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,node_pool_id"; + } + + // CompleteNodePoolUpgrade will signal an on-going node pool upgrade to + // complete. + rpc CompleteNodePoolUpgrade(CompleteNodePoolUpgradeRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:completeUpgrade" + body: "*" + }; + } + + // Rolls back a previously Aborted or Failed NodePool upgrade. + // This makes no changes if the last upgrade successfully completed. + rpc RollbackNodePoolUpgrade(RollbackNodePoolUpgradeRequest) + returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:rollback" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}:rollback" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,node_pool_id"; + } + + // Sets the NodeManagement options for a node pool. + rpc SetNodePoolManagement(SetNodePoolManagementRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setManagement" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/setManagement" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,node_pool_id,management"; + } + + // Sets labels on a cluster. + rpc SetLabels(SetLabelsRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setResourceLabels" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/resourceLabels" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,resource_labels,label_fingerprint"; + } + + // Enables or disables the ABAC authorization mechanism on a cluster. + rpc SetLegacyAbac(SetLegacyAbacRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setLegacyAbac" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/legacyAbac" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id,enabled"; + } + + // Starts master IP rotation. + rpc StartIPRotation(StartIPRotationRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:startIpRotation" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:startIpRotation" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id"; + } + + // Completes master IP rotation. + rpc CompleteIPRotation(CompleteIPRotationRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:completeIpRotation" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:completeIpRotation" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,zone,cluster_id"; + } + + // SetNodePoolSizeRequest sets the size of a node pool. The new size will be + // used for all replicas, including future replicas created by modifying + // [NodePool.locations][google.container.v1beta1.NodePool.locations]. + rpc SetNodePoolSize(SetNodePoolSizeRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setSize" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/setSize" + body: "*" + } + }; + } + + // Enables or disables Network Policy for a cluster. + rpc SetNetworkPolicy(SetNetworkPolicyRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setNetworkPolicy" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setNetworkPolicy" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,network_policy"; + } + + // Sets the maintenance policy for a cluster. + rpc SetMaintenancePolicy(SetMaintenancePolicyRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setMaintenancePolicy" + body: "*" + additional_bindings { + post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setMaintenancePolicy" + body: "*" + } + }; + option (google.api.method_signature) = + "project_id,zone,cluster_id,maintenance_policy"; + } + + // Lists subnetworks that can be used for creating clusters in a project. + rpc ListUsableSubnetworks(ListUsableSubnetworksRequest) + returns (ListUsableSubnetworksResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*}/aggregated/usableSubnetworks" + }; + option (google.api.method_signature) = "parent"; + } + + // Checks the cluster compatibility with Autopilot mode, and returns a list of + // compatibility issues. + rpc CheckAutopilotCompatibility(CheckAutopilotCompatibilityRequest) + returns (CheckAutopilotCompatibilityResponse) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/clusters/*}:checkAutopilotCompatibility" + }; + } + + // Fetches locations that offer Google Kubernetes Engine. + rpc ListLocations(ListLocationsRequest) returns (ListLocationsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*}/locations" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Parameters that can be configured on Linux nodes. +message LinuxNodeConfig { + // Possible cgroup modes that can be used. + enum CgroupMode { + // CGROUP_MODE_UNSPECIFIED is when unspecified cgroup configuration is used. + // The default for the GKE node OS image will be used. + CGROUP_MODE_UNSPECIFIED = 0; + + // CGROUP_MODE_V1 specifies to use cgroupv1 for the cgroup configuration on + // the node image. + CGROUP_MODE_V1 = 1; + + // CGROUP_MODE_V2 specifies to use cgroupv2 for the cgroup configuration on + // the node image. + CGROUP_MODE_V2 = 2; + } + + // The Linux kernel parameters to be applied to the nodes and all pods running + // on the nodes. + // + // The following parameters are supported. + // + // net.core.busy_poll + // net.core.busy_read + // net.core.netdev_max_backlog + // net.core.rmem_max + // net.core.wmem_default + // net.core.wmem_max + // net.core.optmem_max + // net.core.somaxconn + // net.ipv4.tcp_rmem + // net.ipv4.tcp_wmem + // net.ipv4.tcp_tw_reuse + map sysctls = 1; + + // cgroup_mode specifies the cgroup mode to be used on the node. + CgroupMode cgroup_mode = 2; +} + +// Parameters that can be configured on Windows nodes. +// Windows Node Config that define the parameters that will be used to +// configure the Windows node pool settings +message WindowsNodeConfig { + // Possible OS version that can be used. + enum OSVersion { + // When OSVersion is not specified + OS_VERSION_UNSPECIFIED = 0; + + // LTSC2019 specifies to use LTSC2019 as the Windows Servercore Base Image + OS_VERSION_LTSC2019 = 1; + + // LTSC2022 specifies to use LTSC2022 as the Windows Servercore Base Image + OS_VERSION_LTSC2022 = 2; + } + + // OSVersion specifies the Windows node config to be used on the node + OSVersion os_version = 1; +} + +// Node kubelet configs. +message NodeKubeletConfig { + // Control the CPU management policy on the node. + // See + // https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/ + // + // The following values are allowed. + // * "none": the default, which represents the existing scheduling behavior. + // * "static": allows pods with certain resource characteristics to be granted + // increased CPU affinity and exclusivity on the node. + // The default value is 'none' if unspecified. + string cpu_manager_policy = 1; + + // Enable CPU CFS quota enforcement for containers that specify CPU limits. + // + // This option is enabled by default which makes kubelet use CFS quota + // (https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt) to + // enforce container CPU limits. Otherwise, CPU limits will not be enforced at + // all. + // + // Disable this option to mitigate CPU throttling problems while still having + // your pods to be in Guaranteed QoS class by specifying the CPU limits. + // + // The default value is 'true' if unspecified. + google.protobuf.BoolValue cpu_cfs_quota = 2; + + // Set the CPU CFS quota period value 'cpu.cfs_period_us'. + // + // The string must be a sequence of decimal numbers, each with optional + // fraction and a unit suffix, such as "300ms". + // Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". + // The value must be a positive duration. + string cpu_cfs_quota_period = 3; + + // Set the Pod PID limits. See + // https://kubernetes.io/docs/concepts/policy/pid-limiting/#pod-pid-limits + // + // Controls the maximum number of processes allowed to run in a pod. The value + // must be greater than or equal to 1024 and less than 4194304. + int64 pod_pids_limit = 4; + + // Enable or disable Kubelet read only port. + optional bool insecure_kubelet_readonly_port_enabled = 7; +} + +// Parameters that describe the nodes in a cluster. +// +// GKE Autopilot clusters do not +// recognize parameters in `NodeConfig`. Use +// [AutoprovisioningNodePoolDefaults][google.container.v1beta1.AutoprovisioningNodePoolDefaults] +// instead. +message NodeConfig { + // The name of a Google Compute Engine [machine + // type](https://cloud.google.com/compute/docs/machine-types). + // + // If unspecified, the default machine type is + // `e2-medium`. + string machine_type = 1; + + // 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. + int32 disk_size_gb = 2; + + // 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](https://cloud.google.com/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. + repeated string oauth_scopes = 3; + + // The Google Cloud Platform Service Account to be used by the node VMs. + // Specify the email address of the Service Account; otherwise, if no Service + // Account is specified, the "default" service account is used. + string service_account = 9; + + // 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-oslogin" + // - "gci-ensure-gke-docker" + // - "gci-metrics-enabled" + // - "gci-update-strategy" + // - "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" + // + // 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. + map metadata = 4; + + // The image type to use for this node. Note that for a given image type, + // the latest version of it will be used. Please see + // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for + // available image types. + string image_type = 5; + + // 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/ + map labels = 6; + + // 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. + int32 local_ssd_count = 7; + + // 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. + repeated string tags = 8; + + // 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. + bool preemptible = 10; + + // 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. + repeated AcceleratorConfig accelerators = 11; + + // Sandbox configuration for this node. + SandboxConfig sandbox_config = 17; + + // Setting this field will assign instances of this + // pool to run on the specified node group. This is useful for running + // workloads on [sole tenant + // nodes](https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes). + string node_group = 18; + + // The optional reservation affinity. Setting this field will apply + // the specified [Zonal Compute + // Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources) + // to this node pool. + ReservationAffinity reservation_affinity = 19; + + // Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or + // 'pd-balanced') + // + // If unspecified, the default disk type is 'pd-standard' + string disk_type = 12; + + // 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](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform). + string min_cpu_platform = 13; + + // The workload metadata configuration for this node. + WorkloadMetadataConfig workload_metadata_config = 14; + + // 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/ + repeated NodeTaint taints = 15; + + // + // The Customer Managed Encryption Key used to encrypt the boot disk attached + // to each node in the node pool. This should be of the form + // projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. + // For more information about protecting resources with Cloud KMS Keys please + // see: + // https://cloud.google.com/compute/docs/disks/customer-managed-encryption + string boot_disk_kms_key = 23; + + // Shielded Instance options. + ShieldedInstanceConfig shielded_instance_config = 20; + + // Parameters that can be configured on Linux nodes. + LinuxNodeConfig linux_node_config = 21; + + // Node kubelet configs. + NodeKubeletConfig kubelet_config = 22; + + // Parameters for the ephemeral storage filesystem. + // If unspecified, ephemeral storage is backed by the boot disk. + EphemeralStorageConfig ephemeral_storage_config = 24; + + // GCFS (Google Container File System) configs. + GcfsConfig gcfs_config = 25; + + // Advanced features for the Compute Engine VM. + AdvancedMachineFeatures advanced_machine_features = 26; + + // Enable or disable gvnic on the node pool. + VirtualNIC gvnic = 29; + + // Spot flag for enabling Spot VM, which is a rebrand of + // the existing preemptible flag. + bool spot = 32; + + // Confidential nodes config. + // All the nodes in the node pool will be Confidential VM once enabled. + ConfidentialNodes confidential_nodes = 35; + + // Enable or disable NCCL fast socket for the node pool. + optional FastSocket fast_socket = 36; + + // The resource labels for the node pool to use to annotate any related + // Google Compute Engine resources. + map resource_labels = 37; + + // Logging configuration. + NodePoolLoggingConfig logging_config = 38; + + // Parameters that can be configured on Windows nodes. + WindowsNodeConfig windows_node_config = 39; + + // Parameters for using raw-block Local NVMe SSDs. + LocalNvmeSsdBlockConfig local_nvme_ssd_block_config = 40; + + // Parameters for the node ephemeral storage using Local SSDs. + // If unspecified, ephemeral storage is backed by the boot disk. + // This field is functionally equivalent to the ephemeral_storage_config + EphemeralStorageLocalSsdConfig ephemeral_storage_local_ssd_config = 41; + + // Parameters for node pools to be backed by shared sole tenant node groups. + SoleTenantConfig sole_tenant_config = 42; +} + +// Specifies options for controlling advanced machine features. +message AdvancedMachineFeatures { + // The number of threads per physical core. To disable simultaneous + // multithreading (SMT) set this to 1. If unset, the maximum number of threads + // supported per core by the underlying processor is assumed. + optional int64 threads_per_core = 1; +} + +// Parameters for node pool-level network config. +message NodeNetworkConfig { + // Configuration of all network bandwidth tiers + message NetworkPerformanceConfig { + // Node network tier + enum Tier { + // Default value + TIER_UNSPECIFIED = 0; + + // Higher bandwidth, actual values based on VM size. + TIER_1 = 1; + } + + // Specifies the total network bandwidth tier for the NodePool. + optional Tier total_egress_bandwidth_tier = 1; + + // Specifies the network bandwidth tier for the NodePool for traffic to + // external/public IP addresses. + optional Tier external_ip_egress_bandwidth_tier = 2; + } + + // Input only. Whether to create a new range for pod IPs in this node pool. + // Defaults are provided for `pod_range` and `pod_ipv4_cidr_block` if they + // are not specified. + // + // If neither `create_pod_range` or `pod_range` are specified, the + // cluster-level default (`ip_allocation_policy.cluster_ipv4_cidr_block`) is + // used. + // + // Only applicable if `ip_allocation_policy.use_ip_aliases` is true. + // + // This field cannot be changed after the node pool has been created. + bool create_pod_range = 4 [(google.api.field_behavior) = INPUT_ONLY]; + + // The ID of the secondary range for pod IPs. + // If `create_pod_range` is true, this ID is used for the new range. + // If `create_pod_range` is false, uses an existing secondary range with this + // ID. + // + // Only applicable if `ip_allocation_policy.use_ip_aliases` is true. + // + // This field cannot be changed after the node pool has been created. + string pod_range = 5; + + // The IP address range for pod IPs in this node pool. + // + // Only applicable if `create_pod_range` 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](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `10.96.0.0/14`) to pick a specific range to use. + // + // Only applicable if `ip_allocation_policy.use_ip_aliases` is true. + // + // This field cannot be changed after the node pool has been created. + string pod_ipv4_cidr_block = 6; + + // Whether nodes have internal IP addresses only. + // If enable_private_nodes is not specified, then the value is derived from + // [cluster.privateClusterConfig.enablePrivateNodes][google.container.v1beta1.PrivateClusterConfig.enablePrivateNodes] + optional bool enable_private_nodes = 9; + + // Network bandwidth tier configuration. + optional NetworkPerformanceConfig network_performance_config = 11; + + // [PRIVATE FIELD] + // Pod CIDR size overprovisioning config for the nodepool. + // + // Pod CIDR size per node depends on max_pods_per_node. By default, the value + // of max_pods_per_node is rounded off to next power of 2 and we then double + // that to get the size of pod CIDR block per node. + // Example: max_pods_per_node of 30 would result in 64 IPs (/26). + // + // This config can disable the doubling of IPs (we still round off to next + // power of 2) + // Example: max_pods_per_node of 30 will result in 32 IPs (/27) when + // overprovisioning is disabled. + PodCIDROverprovisionConfig pod_cidr_overprovision_config = 13; + + // Output only. [Output only] The utilization of the IPv4 range for the pod. + // The ratio is Usage/[Total number of IPs in the secondary range], + // Usage=numNodes*numZones*podIPsPerNode. + double pod_ipv4_range_utilization = 16 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A set of Shielded Instance options. +message ShieldedInstanceConfig { + // 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. + bool enable_secure_boot = 1; + + // 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. + bool enable_integrity_monitoring = 2; +} + +// SandboxConfig contains configurations of the sandbox to use for the node. +message SandboxConfig { + // Possible types of sandboxes. + enum Type { + // Default value. This should not be used. + UNSPECIFIED = 0; + + // Run sandbox using gvisor. + GVISOR = 1; + } + + // Type of the sandbox to use for the node (e.g. 'gvisor') + string sandbox_type = 1 [deprecated = true]; + + // Type of the sandbox to use for the node. + Type type = 2; +} + +// EphemeralStorageConfig contains configuration for the ephemeral storage +// filesystem. +message EphemeralStorageConfig { + // Number of local SSDs to use to back ephemeral storage. Uses NVMe + // interfaces. Each local SSD is 375 GB in size. + // If zero, it means to disable using local SSDs as ephemeral storage. + int32 local_ssd_count = 1; +} + +// LocalNvmeSsdBlockConfig contains configuration for using raw-block local +// NVMe SSDs +message LocalNvmeSsdBlockConfig { + // The number of raw-block local NVMe SSD disks to be attached to the node. + // Each local SSD is 375 GB in size. If zero, it means no raw-block local NVMe + // 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. + int32 local_ssd_count = 1; +} + +// EphemeralStorageLocalSsdConfig contains configuration for the node ephemeral +// storage using Local SSDs. +message EphemeralStorageLocalSsdConfig { + // Number of local SSDs to use to back ephemeral storage. Uses NVMe + // interfaces. Each local SSD is 375 GB in size. + // If zero, it means to disable using local SSDs as ephemeral storage. + // 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. + int32 local_ssd_count = 1; +} + +// GcfsConfig contains configurations of Google Container File System. +message GcfsConfig { + // Whether to use GCFS. + bool enabled = 1; +} + +// [ReservationAffinity](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources) +// is the configuration of desired reservation which instances could take +// capacity from. +message ReservationAffinity { + // Indicates whether to consume capacity from a reservation or not. + enum Type { + // Default value. This should not be used. + UNSPECIFIED = 0; + + // Do not consume from any reserved capacity. + NO_RESERVATION = 1; + + // Consume any reservation available. + ANY_RESERVATION = 2; + + // Must consume from a specific reservation. Must specify key value fields + // for specifying the reservations. + SPECIFIC_RESERVATION = 3; + } + + // Corresponds to the type of reservation consumption. + Type consume_reservation_type = 1; + + // Corresponds to the label key of a reservation resource. To target a + // SPECIFIC_RESERVATION by name, specify + // "compute.googleapis.com/reservation-name" as the key and specify the name + // of your reservation as its value. + string key = 2; + + // Corresponds to the label value(s) of reservation resource(s). + repeated string values = 3; +} + +// SoleTenantConfig contains the NodeAffinities to specify what shared sole +// tenant node groups should back the node pool. +message SoleTenantConfig { + // Specifies the NodeAffinity key, values, and affinity operator according to + // [shared sole tenant node group + // affinities](https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes#node_affinity_and_anti-affinity). + message NodeAffinity { + // Operator allows user to specify affinity or anti-affinity for the + // given key values. + enum Operator { + // Invalid or unspecified affinity operator. + OPERATOR_UNSPECIFIED = 0; + + // Affinity operator. + IN = 1; + + // Anti-affinity operator. + NOT_IN = 2; + } + + // Key for NodeAffinity. + string key = 1; + + // Operator for NodeAffinity. + Operator operator = 2; + + // Values for NodeAffinity. + repeated string values = 3; + } + + // NodeAffinities used to match to a shared sole tenant node group. + repeated NodeAffinity node_affinities = 1; +} + +// Kubernetes taint is composed of three fields: key, value, and effect. Effect +// can only be one of three types: NoSchedule, PreferNoSchedule or NoExecute. +// +// See +// [here](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration) +// for more information, including usage and the valid values. +message NodeTaint { + // Possible values for Effect in taint. + enum Effect { + // Not set + EFFECT_UNSPECIFIED = 0; + + // NoSchedule + NO_SCHEDULE = 1; + + // PreferNoSchedule + PREFER_NO_SCHEDULE = 2; + + // NoExecute + NO_EXECUTE = 3; + } + + // Key for taint. + string key = 1; + + // Value for taint. + string value = 2; + + // Effect for taint. + Effect effect = 3; +} + +// Collection of Kubernetes [node +// taints](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration). +message NodeTaints { + // List of node taints. + repeated NodeTaint taints = 1; +} + +// Collection of node-level [Kubernetes +// labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels). +message NodeLabels { + // Map of node label keys and node label values. + map labels = 1; +} + +// Collection of [GCP +// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). +message ResourceLabels { + // Map of node label keys and node label values. + map labels = 1; +} + +// Collection of Compute Engine network tags that can be applied to a node's +// underlying VM instance. (See `tags` field in +// [`NodeConfig`](/kubernetes-engine/docs/reference/rest/v1/NodeConfig)). +message NetworkTags { + // List of network tags. + repeated string tags = 1; +} + +// The authentication information for accessing the master endpoint. +// Authentication can be done using HTTP basic auth or using client +// certificates. +message MasterAuth { + // 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). + // + // Warning: basic authentication is deprecated, and will be removed in GKE + // control plane versions 1.19 and newer. For a list of recommended + // authentication methods, see: + // https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication + string username = 1 [deprecated = true]; + + // 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. + // + // Warning: basic authentication is deprecated, and will be removed in GKE + // control plane versions 1.19 and newer. For a list of recommended + // authentication methods, see: + // https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication + string password = 2 [deprecated = true]; + + // Configuration for client certificate authentication on the cluster. For + // clusters before v1.12, if no configuration is specified, a client + // certificate is issued. + ClientCertificateConfig client_certificate_config = 3; + + string cluster_ca_certificate = 100; + + // [Output only] Base64-encoded public certificate used by clients to + // authenticate to the cluster endpoint. + string client_certificate = 101; + + // [Output only] Base64-encoded private key used by clients to authenticate + // to the cluster endpoint. + string client_key = 102; +} + +// Configuration for client certificates on the cluster. +message ClientCertificateConfig { + // Issue a client certificate. + bool issue_client_certificate = 1; +} + +// Configuration for the addons that can be automatically spun up in the +// cluster, enabling additional functionality. +message AddonsConfig { + // Configuration for the HTTP (L7) load balancing controller addon, which + // makes it easy to set up HTTP load balancers for services in a cluster. + HttpLoadBalancing http_load_balancing = 1; + + // 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. + HorizontalPodAutoscaling horizontal_pod_autoscaling = 2; + + // 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 + KubernetesDashboard kubernetes_dashboard = 3 [deprecated = true]; + + // 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. + NetworkPolicyConfig network_policy_config = 4; + + // Configuration for Istio, an open platform to connect, manage, and secure + // microservices. + IstioConfig istio_config = 5 [deprecated = true]; + + // Configuration for the Cloud Run addon. The `IstioConfig` addon must be + // enabled in order to enable Cloud Run addon. This option can only be enabled + // at cluster creation time. + CloudRunConfig cloud_run_config = 7; + + // Configuration for NodeLocalDNS, a dns cache running on cluster nodes + DnsCacheConfig dns_cache_config = 8; + + // Configuration for the ConfigConnector add-on, a Kubernetes + // extension to manage hosted GCP services through the Kubernetes API + ConfigConnectorConfig config_connector_config = 10; + + // Configuration for the Compute Engine Persistent Disk CSI driver. + GcePersistentDiskCsiDriverConfig gce_persistent_disk_csi_driver_config = 11; + + // Configuration for the KALM addon, which manages the lifecycle of k8s + // applications. + KalmConfig kalm_config = 12 [deprecated = true]; + + // Configuration for the GCP Filestore CSI driver. + GcpFilestoreCsiDriverConfig gcp_filestore_csi_driver_config = 14; + + // Configuration for the Backup for GKE agent addon. + GkeBackupAgentConfig gke_backup_agent_config = 16; + + // Configuration for the Cloud Storage Fuse CSI driver. + GcsFuseCsiDriverConfig gcs_fuse_csi_driver_config = 17; +} + +// 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. +message HttpLoadBalancing { + // 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. + bool disabled = 1; +} + +// 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. +message HorizontalPodAutoscaling { + // Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. + // When enabled, it ensures that metrics are collected into Stackdriver + // Monitoring. + bool disabled = 1; +} + +// Configuration for the Kubernetes Dashboard. +message KubernetesDashboard { + // Whether the Kubernetes Dashboard is enabled for this cluster. + bool disabled = 1; +} + +// 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. +message NetworkPolicyConfig { + // Whether NetworkPolicy is enabled for this cluster. + bool disabled = 1; +} + +// Configuration for NodeLocal DNSCache +message DnsCacheConfig { + // Whether NodeLocal DNSCache is enabled for this cluster. + bool enabled = 1; +} + +// Configuration options for the KALM addon. +message KalmConfig { + // Whether KALM is enabled for this cluster. + bool enabled = 1 [deprecated = true]; +} + +// Configuration for the Backup for GKE Agent. +message GkeBackupAgentConfig { + // Whether the Backup for GKE agent is enabled for this cluster. + bool enabled = 1; +} + +// Configuration options for the Config Connector add-on. +message ConfigConnectorConfig { + // Whether Cloud Connector is enabled for this cluster. + bool enabled = 1; +} + +// Configuration for the Compute Engine PD CSI driver. +message GcePersistentDiskCsiDriverConfig { + // Whether the Compute Engine PD CSI driver is enabled for this cluster. + bool enabled = 1; +} + +// Configuration for the GCP Filestore CSI driver. +message GcpFilestoreCsiDriverConfig { + // Whether the GCP Filestore CSI driver is enabled for this cluster. + bool enabled = 1; +} + +// Configuration for the Cloud Storage Fuse CSI driver. +message GcsFuseCsiDriverConfig { + // Whether the Cloud Storage Fuse CSI driver is enabled for this cluster. + bool enabled = 1; +} + +// Configuration for controlling master global access settings. +message PrivateClusterMasterGlobalAccessConfig { + // Whenever master is accessible globally or not. + bool enabled = 1; +} + +// Configuration options for private clusters. +message PrivateClusterConfig { + // 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. + bool enable_private_nodes = 1; + + // Whether the master's internal IP address is used as the cluster endpoint. + bool enable_private_endpoint = 2; + + // 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. + string master_ipv4_cidr_block = 3; + + // Output only. The internal IP address of this cluster's master endpoint. + string private_endpoint = 4; + + // Output only. The external IP address of this cluster's master endpoint. + string public_endpoint = 5; + + // Output only. The peering name in the customer VPC used by this cluster. + string peering_name = 7; + + // Controls master global access settings. + PrivateClusterMasterGlobalAccessConfig master_global_access_config = 8; + + // Subnet to provision the master's private endpoint during cluster creation. + // Specified in projects/*/regions/*/subnetworks/* format. + string private_endpoint_subnetwork = 10; +} + +// Configuration options for Istio addon. +message IstioConfig { + // Istio auth mode, https://istio.io/docs/concepts/security/mutual-tls.html + enum IstioAuthMode { + // auth not enabled + AUTH_NONE = 0; + + // auth mutual TLS enabled + AUTH_MUTUAL_TLS = 1; + } + + // Whether Istio is enabled for this cluster. + bool disabled = 1 [deprecated = true]; + + // The specified Istio auth mode, either none, or mutual TLS. + IstioAuthMode auth = 2 [deprecated = true]; +} + +// Configuration options for the Cloud Run feature. +message CloudRunConfig { + // Load balancer type of ingress service of Cloud Run. + enum LoadBalancerType { + // Load balancer type for Cloud Run is unspecified. + LOAD_BALANCER_TYPE_UNSPECIFIED = 0; + + // Install external load balancer for Cloud Run. + LOAD_BALANCER_TYPE_EXTERNAL = 1; + + // Install internal load balancer for Cloud Run. + LOAD_BALANCER_TYPE_INTERNAL = 2; + } + + // Whether Cloud Run addon is enabled for this cluster. + bool disabled = 1; + + // Which load balancer type is installed for Cloud Run. + LoadBalancerType load_balancer_type = 3; +} + +// 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. +message MasterAuthorizedNetworksConfig { + // CidrBlock contains an optional name and one CIDR block. + message CidrBlock { + // display_name is an optional field for users to identify CIDR blocks. + string display_name = 1; + + // cidr_block must be specified in CIDR notation. + string cidr_block = 2; + } + + // Whether or not master authorized networks is enabled. + bool enabled = 1; + + // cidr_blocks define up to 10 external networks that could access + // Kubernetes master through HTTPS. + repeated CidrBlock cidr_blocks = 2; + + // Whether master is accessbile via Google Compute Engine Public IP addresses. + optional bool gcp_public_cidrs_access_enabled = 3; +} + +// Configuration for the legacy Attribute Based Access Control authorization +// mode. +message LegacyAbac { + // 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. + bool enabled = 1; +} + +// Configuration options for the NetworkPolicy feature. +// https://kubernetes.io/docs/concepts/services-networking/networkpolicies/ +message NetworkPolicy { + // Allowed Network Policy providers. + enum Provider { + // Not set + PROVIDER_UNSPECIFIED = 0; + + // Tigera (Calico Felix). + CALICO = 1; + } + + // The selected network policy provider. + Provider provider = 1; + + // Whether network policy is enabled on the cluster. + bool enabled = 2; +} + +// [PRIVATE FIELD] +// Config for pod CIDR size overprovisioning. +message PodCIDROverprovisionConfig { + // Whether Pod CIDR overprovisioning is disabled. + // Note: Pod CIDR overprovisioning is enabled by default. + bool disable = 1; +} + +// Configuration for controlling how IPs are allocated in the cluster. +message IPAllocationPolicy { + // Possible values for IP stack type + enum StackType { + // By default, the clusters will be IPV4 only + STACK_TYPE_UNSPECIFIED = 0; + + // The value used if the cluster is a IPV4 only + IPV4 = 1; + + // The value used if the cluster is a dual stack cluster + IPV4_IPV6 = 2; + } + + // IPv6 access type + enum IPv6AccessType { + // Default value, will be defaulted as type external. + IPV6_ACCESS_TYPE_UNSPECIFIED = 0; + + // Access type internal (all v6 addresses are internal IPs) + INTERNAL = 1; + + // Access type external (all v6 addresses are external IPs) + EXTERNAL = 2; + } + + // Whether alias IPs will be used for pod IPs in the cluster. + // This is used in conjunction with use_routes. It cannot + // be true if use_routes is true. If both use_ip_aliases and use_routes are + // false, then the server picks the default IP allocation mode + bool use_ip_aliases = 1; + + // Whether a new subnetwork will be created automatically for the cluster. + // + // This field is only applicable when `use_ip_aliases` is true. + bool create_subnetwork = 2; + + // 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. + string subnetwork_name = 3; + + // This field is deprecated, use cluster_ipv4_cidr_block. + string cluster_ipv4_cidr = 4 [deprecated = true]; + + // This field is deprecated, use node_ipv4_cidr_block. + string node_ipv4_cidr = 5 [deprecated = true]; + + // This field is deprecated, use services_ipv4_cidr_block. + string services_ipv4_cidr = 6 [deprecated = true]; + + // 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 and + // create_subnetwork is false. + string cluster_secondary_range_name = 7; + + // 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 and + // create_subnetwork is false. + string services_secondary_range_name = 8; + + // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // 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. + string cluster_ipv4_cidr_block = 9; + + // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // 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. + string node_ipv4_cidr_block = 10; + + // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // 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. + string services_ipv4_cidr_block = 11; + + // If true, allow allocation of cluster CIDR ranges that overlap with certain + // kinds of network routes. By default we do not allow cluster CIDR ranges to + // intersect with any user declared routes. With allow_route_overlap == true, + // we allow overlapping with CIDR ranges that are larger than the cluster CIDR + // range. + // + // If this field is set to true, then cluster and services CIDRs must be + // fully-specified (e.g. `10.96.0.0/14`, but not `/14`), which means: + // 1) When `use_ip_aliases` is true, `cluster_ipv4_cidr_block` and + // `services_ipv4_cidr_block` must be fully-specified. + // 2) When `use_ip_aliases` is false, `cluster.cluster_ipv4_cidr` muse be + // fully-specified. + bool allow_route_overlap = 12; + + // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // 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. + // This field is deprecated, use cluster.tpu_config.ipv4_cidr_block instead. + string tpu_ipv4_cidr_block = 13; + + // Whether routes will be used for pod IPs in the cluster. + // This is used in conjunction with use_ip_aliases. It cannot be true if + // use_ip_aliases is true. If both use_ip_aliases and use_routes are false, + // then the server picks the default IP allocation mode + bool use_routes = 15; + + // IP stack type + StackType stack_type = 16; + + // The ipv6 access type (internal or external) when create_subnetwork is true + IPv6AccessType ipv6_access_type = 17; + + // [PRIVATE FIELD] + // Pod CIDR size overprovisioning config for the cluster. + // + // Pod CIDR size per node depends on max_pods_per_node. By default, the value + // of max_pods_per_node is doubled and then rounded off to next power of 2 to + // get the size of pod CIDR block per node. + // Example: max_pods_per_node of 30 would result in 64 IPs (/26). + // + // This config can disable the doubling of IPs (we still round off to next + // power of 2) + // Example: max_pods_per_node of 30 will result in 32 IPs (/27) when + // overprovisioning is disabled. + PodCIDROverprovisionConfig pod_cidr_overprovision_config = 21; + + // Output only. [Output only] The subnet's IPv6 CIDR block used by nodes and + // pods. + string subnet_ipv6_cidr_block = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output only] The services IPv6 CIDR block for the cluster. + string services_ipv6_cidr_block = 23 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output only] The additional pod ranges that are added to the + // cluster. These pod ranges can be used by new node pools to allocate pod IPs + // automatically. Once the range is removed it will not show up in + // IPAllocationPolicy. + AdditionalPodRangesConfig additional_pod_ranges_config = 24 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output only] The utilization of the cluster default IPv4 + // range for the pod. The ratio is Usage/[Total number of IPs in the secondary + // range], Usage=numNodes*numZones*podIPsPerNode. + double default_pod_ipv4_range_utilization = 25 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Configuration for Binary Authorization. +message BinaryAuthorization { + // Binary Authorization mode of operation. + enum EvaluationMode { + // Default value + EVALUATION_MODE_UNSPECIFIED = 0; + + // Disable BinaryAuthorization + DISABLED = 1; + + // Enforce Kubernetes admission requests with BinaryAuthorization using the + // project's singleton policy. This is equivalent to setting the + // enabled boolean to true. + PROJECT_SINGLETON_POLICY_ENFORCE = 2; + } + + // This field is deprecated. Leave this unset and instead configure + // BinaryAuthorization using evaluation_mode. If evaluation_mode is set to + // anything other than EVALUATION_MODE_UNSPECIFIED, this field is ignored. + bool enabled = 1 [deprecated = true]; + + // Mode of operation for binauthz policy evaluation. If unspecified, defaults + // to DISABLED. + EvaluationMode evaluation_mode = 2; +} + +// Configuration for the PodSecurityPolicy feature. +message PodSecurityPolicyConfig { + // Enable the PodSecurityPolicy controller for this cluster. If enabled, pods + // must be valid under a PodSecurityPolicy to be created. + bool enabled = 1; +} + +// Configuration for returning group information from authenticators. +message AuthenticatorGroupsConfig { + // Whether this cluster should return group membership lookups + // during authentication using a group of security groups. + bool enabled = 1; + + // The name of the security group-of-groups to be used. Only relevant + // if enabled = true. + string security_group = 2; +} + +// Telemetry integration for the cluster. +message ClusterTelemetry { + // Type of the integration. + enum Type { + // Not set. + UNSPECIFIED = 0; + + // Monitoring integration is disabled. + DISABLED = 1; + + // Monitoring integration is enabled. + ENABLED = 2; + + // Only system components are monitored and logged. + SYSTEM_ONLY = 3; + } + + // Type of the integration. + Type type = 1; +} + +// A Google Kubernetes Engine cluster. +message Cluster { + // The current status of the cluster. + enum Status { + // Not set. + STATUS_UNSPECIFIED = 0; + + // The PROVISIONING state indicates the cluster is being created. + PROVISIONING = 1; + + // The RUNNING state indicates the cluster has been created and is fully + // usable. + RUNNING = 2; + + // 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. + RECONCILING = 3; + + // The STOPPING state indicates the cluster is being deleted. + STOPPING = 4; + + // The ERROR state indicates the cluster may be unusable. Details + // can be found in the `statusMessage` field. + ERROR = 5; + + // The DEGRADED state indicates the cluster requires user action to restore + // full functionality. Details can be found in the `statusMessage` field. + DEGRADED = 6; + } + + // 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. + string name = 1; + + // An optional description of this cluster. + string description = 2; + + // The number of nodes to create in this cluster. You must ensure that your + // 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 + // "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. + int32 initial_node_count = 3 [deprecated = true]; + + // 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. + NodeConfig node_config = 4 [deprecated = true]; + + // 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. + MasterAuth master_auth = 5; + + // The logging service the cluster should use to write logs. + // Currently available options: + // + // * `logging.googleapis.com/kubernetes` - The Cloud Logging + // service with a Kubernetes-native resource model + // * `logging.googleapis.com` - The legacy Cloud Logging service (no longer + // available as of GKE 1.15). + // * `none` - no logs will be exported from the cluster. + // + // If left as an empty string,`logging.googleapis.com/kubernetes` will be + // used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. + string logging_service = 6; + + // The monitoring service the cluster should use to write metrics. + // Currently available options: + // + // * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring + // service with a Kubernetes-native resource model + // * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no + // longer available as of GKE 1.15). + // * `none` - No metrics will be exported from the cluster. + // + // If left as an empty string,`monitoring.googleapis.com/kubernetes` will be + // used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. + string monitoring_service = 7; + + // The name of the Google Compute Engine + // [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) + // to which the cluster is connected. If left unspecified, the `default` + // network will be used. On output this shows the network ID instead of the + // name. + string network = 8; + + // The IP address range of the container pods in this cluster, in + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // 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`. + string cluster_ipv4_cidr = 9; + + // Configurations for the various addons available to run in the cluster. + AddonsConfig addons_config = 10; + + // The name of the Google Compute Engine + // [subnetwork](https://cloud.google.com/compute/docs/subnetworks) to which + // the cluster is connected. On output this shows the subnetwork ID instead of + // the name. + string subnetwork = 11; + + // The node pools associated with this cluster. + // This field should not be set if "node_config" or "initial_node_count" are + // specified. + repeated NodePool node_pools = 12; + + // The list of Google Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster's nodes should be located. + // + // This field provides a default value if + // [NodePool.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools#NodePool.FIELDS.locations) + // are not specified during node pool creation. + // + // Warning: changing cluster locations will update the + // [NodePool.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools#NodePool.FIELDS.locations) + // of all node pools and will result in nodes being added and/or removed. + repeated string locations = 13; + + // Kubernetes alpha features are enabled on this cluster. This includes alpha + // API groups (e.g. v1beta1) 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. + bool enable_kubernetes_alpha = 14; + + // Kubernetes open source beta apis enabled on the cluster. Only beta apis. + K8sBetaAPIConfig enable_k8s_beta_apis = 143; + + // The resource labels for the cluster to use to annotate any related + // Google Compute Engine resources. + map resource_labels = 15; + + // The fingerprint of the set of labels for this cluster. + string label_fingerprint = 16; + + // Configuration for the legacy ABAC authorization mode. + LegacyAbac legacy_abac = 18; + + // Configuration options for the NetworkPolicy feature. + NetworkPolicy network_policy = 19; + + // Configuration for cluster IP allocation. + IPAllocationPolicy ip_allocation_policy = 20; + + // The configuration options for master authorized networks feature. + MasterAuthorizedNetworksConfig master_authorized_networks_config = 22; + + // Configure the maintenance policy for this cluster. + MaintenancePolicy maintenance_policy = 23; + + // Configuration for Binary Authorization. + BinaryAuthorization binary_authorization = 24; + + // Configuration for the PodSecurityPolicy feature. + PodSecurityPolicyConfig pod_security_policy_config = 25; + + // Cluster-level autoscaling configuration. + ClusterAutoscaling autoscaling = 26; + + // Configuration for cluster networking. + NetworkConfig network_config = 27; + + // If this is a private cluster setup. Private clusters are clusters that, by + // default have no external IP addresses on the nodes and where nodes and the + // master communicate over private IP addresses. + // This field is deprecated, use private_cluster_config.enable_private_nodes + // instead. + bool private_cluster = 28 [deprecated = true]; + + // The IP prefix in CIDR notation to use for the hosted master network. + // This prefix will be used for assigning private IP addresses to the + // master or set of masters, as well as the ILB VIP. + // This field is deprecated, use + // private_cluster_config.master_ipv4_cidr_block instead. + string master_ipv4_cidr_block = 29 [deprecated = true]; + + // 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. + MaxPodsConstraint default_max_pods_constraint = 30; + + // Configuration for exporting resource usages. Resource usage export is + // disabled when this config unspecified. + ResourceUsageExportConfig resource_usage_export_config = 33; + + // Configuration controlling RBAC group membership information. + AuthenticatorGroupsConfig authenticator_groups_config = 34; + + // Configuration for private cluster. + PrivateClusterConfig private_cluster_config = 37; + + // Cluster-level Vertical Pod Autoscaling configuration. + VerticalPodAutoscaling vertical_pod_autoscaling = 39; + + // Shielded Nodes configuration. + ShieldedNodes shielded_nodes = 40; + + // Release channel configuration. If left unspecified on cluster creation and + // a version is specified, the cluster is enrolled in the most mature release + // channel where the version is available (first checking STABLE, then + // REGULAR, and finally RAPID). Otherwise, if no release channel + // configuration and no version is specified, the cluster is enrolled in the + // REGULAR channel with its default version. + ReleaseChannel release_channel = 41; + + // Configuration for the use of Kubernetes Service Accounts in GCP IAM + // policies. + WorkloadIdentityConfig workload_identity_config = 43; + + // Configuration for issuance of mTLS keys and certificates to Kubernetes + // pods. + WorkloadCertificates workload_certificates = 52; + + // Configuration for issuance of mTLS keys and certificates to Kubernetes + // pods. + MeshCertificates mesh_certificates = 67; + + // Configuration for direct-path (via ALTS) with workload identity. + WorkloadALTSConfig workload_alts_config = 53; + + // Configuration for the fine-grained cost management feature. + CostManagementConfig cost_management_config = 45; + + // Telemetry integration for the cluster. + ClusterTelemetry cluster_telemetry = 46; + + // Configuration for Cloud TPU support; + TpuConfig tpu_config = 47; + + // Notification configuration of the cluster. + NotificationConfig notification_config = 49; + + // Configuration of Confidential Nodes. + // All the nodes in the cluster will be Confidential VM once enabled. + ConfidentialNodes confidential_nodes = 50; + + // Configuration for Identity Service component. + IdentityServiceConfig identity_service_config = 54; + + // [Output only] Server-defined URL for the resource. + string self_link = 100; + + // [Output only] The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field is deprecated, use location instead. + string zone = 101 [deprecated = true]; + + // [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. + string endpoint = 102; + + // 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 + string initial_cluster_version = 103; + + // [Output only] The current software version of the master endpoint. + string current_master_version = 104; + + // [Output only] Deprecated, use + // [NodePool.version](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters.nodePools) + // 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. + string current_node_version = 105 [deprecated = true]; + + // [Output only] The time the cluster was created, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + string create_time = 106; + + // [Output only] The current status of this cluster. + Status status = 107; + + // [Output only] Deprecated. Use conditions instead. + // Additional information about the current status of this + // cluster, if available. + string status_message = 108 [deprecated = true]; + + // [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. + int32 node_ipv4_cidr_size = 109; + + // [Output only] The IP address range of the Kubernetes services in + // this cluster, in + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `1.2.3.4/29`). Service addresses are + // typically put in the last `/16` from the container CIDR. + string services_ipv4_cidr = 110; + + // Deprecated. Use node_pools.instance_group_urls. + repeated string instance_group_urls = 111 [deprecated = true]; + + // [Output only] The number of nodes currently in the cluster. Deprecated. + // Call Kubernetes API directly to retrieve node information. + int32 current_node_count = 112 [deprecated = true]; + + // [Output only] The time the cluster will be automatically + // deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + string expire_time = 113; + + // [Output only] The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) + // or + // [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) + // in which the cluster resides. + string location = 114; + + // Enable the ability to use Cloud TPUs in this cluster. + // This field is deprecated, use tpu_config.enabled instead. + bool enable_tpu = 115; + + // [Output only] The IP address range of the Cloud TPUs in this cluster, in + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `1.2.3.4/29`). + string tpu_ipv4_cidr_block = 116; + + // Configuration of etcd encryption. + DatabaseEncryption database_encryption = 38; + + // Which conditions caused the current cluster state. + repeated StatusCondition conditions = 118; + + // Configuration for master components. + Master master = 124; + + // Autopilot configuration for the cluster. + Autopilot autopilot = 128; + + // Output only. Unique id for the cluster. + string id = 129 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Default NodePool settings for the entire cluster. These settings are + // overridden if specified on the specific NodePool object. + optional NodePoolDefaults node_pool_defaults = 131; + + // Logging configuration for the cluster. + LoggingConfig logging_config = 132; + + // Monitoring configuration for the cluster. + MonitoringConfig monitoring_config = 133; + + // Node pool configs that apply to all auto-provisioned node pools + // in autopilot clusters and node auto-provisioning enabled clusters. + NodePoolAutoConfig node_pool_auto_config = 136; + + // Enable/Disable Protect API features for the cluster. + optional ProtectConfig protect_config = 137; + + // This checksum is computed by the server based on the value of cluster + // fields, and may be sent on update requests to ensure the client has an + // up-to-date value before proceeding. + string etag = 139; + + // Fleet information for the cluster. + Fleet fleet = 140; + + // Enable/Disable Security Posture API features for the cluster. + SecurityPostureConfig security_posture_config = 145; +} + +// Kubernetes open source beta apis enabled on the cluster. +message K8sBetaAPIConfig { + // api name, e.g. storage.k8s.io/v1beta1/csistoragecapacities. + repeated string enabled_apis = 1; +} + +// WorkloadConfig defines the flags to enable or disable the +// workload configurations for the cluster. +message WorkloadConfig { + // Mode defines how to audit the workload configs. + enum Mode { + // Default value meaning that no mode has been specified. + MODE_UNSPECIFIED = 0; + + // This disables Workload Configuration auditing on the cluster, + // meaning that nothing is surfaced. + DISABLED = 1; + + // Applies the default set of policy auditing to a cluster's workloads. + BASIC = 4; + + // Surfaces configurations that are not in line with the + // Pod Security Standard Baseline policy. + BASELINE = 2 [deprecated = true]; + + // Surfaces configurations that are not in line with the + // Pod Security Standard Restricted policy. + RESTRICTED = 3 [deprecated = true]; + } + + // Sets which mode of auditing should be used for the cluster's workloads. + optional Mode audit_mode = 1; +} + +// ProtectConfig defines the flags needed to enable/disable features for the +// Protect API. +message ProtectConfig { + // WorkloadVulnerabilityMode defines mode to perform vulnerability scanning. + enum WorkloadVulnerabilityMode { + // Default value not specified. + WORKLOAD_VULNERABILITY_MODE_UNSPECIFIED = 0; + + // Disables Workload Vulnerability Scanning feature on the cluster. + DISABLED = 1; + + // Applies basic vulnerability scanning settings for cluster workloads. + BASIC = 2; + } + + // WorkloadConfig defines which actions are enabled for a cluster's workload + // configurations. + optional WorkloadConfig workload_config = 1; + + // Sets which mode to use for Protect workload vulnerability scanning feature. + optional WorkloadVulnerabilityMode workload_vulnerability_mode = 2; +} + +// SecurityPostureConfig defines the flags needed to enable/disable features for +// the Security Posture API. +message SecurityPostureConfig { + // Mode defines enablement mode for GKE Security posture features. + enum Mode { + // Default value not specified. + MODE_UNSPECIFIED = 0; + + // Disables Security Posture features on the cluster. + DISABLED = 1; + + // Applies Security Posture features on the cluster. + BASIC = 2; + } + + // VulnerabilityMode defines enablement mode for vulnerability scanning. + enum VulnerabilityMode { + // Default value not specified. + VULNERABILITY_MODE_UNSPECIFIED = 0; + + // Disables vulnerability scanning on the cluster. + VULNERABILITY_DISABLED = 1; + + // Applies basic vulnerability scanning on the cluster. + VULNERABILITY_BASIC = 2; + } + + // Sets which mode to use for Security Posture features. + optional Mode mode = 1; + + // Sets which mode to use for vulnerability scanning. + optional VulnerabilityMode vulnerability_mode = 2; +} + +// Subset of Nodepool message that has defaults. +message NodePoolDefaults { + // Subset of NodeConfig message that has defaults. + NodeConfigDefaults node_config_defaults = 1; +} + +// Subset of NodeConfig message that has defaults. +message NodeConfigDefaults { + // GCFS (Google Container File System, also known as Riptide) options. + GcfsConfig gcfs_config = 1; + + // Logging configuration for node pools. + NodePoolLoggingConfig logging_config = 3; +} + +// node pool configs that apply to all auto-provisioned node pools +// in autopilot clusters and node auto-provisioning enabled clusters +message NodePoolAutoConfig { + // 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 creation. Each tag within the list + // must comply with RFC1035. + NetworkTags network_tags = 1; +} + +// 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. +message ClusterUpdate { + // 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 + string desired_node_version = 4; + + // The monitoring service the cluster should use to write metrics. + // Currently available options: + // + // * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring + // service with a Kubernetes-native resource model + // * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no + // longer available as of GKE 1.15). + // * `none` - No metrics will be exported from the cluster. + // + // If left as an empty string,`monitoring.googleapis.com/kubernetes` will be + // used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. + string desired_monitoring_service = 5; + + // Configurations for the various addons available to run in the cluster. + AddonsConfig desired_addons_config = 6; + + // The node pool to be upgraded. This field is mandatory if + // "desired_node_version", "desired_image_family", + // "desired_node_pool_autoscaling", or "desired_workload_metadata_config" + // is specified and there is more than one node pool on the cluster. + string desired_node_pool_id = 7; + + // The desired image type for the node pool. + // NOTE: Set the "desired_node_pool" field as well. + string desired_image_type = 8; + + // 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. + NodePoolAutoscaling desired_node_pool_autoscaling = 9; + + // The desired list of Google Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster's nodes should be located. + // + // This list must always include the cluster's primary zone. + // + // Warning: changing cluster locations will update the locations of all node + // pools and will result in nodes being added and/or removed. + repeated string desired_locations = 10; + + // The desired configuration options for master authorized networks feature. + MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12; + + // The desired configuration options for the PodSecurityPolicy feature. + PodSecurityPolicyConfig desired_pod_security_policy_config = 14; + + // Cluster-level autoscaling configuration. + ClusterAutoscaling desired_cluster_autoscaling = 15; + + // The desired configuration options for the Binary Authorization feature. + BinaryAuthorization desired_binary_authorization = 16; + + // The logging service the cluster should use to write logs. + // Currently available options: + // + // * `logging.googleapis.com/kubernetes` - The Cloud Logging + // service with a Kubernetes-native resource model + // * `logging.googleapis.com` - The legacy Cloud Logging service (no longer + // available as of GKE 1.15). + // * `none` - no logs will be exported from the cluster. + // + // If left as an empty string,`logging.googleapis.com/kubernetes` will be + // used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. + string desired_logging_service = 19; + + // The desired configuration for exporting resource usage. + ResourceUsageExportConfig desired_resource_usage_export_config = 21; + + // Cluster-level Vertical Pod Autoscaling configuration. + VerticalPodAutoscaling desired_vertical_pod_autoscaling = 22; + + // The desired private cluster configuration. + PrivateClusterConfig desired_private_cluster_config = 25; + + // The desired config of Intra-node visibility. + IntraNodeVisibilityConfig desired_intra_node_visibility_config = 26; + + // The desired status of whether to disable default sNAT for this cluster. + DefaultSnatStatus desired_default_snat_status = 28; + + // The desired telemetry integration for the cluster. + ClusterTelemetry desired_cluster_telemetry = 30; + + // The desired release channel configuration. + ReleaseChannel desired_release_channel = 31; + + // The desired Cloud TPU configuration. + TpuConfig desired_tpu_config = 38; + + // The desired L4 Internal Load Balancer Subsetting configuration. + ILBSubsettingConfig desired_l4ilb_subsetting_config = 39; + + // The desired datapath provider for the cluster. + DatapathProvider desired_datapath_provider = 50; + + // The desired state of IPv6 connectivity to Google Services. + PrivateIPv6GoogleAccess desired_private_ipv6_google_access = 51; + + // The desired notification configuration. + NotificationConfig desired_notification_config = 55; + + // The Kubernetes version to change the master to. The only valid value is the + // latest supported version. + // + // 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 + string desired_master_version = 100; + + // The desired GCFS config for the cluster. + GcfsConfig desired_gcfs_config = 109; + + // Configuration of etcd encryption. + DatabaseEncryption desired_database_encryption = 46; + + // Configuration for Workload Identity. + WorkloadIdentityConfig desired_workload_identity_config = 47; + + // Configuration for issuance of mTLS keys and certificates to Kubernetes + // pods. + WorkloadCertificates desired_workload_certificates = 61; + + // Configuration for issuance of mTLS keys and certificates to Kubernetes + // pods. + MeshCertificates desired_mesh_certificates = 67; + + // Configuration for direct-path (via ALTS) with workload identity. + WorkloadALTSConfig desired_workload_alts_config = 62; + + // Configuration for Shielded Nodes. + ShieldedNodes desired_shielded_nodes = 48; + + // The desired configuration for the fine-grained cost management feature. + CostManagementConfig desired_cost_management_config = 49; + + // Configuration for master components. + Master desired_master = 52; + + // DNSConfig contains clusterDNS config for this cluster. + DNSConfig desired_dns_config = 53; + + // ServiceExternalIPsConfig specifies the config for the use of Services with + // ExternalIPs field. + ServiceExternalIPsConfig desired_service_external_ips_config = 60; + + // AuthenticatorGroupsConfig specifies the config for the cluster security + // groups settings. + AuthenticatorGroupsConfig desired_authenticator_groups_config = 63; + + // The desired logging configuration. + LoggingConfig desired_logging_config = 64; + + // The desired monitoring configuration. + MonitoringConfig desired_monitoring_config = 65; + + // The desired Identity Service component configuration. + IdentityServiceConfig desired_identity_service_config = 66; + + // Enable/Disable private endpoint for the cluster's master. + optional bool desired_enable_private_endpoint = 71; + + // The desired network tags that apply to all auto-provisioned node pools + // in autopilot clusters and node auto-provisioning enabled clusters. + NetworkTags desired_node_pool_auto_config_network_tags = 110; + + // Enable/Disable Protect API features for the cluster. + optional ProtectConfig desired_protect_config = 112; + + // The desired config of Gateway API on this cluster. + GatewayAPIConfig desired_gateway_api_config = 114; + + // The current etag of the cluster. + // If an etag is provided and does not match the current etag of the cluster, + // update will be blocked and an ABORTED error will be returned. + string etag = 115; + + // The desired node pool logging configuration defaults for the cluster. + NodePoolLoggingConfig desired_node_pool_logging_config = 116; + + // The desired fleet configuration for the cluster. + Fleet desired_fleet = 117; + + // The desired stack type of the cluster. + // If a stack type is provided and does not match the current stack type of + // the cluster, update will attempt to change the stack type to the new type. + StackType desired_stack_type = 119; + + // The additional pod ranges to be added to the cluster. These pod ranges + // can be used by node pools to allocate pod IPs. + AdditionalPodRangesConfig additional_pod_ranges_config = 120; + + // The additional pod ranges that are to be removed from the cluster. + // The pod ranges specified here must have been specified earlier in the + // 'additional_pod_ranges_config' argument. + AdditionalPodRangesConfig removed_additional_pod_ranges_config = 121; + + // Kubernetes open source beta apis enabled on the cluster. Only beta apis + K8sBetaAPIConfig enable_k8s_beta_apis = 122; + + // Enable/Disable Security Posture API features for the cluster. + SecurityPostureConfig desired_security_posture_config = 124; + + // The desired network performance config. + NetworkConfig.ClusterNetworkPerformanceConfig + desired_network_performance_config = 125; + + // Enable/Disable FQDN Network Policy for the cluster. + optional bool desired_enable_fqdn_network_policy = 126; + + // The desired workload policy configuration for the autopilot cluster. + WorkloadPolicyConfig desired_autopilot_workload_policy_config = 128; + + // Beta APIs enabled for cluster. + K8sBetaAPIConfig desired_k8s_beta_apis = 131; +} + +// AdditionalPodRangesConfig is the configuration for additional pod secondary +// ranges supporting the ClusterUpdate message. +message AdditionalPodRangesConfig { + // Name for pod secondary ipv4 range which has the actual range defined ahead. + repeated string pod_range_names = 1; + + // Output only. [Output only] Information for additional pod range. + repeated RangeInfo pod_range_info = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// RangeInfo contains the range name and the range utilization by this cluster. +message RangeInfo { + // Output only. [Output only] Name of a range. + string range_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output only] The utilization of the range. + double utilization = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// This operation resource represents operations that may have happened or are +// happening on the cluster. All fields are output only. +message Operation { + // Current status of the operation. + enum Status { + // Not set. + STATUS_UNSPECIFIED = 0; + + // The operation has been created. + PENDING = 1; + + // The operation is currently running. + RUNNING = 2; + + // The operation is done, either cancelled or completed. + DONE = 3; + + // The operation is aborting. + ABORTING = 4; + } + + // Operation type categorizes the operation. + enum Type { + // Not set. + TYPE_UNSPECIFIED = 0; + + // The cluster is being created. The cluster should be assumed to be + // unusable until the operation finishes. + // + // In the event of the operation failing, the cluster will enter the [ERROR + // state][Cluster.Status.ERROR] and eventually be deleted. + CREATE_CLUSTER = 1; + + // The cluster is being deleted. The cluster should be assumed to be + // unusable as soon as this operation starts. + // + // In the event of the operation failing, the cluster will enter the [ERROR + // state][Cluster.Status.ERROR] and the deletion will be automatically + // retried until completed. + DELETE_CLUSTER = 2; + + // The [cluster + // version][google.container.v1beta1.ClusterUpdate.desired_master_version] + // is being updated. Note that this includes "upgrades" to the same version, + // which are simply a recreation. This also includes + // [auto-upgrades](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades#upgrading_automatically). + // For more details, see [documentation on cluster + // upgrades](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades#cluster_upgrades). + UPGRADE_MASTER = 3; + + // A node pool is being updated. Despite calling this an "upgrade", this + // includes most forms of updates to node pools. This also includes + // [auto-upgrades](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-upgrades). + // + // This operation sets the + // [progress][google.container.v1beta1.Operation.progress] field and may be + // [canceled][google.container.v1beta1.ClusterManager.CancelOperation]. + // + // The upgrade strategy depends on [node pool + // configuration](https://cloud.google.com/kubernetes-engine/docs/concepts/node-pool-upgrade-strategies). + // The nodes are generally still usable during this operation. + UPGRADE_NODES = 4; + + // A problem has been detected with the control plane and is being repaired. + // This operation type is initiated by GKE. For more details, see + // [documentation on + // repairs](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#repairs). + REPAIR_CLUSTER = 5; + + // The cluster is being updated. This is a broad category of operations and + // includes operations that only change metadata as well as those that must + // recreate the entire cluster. If the control plane must be recreated, this + // will cause temporary downtime for zonal clusters. + // + // Some features require recreating the nodes as well. Those will be + // recreated as separate operations and the update may not be completely + // functional until the node pools recreations finish. Node recreations will + // generally follow [maintenance + // policies](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions). + // + // Some GKE-initiated operations use this type. This includes certain types + // of auto-upgrades and incident mitigations. + UPDATE_CLUSTER = 6; + + // A node pool is being created. The node pool should be assumed to be + // unusable until this operation finishes. In the event of an error, the + // node pool may be partially created. + // + // If enabled, [node + // autoprovisioning](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-provisioning) + // may have automatically initiated such operations. + CREATE_NODE_POOL = 7; + + // The node pool is being deleted. The node pool should be assumed to be + // unusable as soon as this operation starts. + DELETE_NODE_POOL = 8; + + // The node pool's + // [manamagent][google.container.v1beta1.NodePool.management] field is being + // updated. These operations only update metadata and may be concurrent with + // most other operations. + SET_NODE_POOL_MANAGEMENT = 9; + + // A problem has been detected with nodes and [they are being + // repaired](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-repair). + // This operation type is initiated by GKE, typically automatically. This + // operation may be concurrent with other operations and there may be + // multiple repairs occurring on the same node pool. + AUTO_REPAIR_NODES = 10; + + // Unused. Automatic node upgrade uses + // [UPGRADE_NODES][google.container.v1beta1.Operation.Type.UPGRADE_NODES]. + AUTO_UPGRADE_NODES = 11 [deprecated = true]; + + // Unused. Updating labels uses + // [UPDATE_CLUSTER][google.container.v1beta1.Operation.Type.UPDATE_CLUSTER]. + SET_LABELS = 12 [deprecated = true]; + + // Unused. Updating master auth uses + // [UPDATE_CLUSTER][google.container.v1beta1.Operation.Type.UPDATE_CLUSTER]. + SET_MASTER_AUTH = 13 [deprecated = true]; + + // The node pool is being resized. With the exception of resizing to or from + // size zero, the node pool is generally usable during this operation. + SET_NODE_POOL_SIZE = 14; + + // Unused. Updating network policy uses + // [UPDATE_CLUSTER][google.container.v1beta1.Operation.Type.UPDATE_CLUSTER]. + SET_NETWORK_POLICY = 15 [deprecated = true]; + + // Unused. Updating maintenance policy uses + // [UPDATE_CLUSTER][google.container.v1beta1.Operation.Type.UPDATE_CLUSTER]. + SET_MAINTENANCE_POLICY = 16 [deprecated = true]; + + // The control plane is being resized. This operation type is initiated by + // GKE. These operations are often performed preemptively to ensure that the + // control plane has sufficient resources and is not typically an indication + // of issues. For more details, see + // [documentation on + // resizes](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#repairs). + RESIZE_CLUSTER = 18; + } + + // The server-assigned ID for the operation. + string name = 1; + + // The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // operation is taking place. This field is deprecated, use location instead. + string zone = 2 [deprecated = true]; + + // The operation type. + Type operation_type = 3; + + // The current status of the operation. + Status status = 4; + + // Detailed operation progress, if available. + string detail = 8; + + // Output only. If an error has occurred, a textual description of the error. + // Deprecated. Use field error instead. + string status_message = 5 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Server-defined URI for the operation. Example: + // `https://container.googleapis.com/v1alpha1/projects/123/locations/us-central1/operations/operation-123`. + string self_link = 6; + + // Server-defined URI for the target of the operation. The format of this is a + // URI to the resource being modified (such as a cluster, node pool, or node). + // For node pool repairs, there may be multiple nodes being repaired, but only + // one will be the target. + // + // Examples: + // + // - + // ## + // `https://container.googleapis.com/v1/projects/123/locations/us-central1/clusters/my-cluster` + // + // ## + // `https://container.googleapis.com/v1/projects/123/zones/us-central1-c/clusters/my-cluster/nodePools/my-np` + // + // `https://container.googleapis.com/v1/projects/123/zones/us-central1-c/clusters/my-cluster/nodePools/my-np/node/my-node` + string target_link = 7; + + // [Output only] The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) + // or + // [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) + // in which the cluster resides. + string location = 9; + + // [Output only] The time the operation started, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + string start_time = 10; + + // [Output only] The time the operation completed, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + string end_time = 11; + + // Output only. [Output only] Progress information for an operation. + OperationProgress progress = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Which conditions caused the current cluster state. + // Deprecated. Use field error instead. + repeated StatusCondition cluster_conditions = 13 [deprecated = true]; + + // Which conditions caused the current node pool state. + // Deprecated. Use field error instead. + repeated StatusCondition nodepool_conditions = 14 [deprecated = true]; + + // The error result of the operation in case of failure. + google.rpc.Status error = 15; +} + +// Information about operation (or operation stage) progress. +message OperationProgress { + // Progress metric is (string, int|float|string) pair. + message Metric { + // Required. Metric name, e.g., "nodes total", "percent done". + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Strictly one of the values is required. + oneof value { + // For metrics with integer value. + int64 int_value = 2; + + // For metrics with floating point value. + double double_value = 3; + + // For metrics with custom values (ratios, visual progress, etc.). + string string_value = 4; + } + } + + // A non-parameterized string describing an operation stage. + // Unset for single-stage operations. + string name = 1; + + // Status of an operation stage. + // Unset for single-stage operations. + Operation.Status status = 2; + + // Progress metric bundle, for example: + // metrics: [{name: "nodes done", int_value: 15}, + // {name: "nodes total", int_value: 32}] + // or + // metrics: [{name: "progress", double_value: 0.56}, + // {name: "progress scale", double_value: 1.0}] + repeated Metric metrics = 3; + + // Substages of an operation or a stage. + repeated OperationProgress stages = 4; +} + +// CreateClusterRequest creates a cluster. +message CreateClusterRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the parent field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the parent + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. A [cluster + // resource](https://cloud.google.com/container-engine/reference/rest/v1beta1/projects.locations.clusters) + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // The parent (project and location) where the cluster will be created. + // Specified in the format `projects/*/locations/*`. + string parent = 5; +} + +// GetClusterRequest gets the settings of a cluster. +message GetClusterRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to retrieve. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to retrieve. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 5; +} + +// UpdateClusterRequest updates the settings of a cluster. +message UpdateClusterRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. A description of the update. + ClusterUpdate update = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to update. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 5; +} + +// SetNodePoolVersionRequest updates the version of a node pool. +message UpdateNodePoolRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the node pool to upgrade. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // 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 + string node_version = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. The desired image type for the node pool. Please see + // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for + // available image types. + string image_type = 6 [(google.api.field_behavior) = REQUIRED]; + + // The desired list of Google Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) in which the + // node pool's nodes should be located. Changing the locations for a node pool + // will result in nodes being either created or removed from the node pool, + // depending on whether locations are being added or removed. + repeated string locations = 13; + + // The desired workload metadata config for the node pool. + WorkloadMetadataConfig workload_metadata_config = 14; + + // The name (project, location, cluster, node pool) of the node pool to + // update. Specified in the format + // `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 8; + + // Upgrade settings control disruption and speed of the upgrade. + NodePool.UpgradeSettings upgrade_settings = 15; + + // The desired network tags to be applied to all nodes in the node pool. + // If this field is not present, the tags will not be changed. Otherwise, + // the existing network tags will be *replaced* with the provided tags. + NetworkTags tags = 16; + + // The desired node taints to be applied to all nodes in the node pool. + // If this field is not present, the taints will not be changed. Otherwise, + // the existing node taints will be *replaced* with the provided taints. + NodeTaints taints = 17; + + // The desired node labels to be applied to all nodes in the node pool. + // If this field is not present, the labels will not be changed. Otherwise, + // the existing node labels will be *replaced* with the provided labels. + NodeLabels labels = 18; + + // Parameters that can be configured on Linux nodes. + LinuxNodeConfig linux_node_config = 19; + + // Node kubelet configs. + NodeKubeletConfig kubelet_config = 20; + + // Node network config. + NodeNetworkConfig node_network_config = 21; + + // GCFS config. + GcfsConfig gcfs_config = 22; + + // Confidential nodes config. + // All the nodes in the node pool will be Confidential VM once enabled. + ConfidentialNodes confidential_nodes = 23; + + // Enable or disable gvnic on the node pool. + VirtualNIC gvnic = 29; + + // The current etag of the node pool. + // If an etag is provided and does not match the current etag of the node + // pool, update will be blocked and an ABORTED error will be returned. + string etag = 30; + + // Enable or disable NCCL fast socket for the node pool. + FastSocket fast_socket = 31; + + // Logging configuration. + NodePoolLoggingConfig logging_config = 32; + + // The resource labels for the node pool to use to annotate any related + // Google Compute Engine resources. + ResourceLabels resource_labels = 33; + + // Parameters that can be configured on Windows nodes. + WindowsNodeConfig windows_node_config = 34; +} + +// SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool. +message SetNodePoolAutoscalingRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the node pool to upgrade. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Autoscaling configuration for the node pool. + NodePoolAutoscaling autoscaling = 5 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster, node pool) of the node pool to set + // autoscaler settings. Specified in the format + // `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 6; +} + +// SetLoggingServiceRequest sets the logging service of a cluster. +message SetLoggingServiceRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. The logging service the cluster should use to write logs. + // Currently available options: + // + // * `logging.googleapis.com/kubernetes` - The Cloud Logging + // service with a Kubernetes-native resource model + // * `logging.googleapis.com` - The legacy Cloud Logging service (no longer + // available as of GKE 1.15). + // * `none` - no logs will be exported from the cluster. + // + // If left as an empty string,`logging.googleapis.com/kubernetes` will be + // used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. + string logging_service = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to set logging. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 5; +} + +// SetMonitoringServiceRequest sets the monitoring service of a cluster. +message SetMonitoringServiceRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. The monitoring service the cluster should use to write metrics. + // Currently available options: + // + // * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring + // service with a Kubernetes-native resource model + // * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no + // longer available as of GKE 1.15). + // * `none` - No metrics will be exported from the cluster. + // + // If left as an empty string,`monitoring.googleapis.com/kubernetes` will be + // used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. + string monitoring_service = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to set monitoring. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 6; +} + +// SetAddonsRequest sets the addons associated with the cluster. +message SetAddonsConfigRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. The desired configurations for the various addons available to + // run in the cluster. + AddonsConfig addons_config = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to set addons. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 6; +} + +// SetLocationsRequest sets the locations of the cluster. +message SetLocationsRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. The desired list of Google Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) 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. + repeated string locations = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to set locations. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 6; +} + +// UpdateMasterRequest updates the master of the cluster. +message UpdateMasterRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // 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 + string master_version = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to update. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 7; +} + +// SetMasterAuthRequest updates the admin password of a cluster. +message SetMasterAuthRequest { + // Operation type: what type update to perform. + enum Action { + // Operation is unknown and will error out. + UNKNOWN = 0; + + // Set the password to a user generated value. + SET_PASSWORD = 1; + + // Generate a new password and set it to that. + GENERATE_PASSWORD = 2; + + // 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. + SET_USERNAME = 3; + } + + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to upgrade. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. The exact form of action to be taken on the master auth. + Action action = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. A description of the update. + MasterAuth update = 5 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to set auth. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 7; +} + +// DeleteClusterRequest deletes a cluster. +message DeleteClusterRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to delete. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster) of the cluster to delete. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 4; +} + +// ListClustersRequest lists clusters. +message ListClustersRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the parent field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides, or "-" for all zones. This field has been deprecated and + // replaced by the parent field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The parent (project and location) where the clusters will be listed. + // Specified in the format `projects/*/locations/*`. + // Location "-" matches all zones and all regions. + string parent = 4; +} + +// ListClustersResponse is the result of ListClustersRequest. +message ListClustersResponse { + // A list of clusters in the project in the specified zone, or + // across all ones. + repeated Cluster clusters = 1; + + // If any zones are listed here, the list of clusters returned + // may be missing those zones. + repeated string missing_zones = 2; +} + +// GetOperationRequest gets a single operation. +message GetOperationRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The server-assigned `name` of the operation. + // This field has been deprecated and replaced by the name field. + string operation_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The name (project, location, operation id) of the operation to get. + // Specified in the format `projects/*/locations/*/operations/*`. + string name = 5; +} + +// ListOperationsRequest lists operations. +message ListOperationsRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the parent field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) to return + // operations for, or `-` for all zones. This field has been deprecated and + // replaced by the parent field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The parent (project and location) where the operations will be listed. + // Specified in the format `projects/*/locations/*`. + // Location "-" matches all zones and all regions. + string parent = 4; +} + +// CancelOperationRequest cancels a single operation. +message CancelOperationRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // operation resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The server-assigned `name` of the operation. + // This field has been deprecated and replaced by the name field. + string operation_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The name (project, location, operation id) of the operation to cancel. + // Specified in the format `projects/*/locations/*/operations/*`. + string name = 4; +} + +// ListOperationsResponse is the result of ListOperationsRequest. +message ListOperationsResponse { + // A list of operations in the project in the specified zone. + repeated Operation operations = 1; + + // If any zones are listed here, the list of operations returned + // may be missing the operations from those zones. + repeated string missing_zones = 2; +} + +// Gets the current Kubernetes Engine service configuration. +message GetServerConfigRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) to return + // operations for. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The name (project and location) of the server config to get, + // specified in the format `projects/*/locations/*`. + string name = 4; +} + +// Kubernetes Engine service configuration. +message ServerConfig { + // ReleaseChannelConfig exposes configuration for a release channel. + message ReleaseChannelConfig { + // Deprecated. + message AvailableVersion { + option deprecated = true; + + // Kubernetes version. + string version = 1; + + // Reason for availability. + string reason = 2; + } + + // The release channel this configuration applies to. + ReleaseChannel.Channel channel = 1; + + // The default version for newly created clusters on the channel. + string default_version = 2; + + // Deprecated. + // This field has been deprecated and replaced with the valid_versions + // field. + repeated AvailableVersion available_versions = 3 [deprecated = true]; + + // List of valid versions for the channel. + repeated string valid_versions = 4; + } + + // Version of Kubernetes the service deploys by default. + string default_cluster_version = 1; + + // List of valid node upgrade target versions, in descending order. + repeated string valid_node_versions = 3; + + // Default image type. + string default_image_type = 4; + + // List of valid image types. + repeated string valid_image_types = 5; + + // List of valid master versions, in descending order. + repeated string valid_master_versions = 6; + + // List of release channel configurations. + repeated ReleaseChannelConfig channels = 9; + + // Maps of Kubernetes version and supported Windows server versions. + map windows_version_maps = 10; +} + +// Best effort provisioning. +message BestEffortProvisioning { + // When this is enabled, cluster/node pool creations will ignore non-fatal + // errors like stockout to best provision as many nodes as possible right now + // and eventually bring up all target number of nodes + bool enabled = 1; + + // Minimum number of nodes to be provisioned to be considered as succeeded, + // and the rest of nodes will be provisioned gradually and eventually when + // stockout issue has been resolved. + int32 min_provision_nodes = 2; +} + +// Windows server versions. +message WindowsVersions { + // Windows server version. + message WindowsVersion { + // Windows server image type + string image_type = 1; + + // Windows server build number + string os_version = 2; + + // Mainstream support end date + google.type.Date support_end_date = 3; + } + + // List of Windows server versions. + repeated WindowsVersion windows_versions = 1; +} + +// CreateNodePoolRequest creates a node pool for a cluster. +message CreateNodePoolRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the parent field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the parent + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the parent field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. The node pool to create. + NodePool node_pool = 4 [(google.api.field_behavior) = REQUIRED]; + + // The parent (project, location, cluster name) where the node pool will be + // created. Specified in the format + // `projects/*/locations/*/clusters/*`. + string parent = 6; +} + +// DeleteNodePoolRequest deletes a node pool for a cluster. +message DeleteNodePoolRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the node pool to delete. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster, node pool id) of the node pool to + // delete. Specified in the format + // `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 6; +} + +// ListNodePoolsRequest lists the node pool(s) for a cluster. +message ListNodePoolsRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the parent field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the parent + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the parent field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The parent (project, location, cluster name) where the node pools will be + // listed. Specified in the format `projects/*/locations/*/clusters/*`. + string parent = 5; +} + +// GetNodePoolRequest retrieves a node pool for a cluster. +message GetNodePoolRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the node pool. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster, node pool id) of the node pool to + // get. Specified in the format + // `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 6; +} + +// Settings for blue-green upgrade. +message BlueGreenSettings { + // Standard rollout policy is the default policy for blue-green. + message StandardRolloutPolicy { + // Blue pool size to drain in a batch. + oneof update_batch_size { + // Percentage of the blue pool nodes to drain in a batch. + // The range of this field should be (0.0, 1.0]. + float batch_percentage = 1; + + // Number of blue nodes to drain in a batch. + int32 batch_node_count = 2; + } + + // Soak time after each batch gets drained. Default to zero. + optional google.protobuf.Duration batch_soak_duration = 3; + } + + // The rollout policy controls the general rollout progress of blue-green. + oneof rollout_policy { + // Standard policy for the blue-green upgrade. + StandardRolloutPolicy standard_rollout_policy = 1; + } + + // Time needed after draining entire blue pool. After this period, blue pool + // will be cleaned up. + optional google.protobuf.Duration node_pool_soak_duration = 2; +} + +// 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. +// These upgrade settings control the level of parallelism and the level of +// disruption caused by an upgrade. +// +// maxUnavailable controls the number of nodes that can be simultaneously +// unavailable. +// +// maxSurge controls the number of additional nodes that can be added to the +// node pool temporarily for the time of the upgrade to increase the number of +// available nodes. +// +// (maxUnavailable + maxSurge) determines the level of parallelism (how many +// nodes are being upgraded at the same time). +// +// Note: upgrades inevitably introduce some disruption since workloads need to +// be moved from old nodes to new, upgraded ones. Even if maxUnavailable=0, +// this holds true. (Disruption stays within the limits of +// PodDisruptionBudget, if it is configured.) +// +// Consider a hypothetical node pool with 5 nodes having maxSurge=2, +// maxUnavailable=1. This means the upgrade process upgrades 3 nodes +// simultaneously. It creates 2 additional (upgraded) nodes, then it brings +// down 3 old (not yet upgraded) nodes at the same time. This ensures that +// there are always at least 4 nodes available. +message NodePool { + // These upgrade settings configure the upgrade strategy for the node pool. + // Use strategy to switch between the strategies applied to the node pool. + // + // If the strategy is SURGE, use max_surge and max_unavailable to control + // the level of parallelism and the level of disruption caused by upgrade. + // 1. maxSurge controls the number of additional nodes that can be added to + // the node pool temporarily for the time of the upgrade to increase the + // number of available nodes. + // 2. maxUnavailable controls the number of nodes that can be simultaneously + // unavailable. + // 3. (maxUnavailable + maxSurge) determines the level of parallelism (how + // many nodes are being upgraded at the same time). + // + // If the strategy is BLUE_GREEN, use blue_green_settings to configure the + // blue-green upgrade related settings. + // 1. standard_rollout_policy is the default policy. The policy is used to + // control the way blue pool gets drained. The draining is executed in the + // batch mode. The batch size could be specified as either percentage of the + // node pool size or the number of nodes. batch_soak_duration is the soak + // time after each batch gets drained. + // 2. node_pool_soak_duration is the soak time after all blue nodes are + // drained. After this period, the blue pool nodes will be deleted. + message UpgradeSettings { + // The maximum number of nodes that can be created beyond the current size + // of the node pool during the upgrade process. + int32 max_surge = 1; + + // The maximum number of nodes that can be simultaneously unavailable during + // the upgrade process. A node is considered available if its status is + // Ready. + int32 max_unavailable = 2; + + // Update strategy of the node pool. + optional NodePoolUpdateStrategy strategy = 3; + + // Settings for blue-green upgrade strategy. + optional BlueGreenSettings blue_green_settings = 4; + } + + // UpdateInfo contains resource (instance groups, etc), status and other + // intermediate information relevant to a node pool upgrade. + message UpdateInfo { + // Information relevant to blue-green upgrade. + message BlueGreenInfo { + // Phase represents the different stages blue-green upgrade is running in. + enum Phase { + // Unspecified phase. + PHASE_UNSPECIFIED = 0; + + // blue-green upgrade has been initiated. + UPDATE_STARTED = 1; + + // Start creating green pool nodes. + CREATING_GREEN_POOL = 2; + + // Start cordoning blue pool nodes. + CORDONING_BLUE_POOL = 3; + + // Start draining blue pool nodes. + DRAINING_BLUE_POOL = 4; + + // Start soaking time after draining entire blue pool. + NODE_POOL_SOAKING = 5; + + // Start deleting blue nodes. + DELETING_BLUE_POOL = 6; + + // Rollback has been initiated. + ROLLBACK_STARTED = 7; + } + + // Current blue-green upgrade phase. + Phase phase = 1; + + // The resource URLs of the [managed instance groups] + // (/compute/docs/instance-groups/creating-groups-of-managed-instances) + // associated with blue pool. + repeated string blue_instance_group_urls = 2; + + // The resource URLs of the [managed instance groups] + // (/compute/docs/instance-groups/creating-groups-of-managed-instances) + // associated with green pool. + repeated string green_instance_group_urls = 3; + + // Time to start deleting blue pool to complete blue-green upgrade, + // in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + string blue_pool_deletion_start_time = 4; + + // Version of green pool. + string green_pool_version = 5; + } + + // Information of a blue-green upgrade. + BlueGreenInfo blue_green_info = 1; + } + + // The current status of the node pool instance. + enum Status { + // Not set. + STATUS_UNSPECIFIED = 0; + + // The PROVISIONING state indicates the node pool is being created. + PROVISIONING = 1; + + // The RUNNING state indicates the node pool has been created + // and is fully usable. + RUNNING = 2; + + // 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. + RUNNING_WITH_ERROR = 3; + + // 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. + RECONCILING = 4; + + // The STOPPING state indicates the node pool is being deleted. + STOPPING = 5; + + // The ERROR state indicates the node pool may be unusable. Details + // can be found in the `statusMessage` field. + ERROR = 6; + } + + // PlacementPolicy defines the placement policy used by the node pool. + message PlacementPolicy { + // Type defines the type of placement policy. + enum Type { + // TYPE_UNSPECIFIED specifies no requirements on nodes + // placement. + TYPE_UNSPECIFIED = 0; + + // COMPACT specifies node placement in the same availability domain to + // ensure low communication latency. + COMPACT = 1; + } + + // The type of placement. + Type type = 1; + + // TPU placement topology for pod slice node pool. + // https://cloud.google.com/tpu/docs/types-topologies#tpu_topologies + string tpu_topology = 2; + } + + // The name of the node pool. + string name = 1; + + // The node configuration of the pool. + NodeConfig config = 2; + + // The initial node count for the pool. You must ensure that your + // 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; + + // The list of Google Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) in which the + // NodePool's nodes should be located. + // + // If this value is unspecified during node pool creation, the + // [Cluster.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters#Cluster.FIELDS.locations) + // value will be used, instead. + // + // Warning: changing node pool locations will result in nodes being added + // and/or removed. + repeated string locations = 13; + + // Networking configuration for this NodePool. If specified, it overrides the + // cluster-level defaults. + NodeNetworkConfig network_config = 14; + + // [Output only] Server-defined URL for the resource. + string self_link = 100; + + // The version of Kubernetes running on this NodePool's nodes. If unspecified, + // it defaults as described + // [here](https://cloud.google.com/kubernetes-engine/versioning#specifying_node_version). + string version = 101; + + // [Output only] The resource URLs of the [managed instance + // groups](https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-managed-instances) + // associated with this node pool. + // During the node pool blue-green upgrade operation, the URLs contain both + // blue and green resources. + repeated string instance_group_urls = 102; + + // [Output only] The status of the nodes in this pool instance. + Status status = 103; + + // [Output only] Deprecated. Use conditions instead. + // Additional information about the current status of this + // node pool instance, if available. + string status_message = 104 [deprecated = true]; + + // Autoscaler configuration for this NodePool. Autoscaler is enabled + // only if a valid configuration is present. + NodePoolAutoscaling autoscaling = 4; + + // NodeManagement configuration for this NodePool. + NodeManagement management = 5; + + // The constraint on the maximum number of pods that can be run + // simultaneously on a node in the node pool. + MaxPodsConstraint max_pods_constraint = 6; + + // Which conditions caused the current node pool state. + repeated StatusCondition conditions = 105; + + // [Output only] The pod CIDR block size per node in this node pool. + int32 pod_ipv4_cidr_size = 7; + + // Upgrade settings control disruption and speed of the upgrade. + UpgradeSettings upgrade_settings = 107; + + // Specifies the node placement policy. + PlacementPolicy placement_policy = 108; + + // Output only. [Output only] Update info contains relevant information during + // a node pool update. + UpdateInfo update_info = 109 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // This checksum is computed by the server based on the value of node pool + // fields, and may be sent on update requests to ensure the client has an + // up-to-date value before proceeding. + string etag = 110; + + // Enable best effort provisioning for nodes + BestEffortProvisioning best_effort_provisioning = 113; +} + +// NodeManagement defines the set of node management services turned on for the +// node pool. +message NodeManagement { + // Whether the nodes will be automatically upgraded. + bool auto_upgrade = 1; + + // Whether the nodes will be automatically repaired. + bool auto_repair = 2; + + // Specifies the Auto Upgrade knobs for the node pool. + AutoUpgradeOptions upgrade_options = 10; +} + +// AutoUpgradeOptions defines the set of options for the user to control how +// the Auto Upgrades will proceed. +message AutoUpgradeOptions { + // [Output only] This field is set when upgrades are about to commence + // with the approximate start time for the upgrades, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + string auto_upgrade_start_time = 1; + + // [Output only] This field is set when upgrades are about to commence + // with the description of the upgrade. + string description = 2; +} + +// MaintenancePolicy defines the maintenance policy to be used for the cluster. +message MaintenancePolicy { + // Specifies the maintenance window in which maintenance may be performed. + MaintenanceWindow window = 1; + + // 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. + string resource_version = 3; +} + +// MaintenanceWindow defines the maintenance window to be used for the cluster. +message MaintenanceWindow { + // Unimplemented, reserved for future use. + // HourlyMaintenanceWindow hourly_maintenance_window = 1; + oneof policy { + // DailyMaintenanceWindow specifies a daily maintenance operation window. + DailyMaintenanceWindow daily_maintenance_window = 2; + + // 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. + RecurringTimeWindow recurring_window = 3; + } + + // Exceptions to maintenance window. Non-emergency maintenance should not + // occur in these windows. + map maintenance_exclusions = 4; +} + +// Represents an arbitrary window of time. +message TimeWindow { + oneof options { + // MaintenanceExclusionOptions provides maintenance exclusion related + // options. + MaintenanceExclusionOptions maintenance_exclusion_options = 3; + } + + // The time that the window first starts. + google.protobuf.Timestamp start_time = 1; + + // The time that the window ends. The end time should take place after the + // start time. + google.protobuf.Timestamp end_time = 2; +} + +// Represents the Maintenance exclusion option. +message MaintenanceExclusionOptions { + // Scope of exclusion. + enum Scope { + // NO_UPGRADES excludes all upgrades, including patch upgrades and minor + // upgrades across control planes and nodes. This is the default exclusion + // behavior. + NO_UPGRADES = 0; + + // NO_MINOR_UPGRADES excludes all minor upgrades for the cluster, only + // patches are allowed. + NO_MINOR_UPGRADES = 1; + + // NO_MINOR_OR_NODE_UPGRADES excludes all minor upgrades for the cluster, + // and also exclude all node pool upgrades. Only control + // plane patches are allowed. + NO_MINOR_OR_NODE_UPGRADES = 2; + } + + // Scope specifies the upgrade scope which upgrades are blocked by the + // exclusion. + Scope scope = 1; +} + +// Represents an arbitrary window of time that recurs. +message RecurringTimeWindow { + // The window of the first recurrence. + TimeWindow window = 1; + + // 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. + string recurrence = 2; +} + +// Time window specified for daily maintenance operations. +message DailyMaintenanceWindow { + // Time within the maintenance window to start the maintenance operations. + // It must be in format "HH:MM", where HH : [00-23] and MM : [00-59] GMT. + string start_time = 2; + + // [Output only] Duration of the time window, automatically chosen to be + // smallest possible in the given scenario. + string duration = 3; +} + +// SetNodePoolManagementRequest sets the node management properties of a node +// pool. +message SetNodePoolManagementRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to update. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the node pool to update. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. NodeManagement configuration for the node pool. + NodeManagement management = 5 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster, node pool id) of the node pool to set + // management properties. Specified in the format + // `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 7; +} + +// SetNodePoolSizeRequest sets the size of a node pool. +message SetNodePoolSizeRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to update. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the node pool to update. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. The desired node count for the pool. + int32 node_count = 5 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster, node pool id) of the node pool to set + // size. + // Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 7; +} + +// CompleteNodePoolUpgradeRequest sets the name of target node pool to complete +// upgrade. +message CompleteNodePoolUpgradeRequest { + // The name (project, location, cluster, node pool id) of the node pool to + // complete upgrade. + // Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 1; +} + +// RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed +// NodePool upgrade. This will be an no-op if the last upgrade successfully +// completed. +message RollbackNodePoolUpgradeRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to rollback. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the node pool to rollback. + // This field has been deprecated and replaced by the name field. + string node_pool_id = 4 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster, node pool id) of the node poll to + // rollback upgrade. + // Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. + string name = 6; + + // Option for rollback to ignore the PodDisruptionBudget. + // Default value is false. + bool respect_pdb = 7; +} + +// ListNodePoolsResponse is the result of ListNodePoolsRequest. +message ListNodePoolsResponse { + // A list of node pools for a cluster. + repeated NodePool node_pools = 1; +} + +// 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. +message ClusterAutoscaling { + // Defines possible options for autoscaling_profile field. + enum AutoscalingProfile { + // No change to autoscaling configuration. + PROFILE_UNSPECIFIED = 0; + + // Prioritize optimizing utilization of resources. + OPTIMIZE_UTILIZATION = 1; + + // Use default (balanced) autoscaling configuration. + BALANCED = 2; + } + + // Enables automatic node pool creation and deletion. + bool enable_node_autoprovisioning = 1; + + // Contains global constraints regarding minimum and maximum + // amount of resources in the cluster. + repeated ResourceLimit resource_limits = 2; + + // Defines autoscaling behaviour. + AutoscalingProfile autoscaling_profile = 3; + + // AutoprovisioningNodePoolDefaults contains defaults for a node pool + // created by NAP. + AutoprovisioningNodePoolDefaults autoprovisioning_node_pool_defaults = 4; + + // The list of Google Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) in which the + // NodePool's nodes can be created by NAP. + repeated string autoprovisioning_locations = 5; +} + +// AutoprovisioningNodePoolDefaults contains defaults for a node pool created +// by NAP. +message AutoprovisioningNodePoolDefaults { + // 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](https://cloud.google.com/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. + repeated string oauth_scopes = 1; + + // The Google Cloud Platform Service Account to be used by the node VMs. + // Specify the email address of the Service Account; otherwise, if no Service + // Account is specified, the "default" service account is used. + string service_account = 2; + + // Upgrade settings control disruption and speed of the upgrade. + NodePool.UpgradeSettings upgrade_settings = 3; + + // NodeManagement configuration for this NodePool. + NodeManagement management = 4; + + // Deprecated. Minimum CPU platform to be used for NAP created node pools. + // 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](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform). + // This field is deprecated, min_cpu_platform should be specified using + // `cloud.google.com/requested-min-cpu-platform` label selector on the pod. + // To unset the min cpu platform field pass "automatic" + // as field value. + string min_cpu_platform = 5 [deprecated = true]; + + // 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. + int32 disk_size_gb = 6; + + // Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or + // 'pd-balanced') + // + // If unspecified, the default disk type is 'pd-standard' + string disk_type = 7; + + // Shielded Instance options. + ShieldedInstanceConfig shielded_instance_config = 8; + + // + // The Customer Managed Encryption Key used to encrypt the boot disk attached + // to each node in the node pool. This should be of the form + // projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. + // For more information about protecting resources with Cloud KMS Keys please + // see: + // https://cloud.google.com/compute/docs/disks/customer-managed-encryption + string boot_disk_kms_key = 9; + + // The image type to use for NAP created node. Please see + // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for + // available image types. + string image_type = 10; + + // Enable or disable Kubelet read only port. + optional bool insecure_kubelet_readonly_port_enabled = 13; +} + +// Contains information about amount of some resource in the cluster. +// For memory, value should be in GB. +message ResourceLimit { + // Resource name "cpu", "memory" or gpu-specific string. + string resource_type = 1; + + // Minimum amount of the resource in the cluster. + int64 minimum = 2; + + // Maximum amount of the resource in the cluster. + int64 maximum = 3; +} + +// NodePoolAutoscaling contains information required by cluster autoscaler to +// adjust the size of the node pool to the current cluster usage. +message NodePoolAutoscaling { + // Location policy specifies how zones are picked when scaling up the + // nodepool. + enum LocationPolicy { + // Not set. + LOCATION_POLICY_UNSPECIFIED = 0; + + // BALANCED is a best effort policy that aims to balance the sizes of + // different zones. + BALANCED = 1; + + // ANY policy picks zones that have the highest capacity available. + ANY = 2; + } + + // Is autoscaling enabled for this node pool. + bool enabled = 1; + + // Minimum number of nodes for one location in the NodePool. Must be >= 1 and + // <= max_node_count. + int32 min_node_count = 2; + + // Maximum number of nodes for one location in the NodePool. Must be >= + // min_node_count. There has to be enough quota to scale up the cluster. + int32 max_node_count = 3; + + // Can this node pool be deleted automatically. + bool autoprovisioned = 4; + + // Location policy used when scaling up a nodepool. + LocationPolicy location_policy = 5; + + // Minimum number of nodes in the node pool. Must be greater than 1 less than + // total_max_node_count. + // The total_*_node_count fields are mutually exclusive with the *_node_count + // fields. + int32 total_min_node_count = 6; + + // Maximum number of nodes in the node pool. Must be greater than + // total_min_node_count. There has to be enough quota to scale up the cluster. + // The total_*_node_count fields are mutually exclusive with the *_node_count + // fields. + int32 total_max_node_count = 7; +} + +// 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 +message SetLabelsRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. The labels to set for that cluster. + map resource_labels = 4 + [(google.api.field_behavior) = REQUIRED]; + + // 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. + string label_fingerprint = 5 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster name) of the cluster to set labels. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 7; +} + +// SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for +// a cluster. +message SetLegacyAbacRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster to update. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Whether ABAC authorization will be enabled in the cluster. + bool enabled = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster name) of the cluster to set legacy + // abac. Specified in the format `projects/*/locations/*/clusters/*`. + string name = 6; +} + +// StartIPRotationRequest creates a new IP for the cluster and then performs +// a node upgrade on each node pool to point to the new IP. +message StartIPRotationRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster name) of the cluster to start IP + // rotation. Specified in the format `projects/*/locations/*/clusters/*`. + string name = 6; + + // Whether to rotate credentials during IP rotation. + bool rotate_credentials = 7; +} + +// CompleteIPRotationRequest moves the cluster master back into single-IP mode. +message CompleteIPRotationRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster name) of the cluster to complete IP + // rotation. Specified in the format `projects/*/locations/*/clusters/*`. + string name = 7; +} + +// AcceleratorConfig represents a Hardware Accelerator request. +message AcceleratorConfig { + // The number of the accelerator cards exposed to an instance. + int64 accelerator_count = 1; + + // The accelerator type resource name. List of supported accelerators + // [here](https://cloud.google.com/compute/docs/gpus) + string accelerator_type = 2; + + // Size of partitions to create on the GPU. Valid values are described in the + // NVIDIA [mig user + // guide](https://docs.nvidia.com/datacenter/tesla/mig-user-guide/#partitioning). + string gpu_partition_size = 3; + + // The number of time-shared GPU resources to expose for each physical GPU. + int64 max_time_shared_clients_per_gpu = 4 [deprecated = true]; + + // The configuration for GPU sharing options. + optional GPUSharingConfig gpu_sharing_config = 5; + + // The configuration for auto installation of GPU driver. + optional GPUDriverInstallationConfig gpu_driver_installation_config = 6; +} + +// GPUSharingConfig represents the GPU sharing configuration for Hardware +// Accelerators. +message GPUSharingConfig { + // The type of GPU sharing strategy currently provided. + enum GPUSharingStrategy { + // Default value. + GPU_SHARING_STRATEGY_UNSPECIFIED = 0; + + // GPUs are time-shared between containers. + TIME_SHARING = 1; + } + + // The max number of containers that can share a physical GPU. + int64 max_shared_clients_per_gpu = 1; + + // The type of GPU sharing strategy to enable on the GPU node. + optional GPUSharingStrategy gpu_sharing_strategy = 2; +} + +// GPUDriverInstallationConfig specifies the version of GPU driver to be auto +// installed. +message GPUDriverInstallationConfig { + // The GPU driver version to install. + enum GPUDriverVersion { + // Default value is to not install any GPU driver. + GPU_DRIVER_VERSION_UNSPECIFIED = 0; + + // Disable GPU driver auto installation and needs manual installation + INSTALLATION_DISABLED = 1; + + // "Default" GPU driver in COS and Ubuntu. + DEFAULT = 2; + + // "Latest" GPU driver in COS. + LATEST = 3; + } + + // Mode for how the GPU driver is installed. + optional GPUDriverVersion gpu_driver_version = 1; +} + +// ManagedPrometheusConfig defines the configuration for +// Google Cloud Managed Service for Prometheus. +message ManagedPrometheusConfig { + // Enable Managed Collection. + bool enabled = 1; +} + +// WorkloadMetadataConfig defines the metadata configuration to expose to +// workloads on the node pool. +message WorkloadMetadataConfig { + // NodeMetadata is the configuration for if and how to expose the node + // metadata to the workload running on the node. + enum NodeMetadata { + // Not set. + UNSPECIFIED = 0; + + // Prevent workloads not in hostNetwork from accessing certain VM metadata, + // specifically kube-env, which contains Kubelet credentials, and the + // instance identity token. + // + // Metadata concealment is a temporary security solution available while the + // bootstrapping process for cluster nodes is being redesigned with + // significant security improvements. This feature is scheduled to be + // deprecated in the future and later removed. + SECURE = 1; + + // Expose all VM metadata to pods. + EXPOSE = 2; + + // Run the GKE Metadata Server on this node. The GKE Metadata Server exposes + // a metadata API to workloads that is compatible with the V1 Compute + // Metadata APIs exposed by the Compute Engine and App Engine Metadata + // Servers. This feature can only be enabled if Workload Identity is enabled + // at the cluster level. + GKE_METADATA_SERVER = 3; + } + + // Mode is the configuration for how to expose metadata to workloads running + // on the node. + enum Mode { + // Not set. + MODE_UNSPECIFIED = 0; + + // Expose all Compute Engine metadata to pods. + GCE_METADATA = 1; + + // Run the GKE Metadata Server on this node. The GKE Metadata Server exposes + // a metadata API to workloads that is compatible with the V1 Compute + // Metadata APIs exposed by the Compute Engine and App Engine Metadata + // Servers. This feature can only be enabled if Workload Identity is enabled + // at the cluster level. + GKE_METADATA = 2; + } + + // NodeMetadata is the configuration for how to expose metadata to the + // workloads running on the node. + NodeMetadata node_metadata = 1 [deprecated = true]; + + // Mode is the configuration for how to expose metadata to workloads running + // on the node pool. + Mode mode = 2; +} + +// SetNetworkPolicyRequest enables/disables network policy for a cluster. +message SetNetworkPolicyRequest { + // Required. Deprecated. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + // This field has been deprecated and replaced by the name field. + string project_id = 1 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. This field has been deprecated and replaced by the name + // field. + string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Deprecated. The name of the cluster. + // This field has been deprecated and replaced by the name field. + string cluster_id = 3 + [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // Required. Configuration options for the NetworkPolicy feature. + NetworkPolicy network_policy = 4 [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster name) of the cluster to set networking + // policy. Specified in the format `projects/*/locations/*/clusters/*`. + string name = 6; +} + +// SetMaintenancePolicyRequest sets the maintenance policy for a cluster. +message SetMaintenancePolicyRequest { + // Required. The Google Developers Console [project ID or project + // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the Google Compute Engine + // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + // cluster resides. + string zone = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the cluster to update. + string cluster_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The maintenance policy to be set for the cluster. An empty field + // clears the existing maintenance policy. + MaintenancePolicy maintenance_policy = 4 + [(google.api.field_behavior) = REQUIRED]; + + // The name (project, location, cluster name) of the cluster to set + // maintenance policy. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 5; +} + +// ListLocationsRequest is used to request the locations that offer GKE. +message ListLocationsRequest { + // Required. Contains the name of the resource requested. + // Specified in the format `projects/*`. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// ListLocationsResponse returns the list of all GKE locations and their +// recommendation state. +message ListLocationsResponse { + // A full list of GKE locations. + repeated Location locations = 1; + + // Only return ListLocationsResponse that occur after the page_token. This + // value should be populated from the ListLocationsResponse.next_page_token if + // that response token was set (which happens when listing more Locations than + // fit in a single ListLocationsResponse). + string next_page_token = 2; +} + +// Location returns the location name, and if the location is recommended +// for GKE cluster scheduling. +message Location { + // LocationType is the type of GKE location, regional or zonal. + enum LocationType { + // LOCATION_TYPE_UNSPECIFIED means the location type was not determined. + LOCATION_TYPE_UNSPECIFIED = 0; + + // A GKE Location where Zonal clusters can be created. + ZONE = 1; + + // A GKE Location where Regional clusters can be created. + REGION = 2; + } + + // Contains the type of location this Location is for. + // Regional or Zonal. + LocationType type = 1; + + // Contains the name of the resource requested. + // Specified in the format `projects/*/locations/*`. + string name = 2; + + // Whether the location is recommended for GKE cluster scheduling. + bool recommended = 3; +} + +// StatusCondition describes why a cluster or a node pool has a certain status +// (e.g., ERROR or DEGRADED). +message StatusCondition { + // Code for each condition + enum Code { + option deprecated = true; + + // UNKNOWN indicates a generic condition. + UNKNOWN = 0; + + // GCE_STOCKOUT indicates that Google Compute Engine resources are + // temporarily unavailable. + GCE_STOCKOUT = 1; + + // GKE_SERVICE_ACCOUNT_DELETED indicates that the user deleted their robot + // service account. + GKE_SERVICE_ACCOUNT_DELETED = 2; + + // Google Compute Engine quota was exceeded. + GCE_QUOTA_EXCEEDED = 3; + + // Cluster state was manually changed by an SRE due to a system logic error. + SET_BY_OPERATOR = 4; + + // Unable to perform an encrypt operation against the CloudKMS key used for + // etcd level encryption. + CLOUD_KMS_KEY_ERROR = 7; + + // Cluster CA is expiring soon. + // More codes TBA + CA_EXPIRING = 9; + } + + // Machine-friendly representation of the condition + // Deprecated. Use canonical_code instead. + Code code = 1 [deprecated = true]; + + // Human-friendly representation of the condition + string message = 2; + + // Canonical code of the condition. + google.rpc.Code canonical_code = 3; +} + +// NetworkConfig reports the relative names of network & subnetwork. +message NetworkConfig { + // Configuration of all network bandwidth tiers + message ClusterNetworkPerformanceConfig { + // Node network tier + enum Tier { + // Default value + TIER_UNSPECIFIED = 0; + + // Higher bandwidth, actual values based on VM size. + TIER_1 = 1; + } + + // Specifies the total network bandwidth tier for the NodePool. + optional Tier total_egress_bandwidth_tier = 1; + } + + // Output only. The relative name of the Google Compute Engine + // [network][google.container.v1beta1.NetworkConfig.network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) + // to which the cluster is connected. Example: + // projects/my-project/global/networks/my-network + string network = 1; + + // Output only. The relative name of the Google Compute Engine + // [subnetwork](https://cloud.google.com/compute/docs/vpc) to which the + // cluster is connected. Example: + // projects/my-project/regions/us-central1/subnetworks/my-subnet + string subnetwork = 2; + + // Whether Intra-node visibility is enabled for this cluster. + // This makes same node pod to pod traffic visible for VPC network. + bool enable_intra_node_visibility = 5; + + // Whether the cluster disables default in-node sNAT rules. In-node sNAT rules + // will be disabled when default_snat_status is disabled. When disabled is set + // to false, default IP masquerade rules will be applied to the nodes to + // prevent sNAT on cluster internal traffic. + DefaultSnatStatus default_snat_status = 7; + + // Whether L4ILB Subsetting is enabled for this cluster. + bool enable_l4ilb_subsetting = 10; + + // The desired datapath provider for this cluster. By default, uses the + // IPTables-based kube-proxy implementation. + DatapathProvider datapath_provider = 11; + + // The desired state of IPv6 connectivity to Google Services. + // By default, no private IPv6 access to or from Google Services (all access + // will be via IPv4) + PrivateIPv6GoogleAccess private_ipv6_google_access = 12; + + // DNSConfig contains clusterDNS config for this cluster. + DNSConfig dns_config = 13; + + // ServiceExternalIPsConfig specifies if services with externalIPs field are + // blocked or not. + ServiceExternalIPsConfig service_external_ips_config = 15; + + // GatewayAPIConfig contains the desired config of Gateway API on this + // cluster. + GatewayAPIConfig gateway_api_config = 16; + + // Network bandwidth tier configuration. + ClusterNetworkPerformanceConfig network_performance_config = 18; + + // Whether FQDN Network Policy is enabled on this cluster. + optional bool enable_fqdn_network_policy = 19; +} + +// GatewayAPIConfig contains the desired config of Gateway API on this cluster. +message GatewayAPIConfig { + // Channel describes if/how Gateway API should be installed and implemented in + // a cluster. + enum Channel { + // Default value. + CHANNEL_UNSPECIFIED = 0; + + // Gateway API support is disabled + CHANNEL_DISABLED = 1; + + // Gateway API support is enabled, experimental CRDs are installed + CHANNEL_EXPERIMENTAL = 3; + + // Gateway API support is enabled, standard CRDs are installed + CHANNEL_STANDARD = 4; + } + + // The Gateway API release channel to use for Gateway API. + Channel channel = 1; +} + +// Config to block services with externalIPs field. +message ServiceExternalIPsConfig { + // Whether Services with ExternalIPs field are allowed or not. + bool enabled = 1; +} + +// ListUsableSubnetworksRequest requests the list of usable subnetworks. +// available to a user for creating clusters. +message ListUsableSubnetworksRequest { + // Required. The parent project where subnetworks are usable. + // Specified in the format `projects/*`. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // 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. + string filter = 2; + + // 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) + int32 page_size = 3; + + // Specifies a page token to use. Set this to the nextPageToken returned by + // previous list requests to get the next page of results. + string page_token = 4; +} + +// ListUsableSubnetworksResponse is the response of +// ListUsableSubnetworksRequest. +message ListUsableSubnetworksResponse { + // A list of usable subnetworks in the specified network project. + repeated UsableSubnetwork subnetworks = 1; + + // 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. + string next_page_token = 2; +} + +// Secondary IP range of a usable subnetwork. +message UsableSubnetworkSecondaryRange { + // Status shows the current usage of a secondary IP range. + enum Status { + // UNKNOWN is the zero value of the Status enum. It's not a valid status. + UNKNOWN = 0; + + // UNUSED denotes that this range is unclaimed by any cluster. + UNUSED = 1; + + // IN_USE_SERVICE denotes that this range is claimed by a cluster for + // services. It cannot be used for other clusters. + IN_USE_SERVICE = 2; + + // 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_SHAREABLE_POD = 3; + + // IN_USE_MANAGED_POD denotes this range was created by GKE and is claimed + // for pods. It cannot be used for other clusters. + IN_USE_MANAGED_POD = 4; + } + + // The name associated with this subnetwork secondary range, used when adding + // an alias IP range to a VM instance. + string range_name = 1; + + // The range of IP addresses belonging to this subnetwork secondary range. + string ip_cidr_range = 2; + + // This field is to determine the status of the secondary range programmably. + Status status = 3; +} + +// UsableSubnetwork resource returns the subnetwork name, its associated network +// and the primary CIDR range. +message UsableSubnetwork { + // Subnetwork Name. + // Example: projects/my-project/regions/us-central1/subnetworks/my-subnet + string subnetwork = 1; + + // Network Name. + // Example: projects/my-project/global/networks/my-network + string network = 2; + + // The range of internal addresses that are owned by this subnetwork. + string ip_cidr_range = 3; + + // Secondary IP ranges. + repeated UsableSubnetworkSecondaryRange secondary_ip_ranges = 4; + + // 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. + string status_message = 5; +} + +// VerticalPodAutoscaling contains global, per-cluster information +// required by Vertical Pod Autoscaler to automatically adjust +// the resources of pods controlled by it. +message VerticalPodAutoscaling { + // Enables vertical pod autoscaling. + bool enabled = 1; +} + +// DefaultSnatStatus contains the desired state of whether default sNAT should +// be disabled on the cluster. +message DefaultSnatStatus { + // Disables cluster default sNAT rules. + bool disabled = 1; +} + +// IntraNodeVisibilityConfig contains the desired config of the intra-node +// visibility on this cluster. +message IntraNodeVisibilityConfig { + // Enables intra node visibility for this cluster. + bool enabled = 1; +} + +// ILBSubsettingConfig contains the desired config of L4 Internal LoadBalancer +// subsetting on this cluster. +message ILBSubsettingConfig { + // Enables l4 ILB subsetting for this cluster + bool enabled = 1; +} + +// DNSConfig contains the desired set of options for configuring clusterDNS. +message DNSConfig { + // Provider lists the various in-cluster DNS providers. + enum Provider { + // Default value + PROVIDER_UNSPECIFIED = 0; + + // Use GKE default DNS provider(kube-dns) for DNS resolution. + PLATFORM_DEFAULT = 1; + + // Use CloudDNS for DNS resolution. + CLOUD_DNS = 2; + + // Use KubeDNS for DNS resolution. + KUBE_DNS = 3; + } + + // DNSScope lists the various scopes of access to cluster DNS records. + enum DNSScope { + // Default value, will be inferred as cluster scope. + DNS_SCOPE_UNSPECIFIED = 0; + + // DNS records are accessible from within the cluster. + CLUSTER_SCOPE = 1; + + // DNS records are accessible from within the VPC. + VPC_SCOPE = 2; + } + + // cluster_dns indicates which in-cluster DNS provider should be used. + Provider cluster_dns = 1; + + // cluster_dns_scope indicates the scope of access to cluster DNS records. + DNSScope cluster_dns_scope = 2; + + // cluster_dns_domain is the suffix used for all cluster service records. + string cluster_dns_domain = 3; +} + +// Constraints applied to pods. +message MaxPodsConstraint { + // Constraint enforced on the max num of pods per node. + int64 max_pods_per_node = 1; +} + +// Configuration for the use of Kubernetes Service Accounts in GCP IAM +// policies. +message WorkloadIdentityConfig { + // IAM Identity Namespace to attach all Kubernetes Service Accounts to. + string identity_namespace = 1 [deprecated = true]; + + // The workload pool to attach all Kubernetes service accounts to. + string workload_pool = 2; + + // identity provider is the third party identity provider. + string identity_provider = 3; +} + +// Configuration for direct-path (via ALTS) with workload identity. +message WorkloadALTSConfig { + // enable_alts controls whether the alts handshaker should be enabled or not + // for direct-path. + // + // Requires Workload Identity + // ([workload_pool][google.container.v1beta1.WorkloadIdentityConfig.workload_pool] + // must be non-empty). + google.protobuf.BoolValue enable_alts = 1; +} + +// Configuration for issuance of mTLS keys and certificates to Kubernetes pods. +message WorkloadCertificates { + // enable_certificates controls issuance of workload mTLS certificates. + // + // If set, the GKE Workload Identity Certificates controller and node agent + // will be deployed in the cluster, which can then be configured by creating a + // WorkloadCertificateConfig Custom Resource. + // + // Requires Workload Identity + // ([workload_pool][google.container.v1beta1.WorkloadIdentityConfig.workload_pool] + // must be non-empty). + google.protobuf.BoolValue enable_certificates = 1; +} + +// Configuration for issuance of mTLS keys and certificates to Kubernetes pods. +message MeshCertificates { + // enable_certificates controls issuance of workload mTLS certificates. + // + // If set, the GKE Workload Identity Certificates controller and node agent + // will be deployed in the cluster, which can then be configured by creating a + // WorkloadCertificateConfig Custom Resource. + // + // Requires Workload Identity + // ([workload_pool][google.container.v1alpha1.WorkloadIdentityConfig.workload_pool] + // must be non-empty). + google.protobuf.BoolValue enable_certificates = 1; +} + +// Configuration of etcd encryption. +message DatabaseEncryption { + // State of etcd encryption. + enum State { + // Should never be set + UNKNOWN = 0; + + // Secrets in etcd are encrypted. + ENCRYPTED = 1; + + // Secrets in etcd are stored in plain text (at etcd level) - this is + // unrelated to Compute Engine level full disk encryption. + DECRYPTED = 2; + } + + // 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 + string key_name = 1; + + // The desired state of etcd encryption. + State state = 2; +} + +// Configuration for exporting cluster resource usages. +message ResourceUsageExportConfig { + // Parameters for using BigQuery as the destination of resource usage export. + message BigQueryDestination { + // The ID of a BigQuery Dataset. + string dataset_id = 1; + } + + // Parameters for controlling consumption metering. + message ConsumptionMeteringConfig { + // Whether to enable consumption metering for this cluster. If enabled, a + // second BigQuery table will be created to hold resource consumption + // records. + bool enabled = 1; + } + + // Configuration to use BigQuery as usage export destination. + BigQueryDestination bigquery_destination = 1; + + // Whether to enable network egress metering for this cluster. If enabled, a + // daemonset will be created in the cluster to meter network egress traffic. + bool enable_network_egress_metering = 2; + + // Configuration to enable resource consumption metering. + ConsumptionMeteringConfig consumption_metering_config = 3; +} + +// Configuration of Shielded Nodes feature. +message ShieldedNodes { + // Whether Shielded Nodes features are enabled on all nodes in this cluster. + bool enabled = 1; +} + +// Configuration of gVNIC feature. +message VirtualNIC { + // Whether gVNIC features are enabled in the node pool. + bool enabled = 1; +} + +// Configuration of Fast Socket feature. +message FastSocket { + // Whether Fast Socket features are enabled in the node pool. + bool enabled = 1; +} + +// GetOpenIDConfigRequest gets the OIDC discovery document for the +// cluster. See the OpenID Connect Discovery 1.0 specification for details. +message GetOpenIDConfigRequest { + // The cluster (project, location, cluster name) to get the discovery document + // for. Specified in the format `projects/*/locations/*/clusters/*`. + string parent = 1; +} + +// GetOpenIDConfigResponse is an OIDC discovery document for the cluster. +// See the OpenID Connect Discovery 1.0 specification for details. +message GetOpenIDConfigResponse { + // OIDC Issuer. + string issuer = 1; + + // JSON Web Key uri. + string jwks_uri = 2; + + // Supported response types. + repeated string response_types_supported = 3; + + // Supported subject types. + repeated string subject_types_supported = 4; + + // supported ID Token signing Algorithms. + repeated string id_token_signing_alg_values_supported = 5; + + // Supported claims. + repeated string claims_supported = 6; + + // Supported grant types. + repeated string grant_types = 7; +} + +// GetJSONWebKeysRequest gets the public component of the keys used by the +// cluster to sign token requests. This will be the jwks_uri for the discover +// document returned by getOpenIDConfig. See the OpenID Connect +// Discovery 1.0 specification for details. +message GetJSONWebKeysRequest { + // The cluster (project, location, cluster name) to get keys for. Specified in + // the format `projects/*/locations/*/clusters/*`. + string parent = 1; +} + +// Jwk is a JSON Web Key as specified in RFC 7517 +message Jwk { + // Key Type. + string kty = 1; + + // Algorithm. + string alg = 2; + + // Permitted uses for the public keys. + string use = 3; + + // Key ID. + string kid = 4; + + // Used for RSA keys. + string n = 5; + + // Used for RSA keys. + string e = 6; + + // Used for ECDSA keys. + string x = 7; + + // Used for ECDSA keys. + string y = 8; + + // Used for ECDSA keys. + string crv = 9; +} + +// GetJSONWebKeysResponse is a valid JSON Web Key Set as specififed in rfc 7517 +message GetJSONWebKeysResponse { + // The public component of the keys used by the cluster to sign token + // requests. + repeated Jwk keys = 1; +} + +// CheckAutopilotCompatibilityRequest requests getting the blockers for the +// given operation in the cluster. +message CheckAutopilotCompatibilityRequest { + // The name (project, location, cluster) of the cluster to retrieve. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 1; +} + +// AutopilotCompatibilityIssue contains information about a specific +// compatibility issue with Autopilot mode. +message AutopilotCompatibilityIssue { + // The type of the reported issue. + enum IssueType { + // Default value, should not be used. + UNSPECIFIED = 0; + + // Indicates that the issue is a known incompatibility between the + // cluster and Autopilot mode. + INCOMPATIBILITY = 1; + + // Indicates the issue is an incompatibility if customers take no further + // action to resolve. + ADDITIONAL_CONFIG_REQUIRED = 2; + + // Indicates the issue is not an incompatibility, but depending on the + // workloads business logic, there is a potential that they won't work on + // Autopilot. + PASSED_WITH_OPTIONAL_CONFIG = 3; + } + + // The last time when this issue was observed. + google.protobuf.Timestamp last_observation = 1; + + // The constraint type of the issue. + string constraint_type = 2; + + // The incompatibility type of this issue. + IssueType incompatibility_type = 3; + + // The name of the resources which are subject to this issue. + repeated string subjects = 4; + + // A URL to a public documnetation, which addresses resolving this issue. + string documentation_url = 5; + + // The description of the issue. + string description = 6; +} + +// CheckAutopilotCompatibilityResponse has a list of compatibility issues. +message CheckAutopilotCompatibilityResponse { + // The list of issues for the given operation. + repeated AutopilotCompatibilityIssue issues = 1; + + // The summary of the autopilot compatibility response. + string summary = 2; +} + +// ReleaseChannel indicates which release channel a cluster is +// subscribed to. Release channels are arranged in order of risk. +// +// When a cluster is subscribed to a release channel, Google maintains +// both the master version and the node version. Node auto-upgrade +// defaults to true and cannot be disabled. +message ReleaseChannel { + // Possible values for 'channel'. + enum Channel { + // No channel specified. + UNSPECIFIED = 0; + + // RAPID channel is offered on an early access basis for customers who want + // to test new releases. + // + // WARNING: Versions available in the RAPID Channel may be subject to + // unresolved issues with no known workaround and are not subject to any + // SLAs. + RAPID = 1; + + // Clusters subscribed to REGULAR receive versions that are considered GA + // quality. REGULAR is intended for production users who want to take + // advantage of new features. + REGULAR = 2; + + // Clusters subscribed to STABLE receive versions that are known to be + // stable and reliable in production. + STABLE = 3; + } + + // channel specifies which release channel the cluster is subscribed to. + Channel channel = 1; +} + +// Configuration for fine-grained cost management feature. +message CostManagementConfig { + // Whether the feature is enabled or not. + bool enabled = 1; +} + +// Configuration for Cloud TPU. +message TpuConfig { + // Whether Cloud TPU integration is enabled or not. + bool enabled = 1; + + // Whether to use service networking for Cloud TPU or not. + bool use_service_networking = 2; + + // IPv4 CIDR block reserved for Cloud TPU in the VPC. + string ipv4_cidr_block = 3; +} + +// PrivateIPv6GoogleAccess controls whether and how the pods can communicate +// with Google Services through gRPC over IPv6. +enum PrivateIPv6GoogleAccess { + // Default value. Same as DISABLED + PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0; + + // No private access to or from Google Services + PRIVATE_IPV6_GOOGLE_ACCESS_DISABLED = 1; + + // Enables private IPv6 access to Google Services from GKE + PRIVATE_IPV6_GOOGLE_ACCESS_TO_GOOGLE = 2; + + // Enables private IPv6 access to and from Google Services + PRIVATE_IPV6_GOOGLE_ACCESS_BIDIRECTIONAL = 3; +} + +// Master is the configuration for components on master. +message Master {} + +// Autopilot is the configuration for Autopilot settings on the cluster. +message Autopilot { + // Enable Autopilot + bool enabled = 1; + + // Workload policy configuration for Autopilot. + WorkloadPolicyConfig workload_policy_config = 2; +} + +// WorkloadPolicyConfig is the configuration of workload policy for autopilot +// clusters. +message WorkloadPolicyConfig { + // If true, workloads can use NET_ADMIN capability. + optional bool allow_net_admin = 1; +} + +// NotificationConfig is the configuration of notifications. +message NotificationConfig { + // Types of notifications currently supported. Can be used to filter what + // notifications are sent. + enum EventType { + // Not set, will be ignored. + EVENT_TYPE_UNSPECIFIED = 0; + + // Corresponds with UpgradeAvailableEvent. + UPGRADE_AVAILABLE_EVENT = 1; + + // Corresponds with UpgradeEvent. + UPGRADE_EVENT = 2; + + // Corresponds with SecurityBulletinEvent. + SECURITY_BULLETIN_EVENT = 3; + } + + // Pub/Sub specific notification config. + message PubSub { + // Enable notifications for Pub/Sub. + bool enabled = 1; + + // The desired Pub/Sub topic to which notifications will be + // sent by GKE. Format is `projects/{project}/topics/{topic}`. + string topic = 2 [ + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; + + // Allows filtering to one or more specific event types. If no filter is + // specified, or if a filter is specified with no event types, all event + // types will be sent + Filter filter = 3; + } + + // Allows filtering to one or more specific event types. If event types are + // present, those and only those event types will be transmitted to the + // cluster. Other types will be skipped. If no filter is specified, or no + // event types are present, all event types will be sent + message Filter { + // Event types to allowlist. + repeated EventType event_type = 1; + } + + // Notification config for Pub/Sub. + PubSub pubsub = 1; +} + +// ConfidentialNodes is configuration for the confidential nodes feature, which +// makes nodes run on confidential VMs. +message ConfidentialNodes { + // Whether Confidential Nodes feature is enabled. + bool enabled = 1; +} + +// UpgradeResourceType is the resource type that is upgrading. It is used +// in upgrade notifications. +enum UpgradeResourceType { + // Default value. This shouldn't be used. + UPGRADE_RESOURCE_TYPE_UNSPECIFIED = 0; + + // Master / control plane + MASTER = 1; + + // Node pool + NODE_POOL = 2; +} + +// UpgradeEvent is a notification sent to customers by the cluster server when +// a resource is upgrading. +message UpgradeEvent { + // The resource type that is upgrading. + UpgradeResourceType resource_type = 1; + + // The operation associated with this upgrade. + string operation = 2; + + // The time when the operation was started. + google.protobuf.Timestamp operation_start_time = 3; + + // The current version before the upgrade. + string current_version = 4; + + // The target version for the upgrade. + string target_version = 5; + + // Optional relative path to the resource. For example in node pool upgrades, + // the relative path of the node pool. + string resource = 6; +} + +// UpgradeAvailableEvent is a notification sent to customers when a new +// available version is released. +message UpgradeAvailableEvent { + // The release version available for upgrade. + string version = 1; + + // The resource type of the release version. + UpgradeResourceType resource_type = 2; + + // The release channel of the version. If empty, it means a non-channel + // release. + ReleaseChannel release_channel = 3; + + // Optional relative path to the resource. For example, the relative path of + // the node pool. + string resource = 4; + + // Windows node versions info. + WindowsVersions windows_versions = 5; +} + +// SecurityBulletinEvent is a notification sent to customers when a security +// bulletin has been posted that they are vulnerable to. +message SecurityBulletinEvent { + // The resource type (node/control plane) that has the vulnerability. Multiple + // notifications (1 notification per resource type) will be sent for a + // vulnerability that affects > 1 resource type. + string resource_type_affected = 1; + + // The ID of the bulletin corresponding to the vulnerability. + string bulletin_id = 2; + + // The CVEs associated with this bulletin. + repeated string cve_ids = 3; + + // The severity of this bulletin as it relates to GKE. + string severity = 4; + + // The URI link to the bulletin on the website for more information. + string bulletin_uri = 5; + + // A brief description of the bulletin. See the bulletin pointed to by the + // bulletin_uri field for an expanded description. + string brief_description = 6; + + // The GKE minor versions affected by this vulnerability. + repeated string affected_supported_minors = 7; + + // The GKE versions where this vulnerability is patched. + repeated string patched_versions = 8; + + // This represents a version selected from the patched_versions field that + // the cluster receiving this notification should most likely want to upgrade + // to based on its current version. Note that if this notification is being + // received by a given cluster, it means that this version is currently + // available as an upgrade target in that cluster's location. + string suggested_upgrade_target = 9; + + // If this field is specified, it means there are manual steps that the user + // must take to make their clusters safe. + bool manual_steps_required = 10; +} + +// IdentityServiceConfig is configuration for Identity Service which allows +// customers to use external identity providers with the K8S API +message IdentityServiceConfig { + // Whether to enable the Identity Service component + bool enabled = 1; +} + +// Strategy used for node pool update. +enum NodePoolUpdateStrategy { + // Default value if unset. GKE internally defaults the update strategy to + // SURGE for unspecified strategies. + NODE_POOL_UPDATE_STRATEGY_UNSPECIFIED = 0; + + // blue-green upgrade. + BLUE_GREEN = 2; + + // SURGE is the traditional way of upgrading a node pool. + // max_surge and max_unavailable determines the level of upgrade parallelism. + SURGE = 3; +} + +// LoggingConfig is cluster logging configuration. +message LoggingConfig { + // Logging components configuration + LoggingComponentConfig component_config = 1; +} + +// LoggingComponentConfig is cluster logging component configuration. +message LoggingComponentConfig { + // GKE components exposing logs + enum Component { + // Default value. This shouldn't be used. + COMPONENT_UNSPECIFIED = 0; + + // system components + SYSTEM_COMPONENTS = 1; + + // workloads + WORKLOADS = 2; + + // kube-apiserver + APISERVER = 3; + + // kube-scheduler + SCHEDULER = 4; + + // kube-controller-manager + CONTROLLER_MANAGER = 5; + } + + // Select components to collect logs. An empty set would disable all logging. + repeated Component enable_components = 1; +} + +// MonitoringConfig is cluster monitoring configuration. +message MonitoringConfig { + // Monitoring components configuration + MonitoringComponentConfig component_config = 1; + + // Enable Google Cloud Managed Service for Prometheus + // in the cluster. + ManagedPrometheusConfig managed_prometheus_config = 2; + + // Configuration of Advanced Datapath Observability features. + AdvancedDatapathObservabilityConfig advanced_datapath_observability_config = + 3; +} + +// AdvancedDatapathObservabilityConfig specifies configuration of observability +// features of advanced datapath. +message AdvancedDatapathObservabilityConfig { + // Supported Relay modes + enum RelayMode { + // Default value. This shouldn't be used. + RELAY_MODE_UNSPECIFIED = 0; + + // disabled + DISABLED = 1; + + // exposed via internal load balancer + INTERNAL_VPC_LB = 3; + + // exposed via external load balancer + EXTERNAL_LB = 4; + } + + // Expose flow metrics on nodes + bool enable_metrics = 1; + + // Method used to make Relay available + RelayMode relay_mode = 2; +} + +// NodePoolLoggingConfig specifies logging configuration for nodepools. +message NodePoolLoggingConfig { + // Logging variant configuration. + LoggingVariantConfig variant_config = 1; +} + +// LoggingVariantConfig specifies the behaviour of the logging component. +message LoggingVariantConfig { + // Logging component variants. + enum Variant { + // Default value. This shouldn't be used. + VARIANT_UNSPECIFIED = 0; + + // default logging variant. + DEFAULT = 1; + + // maximum logging throughput variant. + MAX_THROUGHPUT = 2; + } + + // Logging variant deployed on nodes. + Variant variant = 1; +} + +// MonitoringComponentConfig is cluster monitoring component configuration. +message MonitoringComponentConfig { + // GKE components exposing metrics + enum Component { + // Default value. This shouldn't be used. + COMPONENT_UNSPECIFIED = 0; + + // system components + SYSTEM_COMPONENTS = 1; + + // Deprecated: Use Google Cloud Managed Service for Prometheus. + WORKLOADS = 2 [deprecated = true]; + + // kube-apiserver + APISERVER = 3; + + // kube-scheduler + SCHEDULER = 4; + + // kube-controller-manager + CONTROLLER_MANAGER = 5; + } + + // Select components to collect metrics. An empty set would disable all + // monitoring. + repeated Component enable_components = 1; +} + +// The datapath provider selects the implementation of the Kubernetes networking +// model for service resolution and network policy enforcement. +enum DatapathProvider { + // Default value. + DATAPATH_PROVIDER_UNSPECIFIED = 0; + + // Use the IPTables implementation based on kube-proxy. + LEGACY_DATAPATH = 1; + + // Use the eBPF based GKE Dataplane V2 with additional features. See the [GKE + // Dataplane V2 + // documentation](https://cloud.google.com/kubernetes-engine/docs/how-to/dataplane-v2) + // for more. + ADVANCED_DATAPATH = 2; +} + +// Fleet is the fleet configuration for the cluster. +message Fleet { + // The Fleet host project(project ID or project number) where this cluster + // will be registered to. This field cannot be changed after the cluster has + // been registered. + string project = 1; + + // [Output only] The full resource name of the registered fleet membership of + // the cluster, in the format + // `//gkehub.googleapis.com/projects/*/locations/*/memberships/*`. + string membership = 2; + + // [Output only] Whether the cluster has been registered through the fleet + // API. + bool pre_registered = 3; +} + +// Possible values for IP stack type +enum StackType { + // By default, the clusters will be IPV4 only + STACK_TYPE_UNSPECIFIED = 0; + + // The value used if the cluster is a IPV4 only + IPV4 = 1; + + // The value used if the cluster is a dual stack cluster + IPV4_IPV6 = 2; +} diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.cancel_operation.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.cancel_operation.js new file mode 100644 index 00000000000..939c8c4aaca --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.cancel_operation.js @@ -0,0 +1,64 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, operationId) { + // [START container_v1beta1_generated_ClusterManager_CancelOperation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, operation id) of the operation to cancel. + * Specified in the format `projects/* /locations/* /operations/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCancelOperation() { + // Construct request + const request = { + projectId, + zone, + operationId, + }; + + // Run request + const response = await containerClient.cancelOperation(request); + console.log(response); + } + + callCancelOperation(); + // [END container_v1beta1_generated_ClusterManager_CancelOperation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js new file mode 100644 index 00000000000..4511c66ce17 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js @@ -0,0 +1,61 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1beta1_generated_ClusterManager_CheckAutopilotCompatibility_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster) of the cluster to retrieve. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCheckAutopilotCompatibility() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.checkAutopilotCompatibility(request); + console.log(response); + } + + callCheckAutopilotCompatibility(); + // [END container_v1beta1_generated_ClusterManager_CheckAutopilotCompatibility_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_i_p_rotation.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_i_p_rotation.js new file mode 100644 index 00000000000..57cb300a08f --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_i_p_rotation.js @@ -0,0 +1,64 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId) { + // [START container_v1beta1_generated_ClusterManager_CompleteIPRotation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster name) of the cluster to complete IP + * rotation. Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCompleteIPRotation() { + // Construct request + const request = { + projectId, + zone, + clusterId, + }; + + // Run request + const response = await containerClient.completeIPRotation(request); + console.log(response); + } + + callCompleteIPRotation(); + // [END container_v1beta1_generated_ClusterManager_CompleteIPRotation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_node_pool_upgrade.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_node_pool_upgrade.js new file mode 100644 index 00000000000..152c6971b1b --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_node_pool_upgrade.js @@ -0,0 +1,62 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1beta1_generated_ClusterManager_CompleteNodePoolUpgrade_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster, node pool id) of the node pool to + * complete upgrade. + * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCompleteNodePoolUpgrade() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.completeNodePoolUpgrade(request); + console.log(response); + } + + callCompleteNodePoolUpgrade(); + // [END container_v1beta1_generated_ClusterManager_CompleteNodePoolUpgrade_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_cluster.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_cluster.js new file mode 100644 index 00000000000..4414e1ca9d3 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_cluster.js @@ -0,0 +1,69 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, cluster) { + // [START container_v1beta1_generated_ClusterManager_CreateCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A cluster + * resource (https://cloud.google.com/container-engine/reference/rest/v1beta1/projects.locations.clusters) + */ + // const cluster = {} + /** + * The parent (project and location) where the cluster will be created. + * Specified in the format `projects/* /locations/*`. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCreateCluster() { + // Construct request + const request = { + projectId, + zone, + cluster, + }; + + // Run request + const response = await containerClient.createCluster(request); + console.log(response); + } + + callCreateCluster(); + // [END container_v1beta1_generated_ClusterManager_CreateCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_node_pool.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_node_pool.js new file mode 100644 index 00000000000..9d53c6be79e --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_node_pool.js @@ -0,0 +1,70 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, nodePool) { + // [START container_v1beta1_generated_ClusterManager_CreateNodePool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The node pool to create. + */ + // const nodePool = {} + /** + * The parent (project, location, cluster name) where the node pool will be + * created. Specified in the format + * `projects/* /locations/* /clusters/*`. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCreateNodePool() { + // Construct request + const request = { + projectId, + zone, + clusterId, + nodePool, + }; + + // Run request + const response = await containerClient.createNodePool(request); + console.log(response); + } + + callCreateNodePool(); + // [END container_v1beta1_generated_ClusterManager_CreateNodePool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_cluster.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_cluster.js new file mode 100644 index 00000000000..d387c456166 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_cluster.js @@ -0,0 +1,64 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId) { + // [START container_v1beta1_generated_ClusterManager_DeleteCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster) of the cluster to delete. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callDeleteCluster() { + // Construct request + const request = { + projectId, + zone, + clusterId, + }; + + // Run request + const response = await containerClient.deleteCluster(request); + console.log(response); + } + + callDeleteCluster(); + // [END container_v1beta1_generated_ClusterManager_DeleteCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_node_pool.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_node_pool.js new file mode 100644 index 00000000000..d406bb8686c --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_node_pool.js @@ -0,0 +1,66 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, nodePoolId) { + // [START container_v1beta1_generated_ClusterManager_DeleteNodePool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster, node pool id) of the node pool to + * delete. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callDeleteNodePool() { + // Construct request + const request = { + projectId, + zone, + clusterId, + nodePoolId, + }; + + // Run request + const response = await containerClient.deleteNodePool(request); + console.log(response); + } + + callDeleteNodePool(); + // [END container_v1beta1_generated_ClusterManager_DeleteNodePool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_cluster.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_cluster.js new file mode 100644 index 00000000000..0e388e69226 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_cluster.js @@ -0,0 +1,64 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId) { + // [START container_v1beta1_generated_ClusterManager_GetCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster) of the cluster to retrieve. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callGetCluster() { + // Construct request + const request = { + projectId, + zone, + clusterId, + }; + + // Run request + const response = await containerClient.getCluster(request); + console.log(response); + } + + callGetCluster(); + // [END container_v1beta1_generated_ClusterManager_GetCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_j_s_o_n_web_keys.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_j_s_o_n_web_keys.js new file mode 100644 index 00000000000..f48cfa5316d --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_j_s_o_n_web_keys.js @@ -0,0 +1,61 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1beta1_generated_ClusterManager_GetJSONWebKeys_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The cluster (project, location, cluster name) to get keys for. Specified in + * the format `projects/* /locations/* /clusters/*`. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callGetJSONWebKeys() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.getJSONWebKeys(request); + console.log(response); + } + + callGetJSONWebKeys(); + // [END container_v1beta1_generated_ClusterManager_GetJSONWebKeys_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_node_pool.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_node_pool.js new file mode 100644 index 00000000000..21f384189f6 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_node_pool.js @@ -0,0 +1,66 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, nodePoolId) { + // [START container_v1beta1_generated_ClusterManager_GetNodePool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster, node pool id) of the node pool to + * get. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callGetNodePool() { + // Construct request + const request = { + projectId, + zone, + clusterId, + nodePoolId, + }; + + // Run request + const response = await containerClient.getNodePool(request); + console.log(response); + } + + callGetNodePool(); + // [END container_v1beta1_generated_ClusterManager_GetNodePool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_operation.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_operation.js new file mode 100644 index 00000000000..f693d6982e6 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_operation.js @@ -0,0 +1,64 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, operationId) { + // [START container_v1beta1_generated_ClusterManager_GetOperation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, operation id) of the operation to get. + * Specified in the format `projects/* /locations/* /operations/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callGetOperation() { + // Construct request + const request = { + projectId, + zone, + operationId, + }; + + // Run request + const response = await containerClient.getOperation(request); + console.log(response); + } + + callGetOperation(); + // [END container_v1beta1_generated_ClusterManager_GetOperation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_server_config.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_server_config.js new file mode 100644 index 00000000000..147c03feb39 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_server_config.js @@ -0,0 +1,63 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone) { + // [START container_v1beta1_generated_ClusterManager_GetServerConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project and location) of the server config to get, + * specified in the format `projects/* /locations/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callGetServerConfig() { + // Construct request + const request = { + projectId, + zone, + }; + + // Run request + const response = await containerClient.getServerConfig(request); + console.log(response); + } + + callGetServerConfig(); + // [END container_v1beta1_generated_ClusterManager_GetServerConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_clusters.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_clusters.js new file mode 100644 index 00000000000..3a468a6e586 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_clusters.js @@ -0,0 +1,64 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone) { + // [START container_v1beta1_generated_ClusterManager_ListClusters_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The parent (project and location) where the clusters will be listed. + * Specified in the format `projects/* /locations/*`. + * Location "-" matches all zones and all regions. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callListClusters() { + // Construct request + const request = { + projectId, + zone, + }; + + // Run request + const response = await containerClient.listClusters(request); + console.log(response); + } + + callListClusters(); + // [END container_v1beta1_generated_ClusterManager_ListClusters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_locations.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_locations.js new file mode 100644 index 00000000000..62e86afb204 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_locations.js @@ -0,0 +1,62 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START container_v1beta1_generated_ClusterManager_ListLocations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Contains the name of the resource requested. + * Specified in the format `projects/*`. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callListLocations() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await containerClient.listLocations(request); + console.log(response); + } + + callListLocations(); + // [END container_v1beta1_generated_ClusterManager_ListLocations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_node_pools.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_node_pools.js new file mode 100644 index 00000000000..6c5aaa855e4 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_node_pools.js @@ -0,0 +1,64 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId) { + // [START container_v1beta1_generated_ClusterManager_ListNodePools_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The parent (project, location, cluster name) where the node pools will be + * listed. Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callListNodePools() { + // Construct request + const request = { + projectId, + zone, + clusterId, + }; + + // Run request + const response = await containerClient.listNodePools(request); + console.log(response); + } + + callListNodePools(); + // [END container_v1beta1_generated_ClusterManager_ListNodePools_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_operations.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_operations.js new file mode 100644 index 00000000000..adaf08f3129 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_operations.js @@ -0,0 +1,64 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone) { + // [START container_v1beta1_generated_ClusterManager_ListOperations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The parent (project and location) where the operations will be listed. + * Specified in the format `projects/* /locations/*`. + * Location "-" matches all zones and all regions. + */ + // const parent = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callListOperations() { + // Construct request + const request = { + projectId, + zone, + }; + + // Run request + const response = await containerClient.listOperations(request); + console.log(response); + } + + callListOperations(); + // [END container_v1beta1_generated_ClusterManager_ListOperations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_usable_subnetworks.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_usable_subnetworks.js new file mode 100644 index 00000000000..400d21f447c --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_usable_subnetworks.js @@ -0,0 +1,83 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START container_v1beta1_generated_ClusterManager_ListUsableSubnetworks_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent project where subnetworks are usable. + * Specified in the format `projects/*`. + */ + // const parent = 'abc123' + /** + * 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. + */ + // const filter = 'abc123' + /** + * 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) + */ + // const pageSize = 1234 + /** + * Specifies a page token to use. Set this to the nextPageToken returned by + * previous list requests to get the next page of results. + */ + // const pageToken = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callListUsableSubnetworks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await containerClient.listUsableSubnetworksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListUsableSubnetworks(); + // [END container_v1beta1_generated_ClusterManager_ListUsableSubnetworks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.rollback_node_pool_upgrade.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.rollback_node_pool_upgrade.js new file mode 100644 index 00000000000..fd127925ad0 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.rollback_node_pool_upgrade.js @@ -0,0 +1,71 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, nodePoolId) { + // [START container_v1beta1_generated_ClusterManager_RollbackNodePoolUpgrade_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster, node pool id) of the node poll to + * rollback upgrade. + * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + /** + * Option for rollback to ignore the PodDisruptionBudget. + * Default value is false. + */ + // const respectPdb = true + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callRollbackNodePoolUpgrade() { + // Construct request + const request = { + projectId, + zone, + clusterId, + nodePoolId, + }; + + // Run request + const response = await containerClient.rollbackNodePoolUpgrade(request); + console.log(response); + } + + callRollbackNodePoolUpgrade(); + // [END container_v1beta1_generated_ClusterManager_RollbackNodePoolUpgrade_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_addons_config.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_addons_config.js new file mode 100644 index 00000000000..575a4bf0e5f --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_addons_config.js @@ -0,0 +1,70 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, addonsConfig) { + // [START container_v1beta1_generated_ClusterManager_SetAddonsConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The desired configurations for the various addons available to + * run in the cluster. + */ + // const addonsConfig = {} + /** + * The name (project, location, cluster) of the cluster to set addons. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetAddonsConfig() { + // Construct request + const request = { + projectId, + zone, + clusterId, + addonsConfig, + }; + + // Run request + const response = await containerClient.setAddonsConfig(request); + console.log(response); + } + + callSetAddonsConfig(); + // [END container_v1beta1_generated_ClusterManager_SetAddonsConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_labels.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_labels.js new file mode 100644 index 00000000000..9690ae6d011 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_labels.js @@ -0,0 +1,79 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, resourceLabels, labelFingerprint) { + // [START container_v1beta1_generated_ClusterManager_SetLabels_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The labels to set for that cluster. + */ + // const resourceLabels = 1234 + /** + * 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. + */ + // const labelFingerprint = 'abc123' + /** + * The name (project, location, cluster name) of the cluster to set labels. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetLabels() { + // Construct request + const request = { + projectId, + zone, + clusterId, + resourceLabels, + labelFingerprint, + }; + + // Run request + const response = await containerClient.setLabels(request); + console.log(response); + } + + callSetLabels(); + // [END container_v1beta1_generated_ClusterManager_SetLabels_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_legacy_abac.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_legacy_abac.js new file mode 100644 index 00000000000..c59d4c74879 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_legacy_abac.js @@ -0,0 +1,69 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, enabled) { + // [START container_v1beta1_generated_ClusterManager_SetLegacyAbac_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Whether ABAC authorization will be enabled in the cluster. + */ + // const enabled = true + /** + * The name (project, location, cluster name) of the cluster to set legacy + * abac. Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetLegacyAbac() { + // Construct request + const request = { + projectId, + zone, + clusterId, + enabled, + }; + + // Run request + const response = await containerClient.setLegacyAbac(request); + console.log(response); + } + + callSetLegacyAbac(); + // [END container_v1beta1_generated_ClusterManager_SetLegacyAbac_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_locations.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_locations.js new file mode 100644 index 00000000000..7a830f08e75 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_locations.js @@ -0,0 +1,74 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, locations) { + // [START container_v1beta1_generated_ClusterManager_SetLocations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The desired list of Google Compute Engine + * zones (https://cloud.google.com/compute/docs/zones#available) 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. + */ + // const locations = 'abc123' + /** + * The name (project, location, cluster) of the cluster to set locations. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetLocations() { + // Construct request + const request = { + projectId, + zone, + clusterId, + locations, + }; + + // Run request + const response = await containerClient.setLocations(request); + console.log(response); + } + + callSetLocations(); + // [END container_v1beta1_generated_ClusterManager_SetLocations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_logging_service.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_logging_service.js new file mode 100644 index 00000000000..e6cd4a0d7f1 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_logging_service.js @@ -0,0 +1,77 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, loggingService) { + // [START container_v1beta1_generated_ClusterManager_SetLoggingService_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The logging service the cluster should use to write logs. + * Currently available options: + * * `logging.googleapis.com/kubernetes` - The Cloud Logging + * service with a Kubernetes-native resource model + * * `logging.googleapis.com` - The legacy Cloud Logging service (no longer + * available as of GKE 1.15). + * * `none` - no logs will be exported from the cluster. + * If left as an empty string,`logging.googleapis.com/kubernetes` will be + * used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. + */ + // const loggingService = 'abc123' + /** + * The name (project, location, cluster) of the cluster to set logging. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetLoggingService() { + // Construct request + const request = { + projectId, + zone, + clusterId, + loggingService, + }; + + // Run request + const response = await containerClient.setLoggingService(request); + console.log(response); + } + + callSetLoggingService(); + // [END container_v1beta1_generated_ClusterManager_SetLoggingService_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_maintenance_policy.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_maintenance_policy.js new file mode 100644 index 00000000000..fa688eb7520 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_maintenance_policy.js @@ -0,0 +1,86 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, maintenancePolicy) { + // [START container_v1beta1_generated_ClusterManager_SetMaintenancePolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The Google Developers Console project ID or project + * number (https://cloud.google.com/resource-manager/docs/creating-managing-projects). + */ + // const projectId = 'abc123' + /** + * Required. The name of the Google Compute Engine + * zone (https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. + */ + // const zone = 'abc123' + /** + * Required. The name of the cluster to update. + */ + // const clusterId = 'abc123' + /** + * Required. The maintenance policy to be set for the cluster. An empty field + * clears the existing maintenance policy. + */ + // const maintenancePolicy = {} + /** + * The name (project, location, cluster name) of the cluster to set + * maintenance policy. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetMaintenancePolicy() { + // Construct request + const request = { + projectId, + zone, + clusterId, + maintenancePolicy, + }; + + // Run request + const response = await containerClient.setMaintenancePolicy(request); + console.log(response); + } + + callSetMaintenancePolicy(); + // [END container_v1beta1_generated_ClusterManager_SetMaintenancePolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_master_auth.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_master_auth.js new file mode 100644 index 00000000000..f39467e7cab --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_master_auth.js @@ -0,0 +1,74 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, action, update) { + // [START container_v1beta1_generated_ClusterManager_SetMasterAuth_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The exact form of action to be taken on the master auth. + */ + // const action = {} + /** + * Required. A description of the update. + */ + // const update = {} + /** + * The name (project, location, cluster) of the cluster to set auth. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetMasterAuth() { + // Construct request + const request = { + projectId, + zone, + clusterId, + action, + update, + }; + + // Run request + const response = await containerClient.setMasterAuth(request); + console.log(response); + } + + callSetMasterAuth(); + // [END container_v1beta1_generated_ClusterManager_SetMasterAuth_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_monitoring_service.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_monitoring_service.js new file mode 100644 index 00000000000..a7fe3208d49 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_monitoring_service.js @@ -0,0 +1,77 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, monitoringService) { + // [START container_v1beta1_generated_ClusterManager_SetMonitoringService_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The monitoring service the cluster should use to write metrics. + * Currently available options: + * * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring + * service with a Kubernetes-native resource model + * * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no + * longer available as of GKE 1.15). + * * `none` - No metrics will be exported from the cluster. + * If left as an empty string,`monitoring.googleapis.com/kubernetes` will be + * used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. + */ + // const monitoringService = 'abc123' + /** + * The name (project, location, cluster) of the cluster to set monitoring. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetMonitoringService() { + // Construct request + const request = { + projectId, + zone, + clusterId, + monitoringService, + }; + + // Run request + const response = await containerClient.setMonitoringService(request); + console.log(response); + } + + callSetMonitoringService(); + // [END container_v1beta1_generated_ClusterManager_SetMonitoringService_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_network_policy.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_network_policy.js new file mode 100644 index 00000000000..08f2bd01e43 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_network_policy.js @@ -0,0 +1,69 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, networkPolicy) { + // [START container_v1beta1_generated_ClusterManager_SetNetworkPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Configuration options for the NetworkPolicy feature. + */ + // const networkPolicy = {} + /** + * The name (project, location, cluster name) of the cluster to set networking + * policy. Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetNetworkPolicy() { + // Construct request + const request = { + projectId, + zone, + clusterId, + networkPolicy, + }; + + // Run request + const response = await containerClient.setNetworkPolicy(request); + console.log(response); + } + + callSetNetworkPolicy(); + // [END container_v1beta1_generated_ClusterManager_SetNetworkPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_autoscaling.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_autoscaling.js new file mode 100644 index 00000000000..48045be1f16 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_autoscaling.js @@ -0,0 +1,71 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, nodePoolId, autoscaling) { + // [START container_v1beta1_generated_ClusterManager_SetNodePoolAutoscaling_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Autoscaling configuration for the node pool. + */ + // const autoscaling = {} + /** + * The name (project, location, cluster, node pool) of the node pool to set + * autoscaler settings. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetNodePoolAutoscaling() { + // Construct request + const request = { + projectId, + zone, + clusterId, + nodePoolId, + autoscaling, + }; + + // Run request + const response = await containerClient.setNodePoolAutoscaling(request); + console.log(response); + } + + callSetNodePoolAutoscaling(); + // [END container_v1beta1_generated_ClusterManager_SetNodePoolAutoscaling_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_management.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_management.js new file mode 100644 index 00000000000..904e07be6c2 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_management.js @@ -0,0 +1,71 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, nodePoolId, management) { + // [START container_v1beta1_generated_ClusterManager_SetNodePoolManagement_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. NodeManagement configuration for the node pool. + */ + // const management = {} + /** + * The name (project, location, cluster, node pool id) of the node pool to set + * management properties. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetNodePoolManagement() { + // Construct request + const request = { + projectId, + zone, + clusterId, + nodePoolId, + management, + }; + + // Run request + const response = await containerClient.setNodePoolManagement(request); + console.log(response); + } + + callSetNodePoolManagement(); + // [END container_v1beta1_generated_ClusterManager_SetNodePoolManagement_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_size.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_size.js new file mode 100644 index 00000000000..3903f3ff656 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_size.js @@ -0,0 +1,71 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, nodePoolId, nodeCount) { + // [START container_v1beta1_generated_ClusterManager_SetNodePoolSize_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The desired node count for the pool. + */ + // const nodeCount = 1234 + /** + * The name (project, location, cluster, node pool id) of the node pool to set + * size. + * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callSetNodePoolSize() { + // Construct request + const request = { + projectId, + zone, + clusterId, + nodePoolId, + nodeCount, + }; + + // Run request + const response = await containerClient.setNodePoolSize(request); + console.log(response); + } + + callSetNodePoolSize(); + // [END container_v1beta1_generated_ClusterManager_SetNodePoolSize_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.start_i_p_rotation.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.start_i_p_rotation.js new file mode 100644 index 00000000000..181752cb53f --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.start_i_p_rotation.js @@ -0,0 +1,68 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId) { + // [START container_v1beta1_generated_ClusterManager_StartIPRotation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name (project, location, cluster name) of the cluster to start IP + * rotation. Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + /** + * Whether to rotate credentials during IP rotation. + */ + // const rotateCredentials = true + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callStartIPRotation() { + // Construct request + const request = { + projectId, + zone, + clusterId, + }; + + // Run request + const response = await containerClient.startIPRotation(request); + console.log(response); + } + + callStartIPRotation(); + // [END container_v1beta1_generated_ClusterManager_StartIPRotation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_cluster.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_cluster.js new file mode 100644 index 00000000000..23c5ff8b0c8 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_cluster.js @@ -0,0 +1,69 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, update) { + // [START container_v1beta1_generated_ClusterManager_UpdateCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A description of the update. + */ + // const update = {} + /** + * The name (project, location, cluster) of the cluster to update. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callUpdateCluster() { + // Construct request + const request = { + projectId, + zone, + clusterId, + update, + }; + + // Run request + const response = await containerClient.updateCluster(request); + console.log(response); + } + + callUpdateCluster(); + // [END container_v1beta1_generated_ClusterManager_UpdateCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_master.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_master.js new file mode 100644 index 00000000000..d76efa7a362 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_master.js @@ -0,0 +1,76 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, masterVersion) { + // [START container_v1beta1_generated_ClusterManager_UpdateMaster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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 + */ + // const masterVersion = 'abc123' + /** + * The name (project, location, cluster) of the cluster to update. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callUpdateMaster() { + // Construct request + const request = { + projectId, + zone, + clusterId, + masterVersion, + }; + + // Run request + const response = await containerClient.updateMaster(request); + console.log(response); + } + + callUpdateMaster(); + // [END container_v1beta1_generated_ClusterManager_UpdateMaster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_node_pool.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_node_pool.js new file mode 100644 index 00000000000..8f5b298a36e --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_node_pool.js @@ -0,0 +1,168 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, zone, clusterId, nodePoolId, nodeVersion, imageType) { + // [START container_v1beta1_generated_ClusterManager_UpdateNodePool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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 + */ + // const nodeVersion = 'abc123' + /** + * Required. The desired image type for the node pool. Please see + * https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for + * available image types. + */ + // const imageType = 'abc123' + /** + * The desired list of Google Compute Engine + * zones (https://cloud.google.com/compute/docs/zones#available) in which the + * node pool's nodes should be located. Changing the locations for a node pool + * will result in nodes being either created or removed from the node pool, + * depending on whether locations are being added or removed. + */ + // const locations = 'abc123' + /** + * The desired workload metadata config for the node pool. + */ + // const workloadMetadataConfig = {} + /** + * The name (project, location, cluster, node pool) of the node pool to + * update. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + */ + // const name = 'abc123' + /** + * Upgrade settings control disruption and speed of the upgrade. + */ + // const upgradeSettings = {} + /** + * The desired network tags to be applied to all nodes in the node pool. + * If this field is not present, the tags will not be changed. Otherwise, + * the existing network tags will be *replaced* with the provided tags. + */ + // const tags = {} + /** + * The desired node taints to be applied to all nodes in the node pool. + * If this field is not present, the taints will not be changed. Otherwise, + * the existing node taints will be *replaced* with the provided taints. + */ + // const taints = {} + /** + * The desired node labels to be applied to all nodes in the node pool. + * If this field is not present, the labels will not be changed. Otherwise, + * the existing node labels will be *replaced* with the provided labels. + */ + // const labels = {} + /** + * Parameters that can be configured on Linux nodes. + */ + // const linuxNodeConfig = {} + /** + * Node kubelet configs. + */ + // const kubeletConfig = {} + /** + * Node network config. + */ + // const nodeNetworkConfig = {} + /** + * GCFS config. + */ + // const gcfsConfig = {} + /** + * Confidential nodes config. + * All the nodes in the node pool will be Confidential VM once enabled. + */ + // const confidentialNodes = {} + /** + * Enable or disable gvnic on the node pool. + */ + // const gvnic = {} + /** + * The current etag of the node pool. + * If an etag is provided and does not match the current etag of the node + * pool, update will be blocked and an ABORTED error will be returned. + */ + // const etag = 'abc123' + /** + * Enable or disable NCCL fast socket for the node pool. + */ + // const fastSocket = {} + /** + * Logging configuration. + */ + // const loggingConfig = {} + /** + * The resource labels for the node pool to use to annotate any related + * Google Compute Engine resources. + */ + // const resourceLabels = {} + /** + * Parameters that can be configured on Windows nodes. + */ + // const windowsNodeConfig = {} + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callUpdateNodePool() { + // Construct request + const request = { + projectId, + zone, + clusterId, + nodePoolId, + nodeVersion, + imageType, + }; + + // Run request + const response = await containerClient.updateNodePool(request); + console.log(response); + } + + callUpdateNodePool(); + // [END container_v1beta1_generated_ClusterManager_UpdateNodePool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json new file mode 100644 index 00000000000..5e5c05ee1ca --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json @@ -0,0 +1,1955 @@ +{ + "clientLibrary": { + "name": "nodejs-container", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.container.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "container_v1beta1_generated_ClusterManager_ListClusters_async", + "title": "ClusterManager listClusters Sample", + "origin": "API_DEFINITION", + "description": " Lists all clusters owned by a project in either the specified zone or all zones.", + "canonical": true, + "file": "cluster_manager.list_clusters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListClusters", + "fullName": "google.container.v1beta1.ClusterManager.ListClusters", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.ListClustersResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "ListClusters", + "fullName": "google.container.v1beta1.ClusterManager.ListClusters", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_GetCluster_async", + "title": "ClusterManager getCluster Sample", + "origin": "API_DEFINITION", + "description": " Gets the details for a specific cluster.", + "canonical": true, + "file": "cluster_manager.get_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCluster", + "fullName": "google.container.v1beta1.ClusterManager.GetCluster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Cluster", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "GetCluster", + "fullName": "google.container.v1beta1.ClusterManager.GetCluster", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_CreateCluster_async", + "title": "ClusterManager createCluster Sample", + "origin": "API_DEFINITION", + "description": " 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](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). 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.", + "canonical": true, + "file": "cluster_manager.create_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCluster", + "fullName": "google.container.v1beta1.ClusterManager.CreateCluster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster", + "type": ".google.container.v1beta1.Cluster" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "CreateCluster", + "fullName": "google.container.v1beta1.ClusterManager.CreateCluster", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_UpdateCluster_async", + "title": "ClusterManager updateCluster Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings for a specific cluster.", + "canonical": true, + "file": "cluster_manager.update_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCluster", + "fullName": "google.container.v1beta1.ClusterManager.UpdateCluster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "update", + "type": ".google.container.v1beta1.ClusterUpdate" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "UpdateCluster", + "fullName": "google.container.v1beta1.ClusterManager.UpdateCluster", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_UpdateNodePool_async", + "title": "ClusterManager updateNodePool Sample", + "origin": "API_DEFINITION", + "description": " Updates the version and/or image type of a specific node pool.", + "canonical": true, + "file": "cluster_manager.update_node_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 160, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateNodePool", + "fullName": "google.container.v1beta1.ClusterManager.UpdateNodePool", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "node_version", + "type": "TYPE_STRING" + }, + { + "name": "image_type", + "type": "TYPE_STRING" + }, + { + "name": "locations", + "type": "TYPE_STRING[]" + }, + { + "name": "workload_metadata_config", + "type": ".google.container.v1beta1.WorkloadMetadataConfig" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "upgrade_settings", + "type": ".google.container.v1beta1.NodePool.UpgradeSettings" + }, + { + "name": "tags", + "type": ".google.container.v1beta1.NetworkTags" + }, + { + "name": "taints", + "type": ".google.container.v1beta1.NodeTaints" + }, + { + "name": "labels", + "type": ".google.container.v1beta1.NodeLabels" + }, + { + "name": "linux_node_config", + "type": ".google.container.v1beta1.LinuxNodeConfig" + }, + { + "name": "kubelet_config", + "type": ".google.container.v1beta1.NodeKubeletConfig" + }, + { + "name": "node_network_config", + "type": ".google.container.v1beta1.NodeNetworkConfig" + }, + { + "name": "gcfs_config", + "type": ".google.container.v1beta1.GcfsConfig" + }, + { + "name": "confidential_nodes", + "type": ".google.container.v1beta1.ConfidentialNodes" + }, + { + "name": "gvnic", + "type": ".google.container.v1beta1.VirtualNIC" + }, + { + "name": "etag", + "type": "TYPE_STRING" + }, + { + "name": "fast_socket", + "type": ".google.container.v1beta1.FastSocket" + }, + { + "name": "logging_config", + "type": ".google.container.v1beta1.NodePoolLoggingConfig" + }, + { + "name": "resource_labels", + "type": ".google.container.v1beta1.ResourceLabels" + }, + { + "name": "windows_node_config", + "type": ".google.container.v1beta1.WindowsNodeConfig" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "UpdateNodePool", + "fullName": "google.container.v1beta1.ClusterManager.UpdateNodePool", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_SetNodePoolAutoscaling_async", + "title": "ClusterManager setNodePoolAutoscaling Sample", + "origin": "API_DEFINITION", + "description": " Sets the autoscaling settings of a specific node pool.", + "canonical": true, + "file": "cluster_manager.set_node_pool_autoscaling.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetNodePoolAutoscaling", + "fullName": "google.container.v1beta1.ClusterManager.SetNodePoolAutoscaling", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "autoscaling", + "type": ".google.container.v1beta1.NodePoolAutoscaling" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "SetNodePoolAutoscaling", + "fullName": "google.container.v1beta1.ClusterManager.SetNodePoolAutoscaling", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_SetLoggingService_async", + "title": "ClusterManager setLoggingService Sample", + "origin": "API_DEFINITION", + "description": " Sets the logging service for a specific cluster.", + "canonical": true, + "file": "cluster_manager.set_logging_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetLoggingService", + "fullName": "google.container.v1beta1.ClusterManager.SetLoggingService", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "logging_service", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "SetLoggingService", + "fullName": "google.container.v1beta1.ClusterManager.SetLoggingService", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_SetMonitoringService_async", + "title": "ClusterManager setMonitoringService Sample", + "origin": "API_DEFINITION", + "description": " Sets the monitoring service for a specific cluster.", + "canonical": true, + "file": "cluster_manager.set_monitoring_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetMonitoringService", + "fullName": "google.container.v1beta1.ClusterManager.SetMonitoringService", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "monitoring_service", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "SetMonitoringService", + "fullName": "google.container.v1beta1.ClusterManager.SetMonitoringService", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_SetAddonsConfig_async", + "title": "ClusterManager setAddonsConfig Sample", + "origin": "API_DEFINITION", + "description": " Sets the addons for a specific cluster.", + "canonical": true, + "file": "cluster_manager.set_addons_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetAddonsConfig", + "fullName": "google.container.v1beta1.ClusterManager.SetAddonsConfig", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "addons_config", + "type": ".google.container.v1beta1.AddonsConfig" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "SetAddonsConfig", + "fullName": "google.container.v1beta1.ClusterManager.SetAddonsConfig", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_SetLocations_async", + "title": "ClusterManager setLocations Sample", + "origin": "API_DEFINITION", + "description": " Sets the locations for a specific cluster. Deprecated. Use [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters/update) instead.", + "canonical": true, + "file": "cluster_manager.set_locations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetLocations", + "fullName": "google.container.v1beta1.ClusterManager.SetLocations", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "locations", + "type": "TYPE_STRING[]" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "SetLocations", + "fullName": "google.container.v1beta1.ClusterManager.SetLocations", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_UpdateMaster_async", + "title": "ClusterManager updateMaster Sample", + "origin": "API_DEFINITION", + "description": " Updates the master for a specific cluster.", + "canonical": true, + "file": "cluster_manager.update_master.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateMaster", + "fullName": "google.container.v1beta1.ClusterManager.UpdateMaster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "master_version", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "UpdateMaster", + "fullName": "google.container.v1beta1.ClusterManager.UpdateMaster", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_SetMasterAuth_async", + "title": "ClusterManager setMasterAuth Sample", + "origin": "API_DEFINITION", + "description": " Sets master auth materials. Currently supports changing the admin password or a specific cluster, either via password generation or explicitly setting the password.", + "canonical": true, + "file": "cluster_manager.set_master_auth.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetMasterAuth", + "fullName": "google.container.v1beta1.ClusterManager.SetMasterAuth", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "action", + "type": ".google.container.v1beta1.SetMasterAuthRequest.Action" + }, + { + "name": "update", + "type": ".google.container.v1beta1.MasterAuth" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "SetMasterAuth", + "fullName": "google.container.v1beta1.ClusterManager.SetMasterAuth", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_DeleteCluster_async", + "title": "ClusterManager deleteCluster Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "cluster_manager.delete_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCluster", + "fullName": "google.container.v1beta1.ClusterManager.DeleteCluster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "DeleteCluster", + "fullName": "google.container.v1beta1.ClusterManager.DeleteCluster", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_ListOperations_async", + "title": "ClusterManager listOperations Sample", + "origin": "API_DEFINITION", + "description": " Lists all operations in a project in the specified zone or all zones.", + "canonical": true, + "file": "cluster_manager.list_operations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListOperations", + "fullName": "google.container.v1beta1.ClusterManager.ListOperations", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.ListOperationsResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "ListOperations", + "fullName": "google.container.v1beta1.ClusterManager.ListOperations", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_GetOperation_async", + "title": "ClusterManager getOperation Sample", + "origin": "API_DEFINITION", + "description": " Gets the specified operation.", + "canonical": true, + "file": "cluster_manager.get_operation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetOperation", + "fullName": "google.container.v1beta1.ClusterManager.GetOperation", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "operation_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "GetOperation", + "fullName": "google.container.v1beta1.ClusterManager.GetOperation", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_CancelOperation_async", + "title": "ClusterManager cancelOperation Sample", + "origin": "API_DEFINITION", + "description": " Cancels the specified operation.", + "canonical": true, + "file": "cluster_manager.cancel_operation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CancelOperation", + "fullName": "google.container.v1beta1.ClusterManager.CancelOperation", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "operation_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "CancelOperation", + "fullName": "google.container.v1beta1.ClusterManager.CancelOperation", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_GetServerConfig_async", + "title": "ClusterManager getServerConfig Sample", + "origin": "API_DEFINITION", + "description": " Returns configuration info about the Google Kubernetes Engine service.", + "canonical": true, + "file": "cluster_manager.get_server_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetServerConfig", + "fullName": "google.container.v1beta1.ClusterManager.GetServerConfig", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.ServerConfig", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "GetServerConfig", + "fullName": "google.container.v1beta1.ClusterManager.GetServerConfig", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_GetJSONWebKeys_async", + "title": "ClusterManager getJSONWebKeys Sample", + "origin": "API_DEFINITION", + "description": " Gets the public component of the cluster signing keys in JSON Web Key format. This API is not yet intended for general use, and is not available for all clusters.", + "canonical": true, + "file": "cluster_manager.get_j_s_o_n_web_keys.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetJSONWebKeys", + "fullName": "google.container.v1beta1.ClusterManager.GetJSONWebKeys", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.GetJSONWebKeysResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "GetJSONWebKeys", + "fullName": "google.container.v1beta1.ClusterManager.GetJSONWebKeys", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_ListNodePools_async", + "title": "ClusterManager listNodePools Sample", + "origin": "API_DEFINITION", + "description": " Lists the node pools for a cluster.", + "canonical": true, + "file": "cluster_manager.list_node_pools.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListNodePools", + "fullName": "google.container.v1beta1.ClusterManager.ListNodePools", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.ListNodePoolsResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "ListNodePools", + "fullName": "google.container.v1beta1.ClusterManager.ListNodePools", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_GetNodePool_async", + "title": "ClusterManager getNodePool Sample", + "origin": "API_DEFINITION", + "description": " Retrieves the requested node pool.", + "canonical": true, + "file": "cluster_manager.get_node_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetNodePool", + "fullName": "google.container.v1beta1.ClusterManager.GetNodePool", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.NodePool", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "GetNodePool", + "fullName": "google.container.v1beta1.ClusterManager.GetNodePool", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_CreateNodePool_async", + "title": "ClusterManager createNodePool Sample", + "origin": "API_DEFINITION", + "description": " Creates a node pool for a cluster.", + "canonical": true, + "file": "cluster_manager.create_node_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateNodePool", + "fullName": "google.container.v1beta1.ClusterManager.CreateNodePool", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool", + "type": ".google.container.v1beta1.NodePool" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "CreateNodePool", + "fullName": "google.container.v1beta1.ClusterManager.CreateNodePool", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_DeleteNodePool_async", + "title": "ClusterManager deleteNodePool Sample", + "origin": "API_DEFINITION", + "description": " Deletes a node pool from a cluster.", + "canonical": true, + "file": "cluster_manager.delete_node_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteNodePool", + "fullName": "google.container.v1beta1.ClusterManager.DeleteNodePool", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "DeleteNodePool", + "fullName": "google.container.v1beta1.ClusterManager.DeleteNodePool", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_CompleteNodePoolUpgrade_async", + "title": "ClusterManager completeNodePoolUpgrade Sample", + "origin": "API_DEFINITION", + "description": " CompleteNodePoolUpgrade will signal an on-going node pool upgrade to complete.", + "canonical": true, + "file": "cluster_manager.complete_node_pool_upgrade.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CompleteNodePoolUpgrade", + "fullName": "google.container.v1beta1.ClusterManager.CompleteNodePoolUpgrade", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "CompleteNodePoolUpgrade", + "fullName": "google.container.v1beta1.ClusterManager.CompleteNodePoolUpgrade", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_RollbackNodePoolUpgrade_async", + "title": "ClusterManager rollbackNodePoolUpgrade Sample", + "origin": "API_DEFINITION", + "description": " Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last upgrade successfully completed.", + "canonical": true, + "file": "cluster_manager.rollback_node_pool_upgrade.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RollbackNodePoolUpgrade", + "fullName": "google.container.v1beta1.ClusterManager.RollbackNodePoolUpgrade", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "respect_pdb", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "RollbackNodePoolUpgrade", + "fullName": "google.container.v1beta1.ClusterManager.RollbackNodePoolUpgrade", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_SetNodePoolManagement_async", + "title": "ClusterManager setNodePoolManagement Sample", + "origin": "API_DEFINITION", + "description": " Sets the NodeManagement options for a node pool.", + "canonical": true, + "file": "cluster_manager.set_node_pool_management.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetNodePoolManagement", + "fullName": "google.container.v1beta1.ClusterManager.SetNodePoolManagement", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "management", + "type": ".google.container.v1beta1.NodeManagement" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "SetNodePoolManagement", + "fullName": "google.container.v1beta1.ClusterManager.SetNodePoolManagement", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_SetLabels_async", + "title": "ClusterManager setLabels Sample", + "origin": "API_DEFINITION", + "description": " Sets labels on a cluster.", + "canonical": true, + "file": "cluster_manager.set_labels.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetLabels", + "fullName": "google.container.v1beta1.ClusterManager.SetLabels", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "resource_labels", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "label_fingerprint", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "SetLabels", + "fullName": "google.container.v1beta1.ClusterManager.SetLabels", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_SetLegacyAbac_async", + "title": "ClusterManager setLegacyAbac Sample", + "origin": "API_DEFINITION", + "description": " Enables or disables the ABAC authorization mechanism on a cluster.", + "canonical": true, + "file": "cluster_manager.set_legacy_abac.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetLegacyAbac", + "fullName": "google.container.v1beta1.ClusterManager.SetLegacyAbac", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "enabled", + "type": "TYPE_BOOL" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "SetLegacyAbac", + "fullName": "google.container.v1beta1.ClusterManager.SetLegacyAbac", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_StartIPRotation_async", + "title": "ClusterManager startIPRotation Sample", + "origin": "API_DEFINITION", + "description": " Starts master IP rotation.", + "canonical": true, + "file": "cluster_manager.start_i_p_rotation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StartIPRotation", + "fullName": "google.container.v1beta1.ClusterManager.StartIPRotation", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "rotate_credentials", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "StartIPRotation", + "fullName": "google.container.v1beta1.ClusterManager.StartIPRotation", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_CompleteIPRotation_async", + "title": "ClusterManager completeIPRotation Sample", + "origin": "API_DEFINITION", + "description": " Completes master IP rotation.", + "canonical": true, + "file": "cluster_manager.complete_i_p_rotation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CompleteIPRotation", + "fullName": "google.container.v1beta1.ClusterManager.CompleteIPRotation", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "CompleteIPRotation", + "fullName": "google.container.v1beta1.ClusterManager.CompleteIPRotation", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_SetNodePoolSize_async", + "title": "ClusterManager setNodePoolSize Sample", + "origin": "API_DEFINITION", + "description": " SetNodePoolSizeRequest sets the size of a node pool. The new size will be used for all replicas, including future replicas created by modifying [NodePool.locations][google.container.v1beta1.NodePool.locations].", + "canonical": true, + "file": "cluster_manager.set_node_pool_size.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetNodePoolSize", + "fullName": "google.container.v1beta1.ClusterManager.SetNodePoolSize", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "node_count", + "type": "TYPE_INT32" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "SetNodePoolSize", + "fullName": "google.container.v1beta1.ClusterManager.SetNodePoolSize", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_SetNetworkPolicy_async", + "title": "ClusterManager setNetworkPolicy Sample", + "origin": "API_DEFINITION", + "description": " Enables or disables Network Policy for a cluster.", + "canonical": true, + "file": "cluster_manager.set_network_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetNetworkPolicy", + "fullName": "google.container.v1beta1.ClusterManager.SetNetworkPolicy", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "network_policy", + "type": ".google.container.v1beta1.NetworkPolicy" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "SetNetworkPolicy", + "fullName": "google.container.v1beta1.ClusterManager.SetNetworkPolicy", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_SetMaintenancePolicy_async", + "title": "ClusterManager setMaintenancePolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the maintenance policy for a cluster.", + "canonical": true, + "file": "cluster_manager.set_maintenance_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetMaintenancePolicy", + "fullName": "google.container.v1beta1.ClusterManager.SetMaintenancePolicy", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "maintenance_policy", + "type": ".google.container.v1beta1.MaintenancePolicy" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.Operation", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "SetMaintenancePolicy", + "fullName": "google.container.v1beta1.ClusterManager.SetMaintenancePolicy", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_ListUsableSubnetworks_async", + "title": "ClusterManager listUsableSubnetworks Sample", + "origin": "API_DEFINITION", + "description": " Lists subnetworks that can be used for creating clusters in a project.", + "canonical": true, + "file": "cluster_manager.list_usable_subnetworks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListUsableSubnetworks", + "fullName": "google.container.v1beta1.ClusterManager.ListUsableSubnetworks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.ListUsableSubnetworksResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "ListUsableSubnetworks", + "fullName": "google.container.v1beta1.ClusterManager.ListUsableSubnetworks", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_CheckAutopilotCompatibility_async", + "title": "ClusterManager checkAutopilotCompatibility Sample", + "origin": "API_DEFINITION", + "description": " Checks the cluster compatibility with Autopilot mode, and returns a list of compatibility issues.", + "canonical": true, + "file": "cluster_manager.check_autopilot_compatibility.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CheckAutopilotCompatibility", + "fullName": "google.container.v1beta1.ClusterManager.CheckAutopilotCompatibility", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.CheckAutopilotCompatibilityResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "CheckAutopilotCompatibility", + "fullName": "google.container.v1beta1.ClusterManager.CheckAutopilotCompatibility", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_ListLocations_async", + "title": "ClusterManager listLocations Sample", + "origin": "API_DEFINITION", + "description": " Fetches locations that offer Google Kubernetes Engine.", + "canonical": true, + "file": "cluster_manager.list_locations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListLocations", + "fullName": "google.container.v1beta1.ClusterManager.ListLocations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.ListLocationsResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "ListLocations", + "fullName": "google.container.v1beta1.ClusterManager.ListLocations", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-container/v1beta1/src/index.ts b/owl-bot-staging/google-container/v1beta1/src/index.ts new file mode 100644 index 00000000000..44cbef9d2d2 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1beta1 from './v1beta1'; +const ClusterManagerClient = v1beta1.ClusterManagerClient; +type ClusterManagerClient = v1beta1.ClusterManagerClient; +export {v1beta1, ClusterManagerClient}; +export default {v1beta1, ClusterManagerClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client.ts b/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client.ts new file mode 100644 index 00000000000..168ebbd3a99 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client.ts @@ -0,0 +1,3623 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/cluster_manager_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './cluster_manager_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Google Kubernetes Engine Cluster Manager v1beta1 + * @class + * @memberof v1beta1 + */ +export class ClusterManagerClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + clusterManagerStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ClusterManagerClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new ClusterManagerClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ClusterManagerClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listUsableSubnetworks: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'subnetworks') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.container.v1beta1.ClusterManager', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.clusterManagerStub) { + return this.clusterManagerStub; + } + + // Put together the "service stub" for + // google.container.v1beta1.ClusterManager. + this.clusterManagerStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.container.v1beta1.ClusterManager') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.container.v1beta1.ClusterManager, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const clusterManagerStubMethods = + ['listClusters', 'getCluster', 'createCluster', 'updateCluster', 'updateNodePool', 'setNodePoolAutoscaling', 'setLoggingService', 'setMonitoringService', 'setAddonsConfig', 'setLocations', 'updateMaster', 'setMasterAuth', 'deleteCluster', 'listOperations', 'getOperation', 'cancelOperation', 'getServerConfig', 'getJsonWebKeys', 'listNodePools', 'getNodePool', 'createNodePool', 'deleteNodePool', 'completeNodePoolUpgrade', 'rollbackNodePoolUpgrade', 'setNodePoolManagement', 'setLabels', 'setLegacyAbac', 'startIpRotation', 'completeIpRotation', 'setNodePoolSize', 'setNetworkPolicy', 'setMaintenancePolicy', 'listUsableSubnetworks', 'checkAutopilotCompatibility', 'listLocations']; + for (const methodName of clusterManagerStubMethods) { + const callPromise = this.clusterManagerStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.clusterManagerStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'container.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'container.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Lists all clusters owned by a project in either the specified zone or all + * zones. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the parent field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides, or "-" for all zones. This field has been deprecated and + * replaced by the parent field. + * @param {string} request.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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.ListClustersResponse | ListClustersResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.list_clusters.js + * region_tag:container_v1beta1_generated_ClusterManager_ListClusters_async + */ + listClusters( + request?: protos.google.container.v1beta1.IListClustersRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IListClustersResponse, + protos.google.container.v1beta1.IListClustersRequest|undefined, {}|undefined + ]>; + listClusters( + request: protos.google.container.v1beta1.IListClustersRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IListClustersResponse, + protos.google.container.v1beta1.IListClustersRequest|null|undefined, + {}|null|undefined>): void; + listClusters( + request: protos.google.container.v1beta1.IListClustersRequest, + callback: Callback< + protos.google.container.v1beta1.IListClustersResponse, + protos.google.container.v1beta1.IListClustersRequest|null|undefined, + {}|null|undefined>): void; + listClusters( + request?: protos.google.container.v1beta1.IListClustersRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IListClustersResponse, + protos.google.container.v1beta1.IListClustersRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IListClustersResponse, + protos.google.container.v1beta1.IListClustersRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IListClustersResponse, + protos.google.container.v1beta1.IListClustersRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + }); + this.initialize(); + return this.innerApiCalls.listClusters(request, options, callback); + } +/** + * Gets the details for a specific cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to retrieve. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to retrieve. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Cluster | Cluster}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.get_cluster.js + * region_tag:container_v1beta1_generated_ClusterManager_GetCluster_async + */ + getCluster( + request?: protos.google.container.v1beta1.IGetClusterRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.ICluster, + protos.google.container.v1beta1.IGetClusterRequest|undefined, {}|undefined + ]>; + getCluster( + request: protos.google.container.v1beta1.IGetClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.ICluster, + protos.google.container.v1beta1.IGetClusterRequest|null|undefined, + {}|null|undefined>): void; + getCluster( + request: protos.google.container.v1beta1.IGetClusterRequest, + callback: Callback< + protos.google.container.v1beta1.ICluster, + protos.google.container.v1beta1.IGetClusterRequest|null|undefined, + {}|null|undefined>): void; + getCluster( + request?: protos.google.container.v1beta1.IGetClusterRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.ICluster, + protos.google.container.v1beta1.IGetClusterRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.ICluster, + protos.google.container.v1beta1.IGetClusterRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.ICluster, + protos.google.container.v1beta1.IGetClusterRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.getCluster(request, options, callback); + } +/** + * 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](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). + * + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the parent field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the parent + * field. + * @param {google.container.v1beta1.Cluster} request.cluster + * Required. A [cluster + * resource](https://cloud.google.com/container-engine/reference/rest/v1beta1/projects.locations.clusters) + * @param {string} request.parent + * The parent (project and location) where the cluster will be created. + * Specified in the format `projects/* /locations/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.create_cluster.js + * region_tag:container_v1beta1_generated_ClusterManager_CreateCluster_async + */ + createCluster( + request?: protos.google.container.v1beta1.ICreateClusterRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICreateClusterRequest|undefined, {}|undefined + ]>; + createCluster( + request: protos.google.container.v1beta1.ICreateClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICreateClusterRequest|null|undefined, + {}|null|undefined>): void; + createCluster( + request: protos.google.container.v1beta1.ICreateClusterRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICreateClusterRequest|null|undefined, + {}|null|undefined>): void; + createCluster( + request?: protos.google.container.v1beta1.ICreateClusterRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICreateClusterRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICreateClusterRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICreateClusterRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + }); + this.initialize(); + return this.innerApiCalls.createCluster(request, options, callback); + } +/** + * Updates the settings for a specific cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {google.container.v1beta1.ClusterUpdate} request.update + * Required. A description of the update. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to update. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.update_cluster.js + * region_tag:container_v1beta1_generated_ClusterManager_UpdateCluster_async + */ + updateCluster( + request?: protos.google.container.v1beta1.IUpdateClusterRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateClusterRequest|undefined, {}|undefined + ]>; + updateCluster( + request: protos.google.container.v1beta1.IUpdateClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateClusterRequest|null|undefined, + {}|null|undefined>): void; + updateCluster( + request: protos.google.container.v1beta1.IUpdateClusterRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateClusterRequest|null|undefined, + {}|null|undefined>): void; + updateCluster( + request?: protos.google.container.v1beta1.IUpdateClusterRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateClusterRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateClusterRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateClusterRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateCluster(request, options, callback); + } +/** + * Updates the version and/or image type of a specific node pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Required. Deprecated. The name of the node pool to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodeVersion + * 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 + * @param {string} request.imageType + * Required. The desired image type for the node pool. Please see + * https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for + * available image types. + * @param {string[]} request.locations + * The desired list of Google Compute Engine + * [zones](https://cloud.google.com/compute/docs/zones#available) in which the + * node pool's nodes should be located. Changing the locations for a node pool + * will result in nodes being either created or removed from the node pool, + * depending on whether locations are being added or removed. + * @param {google.container.v1beta1.WorkloadMetadataConfig} request.workloadMetadataConfig + * The desired workload metadata config for the node pool. + * @param {string} request.name + * The name (project, location, cluster, node pool) of the node pool to + * update. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {google.container.v1beta1.NodePool.UpgradeSettings} request.upgradeSettings + * Upgrade settings control disruption and speed of the upgrade. + * @param {google.container.v1beta1.NetworkTags} request.tags + * The desired network tags to be applied to all nodes in the node pool. + * If this field is not present, the tags will not be changed. Otherwise, + * the existing network tags will be *replaced* with the provided tags. + * @param {google.container.v1beta1.NodeTaints} request.taints + * The desired node taints to be applied to all nodes in the node pool. + * If this field is not present, the taints will not be changed. Otherwise, + * the existing node taints will be *replaced* with the provided taints. + * @param {google.container.v1beta1.NodeLabels} request.labels + * The desired node labels to be applied to all nodes in the node pool. + * If this field is not present, the labels will not be changed. Otherwise, + * the existing node labels will be *replaced* with the provided labels. + * @param {google.container.v1beta1.LinuxNodeConfig} request.linuxNodeConfig + * Parameters that can be configured on Linux nodes. + * @param {google.container.v1beta1.NodeKubeletConfig} request.kubeletConfig + * Node kubelet configs. + * @param {google.container.v1beta1.NodeNetworkConfig} request.nodeNetworkConfig + * Node network config. + * @param {google.container.v1beta1.GcfsConfig} request.gcfsConfig + * GCFS config. + * @param {google.container.v1beta1.ConfidentialNodes} request.confidentialNodes + * Confidential nodes config. + * All the nodes in the node pool will be Confidential VM once enabled. + * @param {google.container.v1beta1.VirtualNIC} request.gvnic + * Enable or disable gvnic on the node pool. + * @param {string} request.etag + * The current etag of the node pool. + * If an etag is provided and does not match the current etag of the node + * pool, update will be blocked and an ABORTED error will be returned. + * @param {google.container.v1beta1.FastSocket} request.fastSocket + * Enable or disable NCCL fast socket for the node pool. + * @param {google.container.v1beta1.NodePoolLoggingConfig} request.loggingConfig + * Logging configuration. + * @param {google.container.v1beta1.ResourceLabels} request.resourceLabels + * The resource labels for the node pool to use to annotate any related + * Google Compute Engine resources. + * @param {google.container.v1beta1.WindowsNodeConfig} request.windowsNodeConfig + * Parameters that can be configured on Windows nodes. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.update_node_pool.js + * region_tag:container_v1beta1_generated_ClusterManager_UpdateNodePool_async + */ + updateNodePool( + request?: protos.google.container.v1beta1.IUpdateNodePoolRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateNodePoolRequest|undefined, {}|undefined + ]>; + updateNodePool( + request: protos.google.container.v1beta1.IUpdateNodePoolRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateNodePoolRequest|null|undefined, + {}|null|undefined>): void; + updateNodePool( + request: protos.google.container.v1beta1.IUpdateNodePoolRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateNodePoolRequest|null|undefined, + {}|null|undefined>): void; + updateNodePool( + request?: protos.google.container.v1beta1.IUpdateNodePoolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateNodePoolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateNodePoolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateNodePoolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateNodePool(request, options, callback); + } +/** + * Sets the autoscaling settings of a specific node pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Required. Deprecated. The name of the node pool to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {google.container.v1beta1.NodePoolAutoscaling} request.autoscaling + * Required. Autoscaling configuration for the node pool. + * @param {string} request.name + * The name (project, location, cluster, node pool) of the node pool to set + * autoscaler settings. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.set_node_pool_autoscaling.js + * region_tag:container_v1beta1_generated_ClusterManager_SetNodePoolAutoscaling_async + */ + setNodePoolAutoscaling( + request?: protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest|undefined, {}|undefined + ]>; + setNodePoolAutoscaling( + request: protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest|null|undefined, + {}|null|undefined>): void; + setNodePoolAutoscaling( + request: protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest|null|undefined, + {}|null|undefined>): void; + setNodePoolAutoscaling( + request?: protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setNodePoolAutoscaling(request, options, callback); + } +/** + * Sets the logging service for a specific cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string} request.loggingService + * Required. The logging service the cluster should use to write logs. + * Currently available options: + * + * * `logging.googleapis.com/kubernetes` - The Cloud Logging + * service with a Kubernetes-native resource model + * * `logging.googleapis.com` - The legacy Cloud Logging service (no longer + * available as of GKE 1.15). + * * `none` - no logs will be exported from the cluster. + * + * If left as an empty string,`logging.googleapis.com/kubernetes` will be + * used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to set logging. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.set_logging_service.js + * region_tag:container_v1beta1_generated_ClusterManager_SetLoggingService_async + */ + setLoggingService( + request?: protos.google.container.v1beta1.ISetLoggingServiceRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLoggingServiceRequest|undefined, {}|undefined + ]>; + setLoggingService( + request: protos.google.container.v1beta1.ISetLoggingServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLoggingServiceRequest|null|undefined, + {}|null|undefined>): void; + setLoggingService( + request: protos.google.container.v1beta1.ISetLoggingServiceRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLoggingServiceRequest|null|undefined, + {}|null|undefined>): void; + setLoggingService( + request?: protos.google.container.v1beta1.ISetLoggingServiceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLoggingServiceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLoggingServiceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLoggingServiceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setLoggingService(request, options, callback); + } +/** + * Sets the monitoring service for a specific cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string} request.monitoringService + * Required. The monitoring service the cluster should use to write metrics. + * Currently available options: + * + * * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring + * service with a Kubernetes-native resource model + * * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no + * longer available as of GKE 1.15). + * * `none` - No metrics will be exported from the cluster. + * + * If left as an empty string,`monitoring.googleapis.com/kubernetes` will be + * used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to set monitoring. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.set_monitoring_service.js + * region_tag:container_v1beta1_generated_ClusterManager_SetMonitoringService_async + */ + setMonitoringService( + request?: protos.google.container.v1beta1.ISetMonitoringServiceRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMonitoringServiceRequest|undefined, {}|undefined + ]>; + setMonitoringService( + request: protos.google.container.v1beta1.ISetMonitoringServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMonitoringServiceRequest|null|undefined, + {}|null|undefined>): void; + setMonitoringService( + request: protos.google.container.v1beta1.ISetMonitoringServiceRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMonitoringServiceRequest|null|undefined, + {}|null|undefined>): void; + setMonitoringService( + request?: protos.google.container.v1beta1.ISetMonitoringServiceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMonitoringServiceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMonitoringServiceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMonitoringServiceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setMonitoringService(request, options, callback); + } +/** + * Sets the addons for a specific cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {google.container.v1beta1.AddonsConfig} request.addonsConfig + * Required. The desired configurations for the various addons available to + * run in the cluster. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to set addons. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.set_addons_config.js + * region_tag:container_v1beta1_generated_ClusterManager_SetAddonsConfig_async + */ + setAddonsConfig( + request?: protos.google.container.v1beta1.ISetAddonsConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetAddonsConfigRequest|undefined, {}|undefined + ]>; + setAddonsConfig( + request: protos.google.container.v1beta1.ISetAddonsConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetAddonsConfigRequest|null|undefined, + {}|null|undefined>): void; + setAddonsConfig( + request: protos.google.container.v1beta1.ISetAddonsConfigRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetAddonsConfigRequest|null|undefined, + {}|null|undefined>): void; + setAddonsConfig( + request?: protos.google.container.v1beta1.ISetAddonsConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetAddonsConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetAddonsConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetAddonsConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setAddonsConfig(request, options, callback); + } +/** + * Sets the locations for a specific cluster. + * Deprecated. Use + * [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters/update) + * instead. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string[]} request.locations + * Required. The desired list of Google Compute Engine + * [zones](https://cloud.google.com/compute/docs/zones#available) 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. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to set locations. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.set_locations.js + * region_tag:container_v1beta1_generated_ClusterManager_SetLocations_async + * @deprecated SetLocations is deprecated and may be removed in a future version. + */ + setLocations( + request?: protos.google.container.v1beta1.ISetLocationsRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLocationsRequest|undefined, {}|undefined + ]>; + setLocations( + request: protos.google.container.v1beta1.ISetLocationsRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLocationsRequest|null|undefined, + {}|null|undefined>): void; + setLocations( + request: protos.google.container.v1beta1.ISetLocationsRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLocationsRequest|null|undefined, + {}|null|undefined>): void; + setLocations( + request?: protos.google.container.v1beta1.ISetLocationsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLocationsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLocationsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLocationsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + this.warn('DEP$ClusterManager-$SetLocations','SetLocations is deprecated and may be removed in a future version.', 'DeprecationWarning'); + return this.innerApiCalls.setLocations(request, options, callback); + } +/** + * Updates the master for a specific cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {string} request.masterVersion + * 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 + * @param {string} request.name + * The name (project, location, cluster) of the cluster to update. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.update_master.js + * region_tag:container_v1beta1_generated_ClusterManager_UpdateMaster_async + */ + updateMaster( + request?: protos.google.container.v1beta1.IUpdateMasterRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateMasterRequest|undefined, {}|undefined + ]>; + updateMaster( + request: protos.google.container.v1beta1.IUpdateMasterRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateMasterRequest|null|undefined, + {}|null|undefined>): void; + updateMaster( + request: protos.google.container.v1beta1.IUpdateMasterRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateMasterRequest|null|undefined, + {}|null|undefined>): void; + updateMaster( + request?: protos.google.container.v1beta1.IUpdateMasterRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateMasterRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateMasterRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IUpdateMasterRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateMaster(request, options, callback); + } +/** + * Sets master auth materials. Currently supports changing the admin password + * or a specific cluster, either via password generation or explicitly setting + * the password. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to upgrade. + * This field has been deprecated and replaced by the name field. + * @param {google.container.v1beta1.SetMasterAuthRequest.Action} request.action + * Required. The exact form of action to be taken on the master auth. + * @param {google.container.v1beta1.MasterAuth} request.update + * Required. A description of the update. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to set auth. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.set_master_auth.js + * region_tag:container_v1beta1_generated_ClusterManager_SetMasterAuth_async + */ + setMasterAuth( + request?: protos.google.container.v1beta1.ISetMasterAuthRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMasterAuthRequest|undefined, {}|undefined + ]>; + setMasterAuth( + request: protos.google.container.v1beta1.ISetMasterAuthRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMasterAuthRequest|null|undefined, + {}|null|undefined>): void; + setMasterAuth( + request: protos.google.container.v1beta1.ISetMasterAuthRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMasterAuthRequest|null|undefined, + {}|null|undefined>): void; + setMasterAuth( + request?: protos.google.container.v1beta1.ISetMasterAuthRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMasterAuthRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMasterAuthRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMasterAuthRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setMasterAuth(request, options, callback); + } +/** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to delete. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to delete. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.delete_cluster.js + * region_tag:container_v1beta1_generated_ClusterManager_DeleteCluster_async + */ + deleteCluster( + request?: protos.google.container.v1beta1.IDeleteClusterRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IDeleteClusterRequest|undefined, {}|undefined + ]>; + deleteCluster( + request: protos.google.container.v1beta1.IDeleteClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IDeleteClusterRequest|null|undefined, + {}|null|undefined>): void; + deleteCluster( + request: protos.google.container.v1beta1.IDeleteClusterRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IDeleteClusterRequest|null|undefined, + {}|null|undefined>): void; + deleteCluster( + request?: protos.google.container.v1beta1.IDeleteClusterRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IDeleteClusterRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IDeleteClusterRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IDeleteClusterRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteCluster(request, options, callback); + } +/** + * Lists all operations in a project in the specified zone or all zones. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the parent field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) to return + * operations for, or `-` for all zones. This field has been deprecated and + * replaced by the parent field. + * @param {string} request.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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.ListOperationsResponse | ListOperationsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.list_operations.js + * region_tag:container_v1beta1_generated_ClusterManager_ListOperations_async + */ + listOperations( + request?: protos.google.container.v1beta1.IListOperationsRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IListOperationsResponse, + protos.google.container.v1beta1.IListOperationsRequest|undefined, {}|undefined + ]>; + listOperations( + request: protos.google.container.v1beta1.IListOperationsRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IListOperationsResponse, + protos.google.container.v1beta1.IListOperationsRequest|null|undefined, + {}|null|undefined>): void; + listOperations( + request: protos.google.container.v1beta1.IListOperationsRequest, + callback: Callback< + protos.google.container.v1beta1.IListOperationsResponse, + protos.google.container.v1beta1.IListOperationsRequest|null|undefined, + {}|null|undefined>): void; + listOperations( + request?: protos.google.container.v1beta1.IListOperationsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IListOperationsResponse, + protos.google.container.v1beta1.IListOperationsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IListOperationsResponse, + protos.google.container.v1beta1.IListOperationsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IListOperationsResponse, + protos.google.container.v1beta1.IListOperationsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + }); + this.initialize(); + return this.innerApiCalls.listOperations(request, options, callback); + } +/** + * Gets the specified operation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.operationId + * Required. Deprecated. The server-assigned `name` of the operation. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, operation id) of the operation to get. + * Specified in the format `projects/* /locations/* /operations/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.get_operation.js + * region_tag:container_v1beta1_generated_ClusterManager_GetOperation_async + */ + getOperation( + request?: protos.google.container.v1beta1.IGetOperationRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IGetOperationRequest|undefined, {}|undefined + ]>; + getOperation( + request: protos.google.container.v1beta1.IGetOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IGetOperationRequest|null|undefined, + {}|null|undefined>): void; + getOperation( + request: protos.google.container.v1beta1.IGetOperationRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IGetOperationRequest|null|undefined, + {}|null|undefined>): void; + getOperation( + request?: protos.google.container.v1beta1.IGetOperationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IGetOperationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IGetOperationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IGetOperationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'operation_id': request.operationId ?? '', + }); + this.initialize(); + return this.innerApiCalls.getOperation(request, options, callback); + } +/** + * Cancels the specified operation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * operation resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.operationId + * Required. Deprecated. The server-assigned `name` of the operation. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, operation id) of the operation to cancel. + * Specified in the format `projects/* /locations/* /operations/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.cancel_operation.js + * region_tag:container_v1beta1_generated_ClusterManager_CancelOperation_async + */ + cancelOperation( + request?: protos.google.container.v1beta1.ICancelOperationRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.container.v1beta1.ICancelOperationRequest|undefined, {}|undefined + ]>; + cancelOperation( + request: protos.google.container.v1beta1.ICancelOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1beta1.ICancelOperationRequest|null|undefined, + {}|null|undefined>): void; + cancelOperation( + request: protos.google.container.v1beta1.ICancelOperationRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1beta1.ICancelOperationRequest|null|undefined, + {}|null|undefined>): void; + cancelOperation( + request?: protos.google.container.v1beta1.ICancelOperationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1beta1.ICancelOperationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1beta1.ICancelOperationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.container.v1beta1.ICancelOperationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'operation_id': request.operationId ?? '', + }); + this.initialize(); + return this.innerApiCalls.cancelOperation(request, options, callback); + } +/** + * Returns configuration info about the Google Kubernetes Engine service. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) to return + * operations for. This field has been deprecated and replaced by the name + * field. + * @param {string} request.name + * The name (project and location) of the server config to get, + * specified in the format `projects/* /locations/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.ServerConfig | ServerConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.get_server_config.js + * region_tag:container_v1beta1_generated_ClusterManager_GetServerConfig_async + */ + getServerConfig( + request?: protos.google.container.v1beta1.IGetServerConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IServerConfig, + protos.google.container.v1beta1.IGetServerConfigRequest|undefined, {}|undefined + ]>; + getServerConfig( + request: protos.google.container.v1beta1.IGetServerConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IServerConfig, + protos.google.container.v1beta1.IGetServerConfigRequest|null|undefined, + {}|null|undefined>): void; + getServerConfig( + request: protos.google.container.v1beta1.IGetServerConfigRequest, + callback: Callback< + protos.google.container.v1beta1.IServerConfig, + protos.google.container.v1beta1.IGetServerConfigRequest|null|undefined, + {}|null|undefined>): void; + getServerConfig( + request?: protos.google.container.v1beta1.IGetServerConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IServerConfig, + protos.google.container.v1beta1.IGetServerConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IServerConfig, + protos.google.container.v1beta1.IGetServerConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IServerConfig, + protos.google.container.v1beta1.IGetServerConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + }); + this.initialize(); + return this.innerApiCalls.getServerConfig(request, options, callback); + } +/** + * Gets the public component of the cluster signing keys in + * JSON Web Key format. + * This API is not yet intended for general use, and is not available for all + * clusters. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The cluster (project, location, cluster name) to get keys for. Specified in + * the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.GetJSONWebKeysResponse | GetJSONWebKeysResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.get_j_s_o_n_web_keys.js + * region_tag:container_v1beta1_generated_ClusterManager_GetJSONWebKeys_async + */ + getJSONWebKeys( + request?: protos.google.container.v1beta1.IGetJSONWebKeysRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IGetJSONWebKeysResponse, + protos.google.container.v1beta1.IGetJSONWebKeysRequest|undefined, {}|undefined + ]>; + getJSONWebKeys( + request: protos.google.container.v1beta1.IGetJSONWebKeysRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IGetJSONWebKeysResponse, + protos.google.container.v1beta1.IGetJSONWebKeysRequest|null|undefined, + {}|null|undefined>): void; + getJSONWebKeys( + request: protos.google.container.v1beta1.IGetJSONWebKeysRequest, + callback: Callback< + protos.google.container.v1beta1.IGetJSONWebKeysResponse, + protos.google.container.v1beta1.IGetJSONWebKeysRequest|null|undefined, + {}|null|undefined>): void; + getJSONWebKeys( + request?: protos.google.container.v1beta1.IGetJSONWebKeysRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IGetJSONWebKeysResponse, + protos.google.container.v1beta1.IGetJSONWebKeysRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IGetJSONWebKeysResponse, + protos.google.container.v1beta1.IGetJSONWebKeysRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IGetJSONWebKeysResponse, + protos.google.container.v1beta1.IGetJSONWebKeysRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.getJsonWebKeys(request, options, callback); + } +/** + * Lists the node pools for a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the parent field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the parent + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the parent field. + * @param {string} request.parent + * The parent (project, location, cluster name) where the node pools will be + * listed. Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.ListNodePoolsResponse | ListNodePoolsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.list_node_pools.js + * region_tag:container_v1beta1_generated_ClusterManager_ListNodePools_async + */ + listNodePools( + request?: protos.google.container.v1beta1.IListNodePoolsRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IListNodePoolsResponse, + protos.google.container.v1beta1.IListNodePoolsRequest|undefined, {}|undefined + ]>; + listNodePools( + request: protos.google.container.v1beta1.IListNodePoolsRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IListNodePoolsResponse, + protos.google.container.v1beta1.IListNodePoolsRequest|null|undefined, + {}|null|undefined>): void; + listNodePools( + request: protos.google.container.v1beta1.IListNodePoolsRequest, + callback: Callback< + protos.google.container.v1beta1.IListNodePoolsResponse, + protos.google.container.v1beta1.IListNodePoolsRequest|null|undefined, + {}|null|undefined>): void; + listNodePools( + request?: protos.google.container.v1beta1.IListNodePoolsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IListNodePoolsResponse, + protos.google.container.v1beta1.IListNodePoolsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IListNodePoolsResponse, + protos.google.container.v1beta1.IListNodePoolsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IListNodePoolsResponse, + protos.google.container.v1beta1.IListNodePoolsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.listNodePools(request, options, callback); + } +/** + * Retrieves the requested node pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Required. Deprecated. The name of the node pool. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster, node pool id) of the node pool to + * get. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.NodePool | NodePool}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.get_node_pool.js + * region_tag:container_v1beta1_generated_ClusterManager_GetNodePool_async + */ + getNodePool( + request?: protos.google.container.v1beta1.IGetNodePoolRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.INodePool, + protos.google.container.v1beta1.IGetNodePoolRequest|undefined, {}|undefined + ]>; + getNodePool( + request: protos.google.container.v1beta1.IGetNodePoolRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.INodePool, + protos.google.container.v1beta1.IGetNodePoolRequest|null|undefined, + {}|null|undefined>): void; + getNodePool( + request: protos.google.container.v1beta1.IGetNodePoolRequest, + callback: Callback< + protos.google.container.v1beta1.INodePool, + protos.google.container.v1beta1.IGetNodePoolRequest|null|undefined, + {}|null|undefined>): void; + getNodePool( + request?: protos.google.container.v1beta1.IGetNodePoolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.INodePool, + protos.google.container.v1beta1.IGetNodePoolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.INodePool, + protos.google.container.v1beta1.IGetNodePoolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.INodePool, + protos.google.container.v1beta1.IGetNodePoolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.getNodePool(request, options, callback); + } +/** + * Creates a node pool for a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the parent field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the parent + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the parent field. + * @param {google.container.v1beta1.NodePool} request.nodePool + * Required. The node pool to create. + * @param {string} request.parent + * The parent (project, location, cluster name) where the node pool will be + * created. Specified in the format + * `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.create_node_pool.js + * region_tag:container_v1beta1_generated_ClusterManager_CreateNodePool_async + */ + createNodePool( + request?: protos.google.container.v1beta1.ICreateNodePoolRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICreateNodePoolRequest|undefined, {}|undefined + ]>; + createNodePool( + request: protos.google.container.v1beta1.ICreateNodePoolRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICreateNodePoolRequest|null|undefined, + {}|null|undefined>): void; + createNodePool( + request: protos.google.container.v1beta1.ICreateNodePoolRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICreateNodePoolRequest|null|undefined, + {}|null|undefined>): void; + createNodePool( + request?: protos.google.container.v1beta1.ICreateNodePoolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICreateNodePoolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICreateNodePoolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICreateNodePoolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.createNodePool(request, options, callback); + } +/** + * Deletes a node pool from a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Required. Deprecated. The name of the node pool to delete. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster, node pool id) of the node pool to + * delete. Specified in the format + * `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.delete_node_pool.js + * region_tag:container_v1beta1_generated_ClusterManager_DeleteNodePool_async + */ + deleteNodePool( + request?: protos.google.container.v1beta1.IDeleteNodePoolRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IDeleteNodePoolRequest|undefined, {}|undefined + ]>; + deleteNodePool( + request: protos.google.container.v1beta1.IDeleteNodePoolRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IDeleteNodePoolRequest|null|undefined, + {}|null|undefined>): void; + deleteNodePool( + request: protos.google.container.v1beta1.IDeleteNodePoolRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IDeleteNodePoolRequest|null|undefined, + {}|null|undefined>): void; + deleteNodePool( + request?: protos.google.container.v1beta1.IDeleteNodePoolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IDeleteNodePoolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IDeleteNodePoolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IDeleteNodePoolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteNodePool(request, options, callback); + } +/** + * CompleteNodePoolUpgrade will signal an on-going node pool upgrade to + * complete. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The name (project, location, cluster, node pool id) of the node pool to + * complete upgrade. + * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.complete_node_pool_upgrade.js + * region_tag:container_v1beta1_generated_ClusterManager_CompleteNodePoolUpgrade_async + */ + completeNodePoolUpgrade( + request?: protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest|undefined, {}|undefined + ]>; + completeNodePoolUpgrade( + request: protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>): void; + completeNodePoolUpgrade( + request: protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>): void; + completeNodePoolUpgrade( + request?: protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.completeNodePoolUpgrade(request, options, callback); + } +/** + * Rolls back a previously Aborted or Failed NodePool upgrade. + * This makes no changes if the last upgrade successfully completed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to rollback. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Required. Deprecated. The name of the node pool to rollback. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster, node pool id) of the node poll to + * rollback upgrade. + * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {boolean} request.respectPdb + * Option for rollback to ignore the PodDisruptionBudget. + * Default value is false. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.rollback_node_pool_upgrade.js + * region_tag:container_v1beta1_generated_ClusterManager_RollbackNodePoolUpgrade_async + */ + rollbackNodePoolUpgrade( + request?: protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest|undefined, {}|undefined + ]>; + rollbackNodePoolUpgrade( + request: protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>): void; + rollbackNodePoolUpgrade( + request: protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>): void; + rollbackNodePoolUpgrade( + request?: protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.rollbackNodePoolUpgrade(request, options, callback); + } +/** + * Sets the NodeManagement options for a node pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to update. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Required. Deprecated. The name of the node pool to update. + * This field has been deprecated and replaced by the name field. + * @param {google.container.v1beta1.NodeManagement} request.management + * Required. NodeManagement configuration for the node pool. + * @param {string} request.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/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.set_node_pool_management.js + * region_tag:container_v1beta1_generated_ClusterManager_SetNodePoolManagement_async + */ + setNodePoolManagement( + request?: protos.google.container.v1beta1.ISetNodePoolManagementRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolManagementRequest|undefined, {}|undefined + ]>; + setNodePoolManagement( + request: protos.google.container.v1beta1.ISetNodePoolManagementRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolManagementRequest|null|undefined, + {}|null|undefined>): void; + setNodePoolManagement( + request: protos.google.container.v1beta1.ISetNodePoolManagementRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolManagementRequest|null|undefined, + {}|null|undefined>): void; + setNodePoolManagement( + request?: protos.google.container.v1beta1.ISetNodePoolManagementRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolManagementRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolManagementRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolManagementRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setNodePoolManagement(request, options, callback); + } +/** + * Sets labels on a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the name field. + * @param {number[]} request.resourceLabels + * Required. The labels to set for that cluster. + * @param {string} request.labelFingerprint + * 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. + * @param {string} request.name + * The name (project, location, cluster name) of the cluster to set labels. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.set_labels.js + * region_tag:container_v1beta1_generated_ClusterManager_SetLabels_async + */ + setLabels( + request?: protos.google.container.v1beta1.ISetLabelsRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLabelsRequest|undefined, {}|undefined + ]>; + setLabels( + request: protos.google.container.v1beta1.ISetLabelsRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLabelsRequest|null|undefined, + {}|null|undefined>): void; + setLabels( + request: protos.google.container.v1beta1.ISetLabelsRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLabelsRequest|null|undefined, + {}|null|undefined>): void; + setLabels( + request?: protos.google.container.v1beta1.ISetLabelsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLabelsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLabelsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLabelsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setLabels(request, options, callback); + } +/** + * Enables or disables the ABAC authorization mechanism on a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to update. + * This field has been deprecated and replaced by the name field. + * @param {boolean} request.enabled + * Required. Whether ABAC authorization will be enabled in the cluster. + * @param {string} request.name + * The name (project, location, cluster name) of the cluster to set legacy + * abac. Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.set_legacy_abac.js + * region_tag:container_v1beta1_generated_ClusterManager_SetLegacyAbac_async + */ + setLegacyAbac( + request?: protos.google.container.v1beta1.ISetLegacyAbacRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLegacyAbacRequest|undefined, {}|undefined + ]>; + setLegacyAbac( + request: protos.google.container.v1beta1.ISetLegacyAbacRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLegacyAbacRequest|null|undefined, + {}|null|undefined>): void; + setLegacyAbac( + request: protos.google.container.v1beta1.ISetLegacyAbacRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLegacyAbacRequest|null|undefined, + {}|null|undefined>): void; + setLegacyAbac( + request?: protos.google.container.v1beta1.ISetLegacyAbacRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLegacyAbacRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLegacyAbacRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetLegacyAbacRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setLegacyAbac(request, options, callback); + } +/** + * Starts master IP rotation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster name) of the cluster to start IP + * rotation. Specified in the format `projects/* /locations/* /clusters/*`. + * @param {boolean} request.rotateCredentials + * Whether to rotate credentials during IP rotation. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.start_i_p_rotation.js + * region_tag:container_v1beta1_generated_ClusterManager_StartIPRotation_async + */ + startIPRotation( + request?: protos.google.container.v1beta1.IStartIPRotationRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IStartIPRotationRequest|undefined, {}|undefined + ]>; + startIPRotation( + request: protos.google.container.v1beta1.IStartIPRotationRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IStartIPRotationRequest|null|undefined, + {}|null|undefined>): void; + startIPRotation( + request: protos.google.container.v1beta1.IStartIPRotationRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IStartIPRotationRequest|null|undefined, + {}|null|undefined>): void; + startIPRotation( + request?: protos.google.container.v1beta1.IStartIPRotationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IStartIPRotationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IStartIPRotationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.IStartIPRotationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.startIpRotation(request, options, callback); + } +/** + * Completes master IP rotation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the name field. + * @param {string} request.name + * The name (project, location, cluster name) of the cluster to complete IP + * rotation. Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.complete_i_p_rotation.js + * region_tag:container_v1beta1_generated_ClusterManager_CompleteIPRotation_async + */ + completeIPRotation( + request?: protos.google.container.v1beta1.ICompleteIPRotationRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICompleteIPRotationRequest|undefined, {}|undefined + ]>; + completeIPRotation( + request: protos.google.container.v1beta1.ICompleteIPRotationRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICompleteIPRotationRequest|null|undefined, + {}|null|undefined>): void; + completeIPRotation( + request: protos.google.container.v1beta1.ICompleteIPRotationRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICompleteIPRotationRequest|null|undefined, + {}|null|undefined>): void; + completeIPRotation( + request?: protos.google.container.v1beta1.ICompleteIPRotationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICompleteIPRotationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICompleteIPRotationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ICompleteIPRotationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.completeIpRotation(request, options, callback); + } +/** + * SetNodePoolSizeRequest sets the size of a node pool. The new size will be + * used for all replicas, including future replicas created by modifying + * {@link google.container.v1beta1.NodePool.locations|NodePool.locations}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster to update. + * This field has been deprecated and replaced by the name field. + * @param {string} request.nodePoolId + * Required. Deprecated. The name of the node pool to update. + * This field has been deprecated and replaced by the name field. + * @param {number} request.nodeCount + * Required. The desired node count for the pool. + * @param {string} request.name + * The name (project, location, cluster, node pool id) of the node pool to set + * size. + * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.set_node_pool_size.js + * region_tag:container_v1beta1_generated_ClusterManager_SetNodePoolSize_async + */ + setNodePoolSize( + request?: protos.google.container.v1beta1.ISetNodePoolSizeRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolSizeRequest|undefined, {}|undefined + ]>; + setNodePoolSize( + request: protos.google.container.v1beta1.ISetNodePoolSizeRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolSizeRequest|null|undefined, + {}|null|undefined>): void; + setNodePoolSize( + request: protos.google.container.v1beta1.ISetNodePoolSizeRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolSizeRequest|null|undefined, + {}|null|undefined>): void; + setNodePoolSize( + request?: protos.google.container.v1beta1.ISetNodePoolSizeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolSizeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolSizeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNodePoolSizeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + 'node_pool_id': request.nodePoolId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setNodePoolSize(request, options, callback); + } +/** + * Enables or disables Network Policy for a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Deprecated. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * This field has been deprecated and replaced by the name field. + * @param {string} request.zone + * Required. Deprecated. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. This field has been deprecated and replaced by the name + * field. + * @param {string} request.clusterId + * Required. Deprecated. The name of the cluster. + * This field has been deprecated and replaced by the name field. + * @param {google.container.v1beta1.NetworkPolicy} request.networkPolicy + * Required. Configuration options for the NetworkPolicy feature. + * @param {string} request.name + * The name (project, location, cluster name) of the cluster to set networking + * policy. Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.set_network_policy.js + * region_tag:container_v1beta1_generated_ClusterManager_SetNetworkPolicy_async + */ + setNetworkPolicy( + request?: protos.google.container.v1beta1.ISetNetworkPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNetworkPolicyRequest|undefined, {}|undefined + ]>; + setNetworkPolicy( + request: protos.google.container.v1beta1.ISetNetworkPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNetworkPolicyRequest|null|undefined, + {}|null|undefined>): void; + setNetworkPolicy( + request: protos.google.container.v1beta1.ISetNetworkPolicyRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNetworkPolicyRequest|null|undefined, + {}|null|undefined>): void; + setNetworkPolicy( + request?: protos.google.container.v1beta1.ISetNetworkPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNetworkPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNetworkPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetNetworkPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setNetworkPolicy(request, options, callback); + } +/** + * Sets the maintenance policy for a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The Google Developers Console [project ID or project + * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + * @param {string} request.zone + * Required. The name of the Google Compute Engine + * [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * cluster resides. + * @param {string} request.clusterId + * Required. The name of the cluster to update. + * @param {google.container.v1beta1.MaintenancePolicy} request.maintenancePolicy + * Required. The maintenance policy to be set for the cluster. An empty field + * clears the existing maintenance policy. + * @param {string} request.name + * The name (project, location, cluster name) of the cluster to set + * maintenance policy. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.set_maintenance_policy.js + * region_tag:container_v1beta1_generated_ClusterManager_SetMaintenancePolicy_async + */ + setMaintenancePolicy( + request?: protos.google.container.v1beta1.ISetMaintenancePolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMaintenancePolicyRequest|undefined, {}|undefined + ]>; + setMaintenancePolicy( + request: protos.google.container.v1beta1.ISetMaintenancePolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMaintenancePolicyRequest|null|undefined, + {}|null|undefined>): void; + setMaintenancePolicy( + request: protos.google.container.v1beta1.ISetMaintenancePolicyRequest, + callback: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMaintenancePolicyRequest|null|undefined, + {}|null|undefined>): void; + setMaintenancePolicy( + request?: protos.google.container.v1beta1.ISetMaintenancePolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMaintenancePolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMaintenancePolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IOperation, + protos.google.container.v1beta1.ISetMaintenancePolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + 'project_id': request.projectId ?? '', + 'zone': request.zone ?? '', + 'cluster_id': request.clusterId ?? '', + }); + this.initialize(); + return this.innerApiCalls.setMaintenancePolicy(request, options, callback); + } +/** + * Checks the cluster compatibility with Autopilot mode, and returns a list of + * compatibility issues. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to retrieve. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.CheckAutopilotCompatibilityResponse | CheckAutopilotCompatibilityResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js + * region_tag:container_v1beta1_generated_ClusterManager_CheckAutopilotCompatibility_async + */ + checkAutopilotCompatibility( + request?: protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, + protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest|undefined, {}|undefined + ]>; + checkAutopilotCompatibility( + request: protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, + protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest|null|undefined, + {}|null|undefined>): void; + checkAutopilotCompatibility( + request: protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest, + callback: Callback< + protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, + protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest|null|undefined, + {}|null|undefined>): void; + checkAutopilotCompatibility( + request?: protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, + protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, + protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, + protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.checkAutopilotCompatibility(request, options, callback); + } +/** + * Fetches locations that offer Google Kubernetes Engine. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Contains the name of the resource requested. + * Specified in the format `projects/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.container.v1beta1.ListLocationsResponse | ListLocationsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.list_locations.js + * region_tag:container_v1beta1_generated_ClusterManager_ListLocations_async + */ + listLocations( + request?: protos.google.container.v1beta1.IListLocationsRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IListLocationsResponse, + protos.google.container.v1beta1.IListLocationsRequest|undefined, {}|undefined + ]>; + listLocations( + request: protos.google.container.v1beta1.IListLocationsRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.IListLocationsResponse, + protos.google.container.v1beta1.IListLocationsRequest|null|undefined, + {}|null|undefined>): void; + listLocations( + request: protos.google.container.v1beta1.IListLocationsRequest, + callback: Callback< + protos.google.container.v1beta1.IListLocationsResponse, + protos.google.container.v1beta1.IListLocationsRequest|null|undefined, + {}|null|undefined>): void; + listLocations( + request?: protos.google.container.v1beta1.IListLocationsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.container.v1beta1.IListLocationsResponse, + protos.google.container.v1beta1.IListLocationsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.container.v1beta1.IListLocationsResponse, + protos.google.container.v1beta1.IListLocationsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.container.v1beta1.IListLocationsResponse, + protos.google.container.v1beta1.IListLocationsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listLocations(request, options, callback); + } + + /** + * Lists subnetworks that can be used for creating clusters in a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent project where subnetworks are usable. + * Specified in the format `projects/*`. + * @param {string} request.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. + * @param {number} request.pageSize + * 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) + * @param {string} request.pageToken + * Specifies a page token to use. Set this to the nextPageToken returned by + * previous list requests to get the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.container.v1beta1.UsableSubnetwork | UsableSubnetwork}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listUsableSubnetworksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listUsableSubnetworks( + request?: protos.google.container.v1beta1.IListUsableSubnetworksRequest, + options?: CallOptions): + Promise<[ + protos.google.container.v1beta1.IUsableSubnetwork[], + protos.google.container.v1beta1.IListUsableSubnetworksRequest|null, + protos.google.container.v1beta1.IListUsableSubnetworksResponse + ]>; + listUsableSubnetworks( + request: protos.google.container.v1beta1.IListUsableSubnetworksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.container.v1beta1.IListUsableSubnetworksRequest, + protos.google.container.v1beta1.IListUsableSubnetworksResponse|null|undefined, + protos.google.container.v1beta1.IUsableSubnetwork>): void; + listUsableSubnetworks( + request: protos.google.container.v1beta1.IListUsableSubnetworksRequest, + callback: PaginationCallback< + protos.google.container.v1beta1.IListUsableSubnetworksRequest, + protos.google.container.v1beta1.IListUsableSubnetworksResponse|null|undefined, + protos.google.container.v1beta1.IUsableSubnetwork>): void; + listUsableSubnetworks( + request?: protos.google.container.v1beta1.IListUsableSubnetworksRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.container.v1beta1.IListUsableSubnetworksRequest, + protos.google.container.v1beta1.IListUsableSubnetworksResponse|null|undefined, + protos.google.container.v1beta1.IUsableSubnetwork>, + callback?: PaginationCallback< + protos.google.container.v1beta1.IListUsableSubnetworksRequest, + protos.google.container.v1beta1.IListUsableSubnetworksResponse|null|undefined, + protos.google.container.v1beta1.IUsableSubnetwork>): + Promise<[ + protos.google.container.v1beta1.IUsableSubnetwork[], + protos.google.container.v1beta1.IListUsableSubnetworksRequest|null, + protos.google.container.v1beta1.IListUsableSubnetworksResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listUsableSubnetworks(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent project where subnetworks are usable. + * Specified in the format `projects/*`. + * @param {string} request.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. + * @param {number} request.pageSize + * 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) + * @param {string} request.pageToken + * Specifies a page token to use. Set this to the nextPageToken returned by + * previous list requests to get the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.container.v1beta1.UsableSubnetwork | UsableSubnetwork} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listUsableSubnetworksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listUsableSubnetworksStream( + request?: protos.google.container.v1beta1.IListUsableSubnetworksRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUsableSubnetworks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listUsableSubnetworks.createStream( + this.innerApiCalls.listUsableSubnetworks as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listUsableSubnetworks`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent project where subnetworks are usable. + * Specified in the format `projects/*`. + * @param {string} request.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. + * @param {number} request.pageSize + * 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) + * @param {string} request.pageToken + * Specifies a page token to use. Set this to the nextPageToken returned by + * previous list requests to get the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.container.v1beta1.UsableSubnetwork | UsableSubnetwork}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.list_usable_subnetworks.js + * region_tag:container_v1beta1_generated_ClusterManager_ListUsableSubnetworks_async + */ + listUsableSubnetworksAsync( + request?: protos.google.container.v1beta1.IListUsableSubnetworksRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUsableSubnetworks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listUsableSubnetworks.asyncIterate( + this.innerApiCalls['listUsableSubnetworks'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.clusterManagerStub && !this._terminated) { + return this.clusterManagerStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client_config.json b/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client_config.json new file mode 100644 index 00000000000..911352f9362 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client_config.json @@ -0,0 +1,198 @@ +{ + "interfaces": { + "google.container.v1beta1.ClusterManager": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListClusters": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetCluster": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateCluster": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCluster": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateNodePool": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetNodePoolAutoscaling": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLoggingService": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetMonitoringService": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetAddonsConfig": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLocations": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateMaster": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetMasterAuth": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCluster": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListOperations": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetOperation": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CancelOperation": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetServerConfig": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetJSONWebKeys": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListNodePools": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetNodePool": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateNodePool": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteNodePool": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CompleteNodePoolUpgrade": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RollbackNodePoolUpgrade": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetNodePoolManagement": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLabels": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLegacyAbac": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StartIPRotation": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CompleteIPRotation": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetNodePoolSize": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetNetworkPolicy": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetMaintenancePolicy": { + "timeout_millis": 45000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListUsableSubnetworks": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CheckAutopilotCompatibility": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListLocations": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_proto_list.json b/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_proto_list.json new file mode 100644 index 00000000000..7a594ccf698 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/container/v1beta1/cluster_service.proto" +] diff --git a/owl-bot-staging/google-container/v1beta1/src/v1beta1/gapic_metadata.json b/owl-bot-staging/google-container/v1beta1/src/v1beta1/gapic_metadata.json new file mode 100644 index 00000000000..0278af900c2 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/src/v1beta1/gapic_metadata.json @@ -0,0 +1,377 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.container.v1beta1", + "libraryPackage": "@google-cloud/container", + "services": { + "ClusterManager": { + "clients": { + "grpc": { + "libraryClient": "ClusterManagerClient", + "rpcs": { + "ListClusters": { + "methods": [ + "listClusters" + ] + }, + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "UpdateNodePool": { + "methods": [ + "updateNodePool" + ] + }, + "SetNodePoolAutoscaling": { + "methods": [ + "setNodePoolAutoscaling" + ] + }, + "SetLoggingService": { + "methods": [ + "setLoggingService" + ] + }, + "SetMonitoringService": { + "methods": [ + "setMonitoringService" + ] + }, + "SetAddonsConfig": { + "methods": [ + "setAddonsConfig" + ] + }, + "SetLocations": { + "methods": [ + "setLocations" + ] + }, + "UpdateMaster": { + "methods": [ + "updateMaster" + ] + }, + "SetMasterAuth": { + "methods": [ + "setMasterAuth" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "ListOperations": { + "methods": [ + "listOperations" + ] + }, + "GetOperation": { + "methods": [ + "getOperation" + ] + }, + "CancelOperation": { + "methods": [ + "cancelOperation" + ] + }, + "GetServerConfig": { + "methods": [ + "getServerConfig" + ] + }, + "GetJSONWebKeys": { + "methods": [ + "getJSONWebKeys" + ] + }, + "ListNodePools": { + "methods": [ + "listNodePools" + ] + }, + "GetNodePool": { + "methods": [ + "getNodePool" + ] + }, + "CreateNodePool": { + "methods": [ + "createNodePool" + ] + }, + "DeleteNodePool": { + "methods": [ + "deleteNodePool" + ] + }, + "CompleteNodePoolUpgrade": { + "methods": [ + "completeNodePoolUpgrade" + ] + }, + "RollbackNodePoolUpgrade": { + "methods": [ + "rollbackNodePoolUpgrade" + ] + }, + "SetNodePoolManagement": { + "methods": [ + "setNodePoolManagement" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "SetLegacyAbac": { + "methods": [ + "setLegacyAbac" + ] + }, + "StartIPRotation": { + "methods": [ + "startIPRotation" + ] + }, + "CompleteIPRotation": { + "methods": [ + "completeIPRotation" + ] + }, + "SetNodePoolSize": { + "methods": [ + "setNodePoolSize" + ] + }, + "SetNetworkPolicy": { + "methods": [ + "setNetworkPolicy" + ] + }, + "SetMaintenancePolicy": { + "methods": [ + "setMaintenancePolicy" + ] + }, + "CheckAutopilotCompatibility": { + "methods": [ + "checkAutopilotCompatibility" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + }, + "ListUsableSubnetworks": { + "methods": [ + "listUsableSubnetworks", + "listUsableSubnetworksStream", + "listUsableSubnetworksAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ClusterManagerClient", + "rpcs": { + "ListClusters": { + "methods": [ + "listClusters" + ] + }, + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "UpdateNodePool": { + "methods": [ + "updateNodePool" + ] + }, + "SetNodePoolAutoscaling": { + "methods": [ + "setNodePoolAutoscaling" + ] + }, + "SetLoggingService": { + "methods": [ + "setLoggingService" + ] + }, + "SetMonitoringService": { + "methods": [ + "setMonitoringService" + ] + }, + "SetAddonsConfig": { + "methods": [ + "setAddonsConfig" + ] + }, + "SetLocations": { + "methods": [ + "setLocations" + ] + }, + "UpdateMaster": { + "methods": [ + "updateMaster" + ] + }, + "SetMasterAuth": { + "methods": [ + "setMasterAuth" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "ListOperations": { + "methods": [ + "listOperations" + ] + }, + "GetOperation": { + "methods": [ + "getOperation" + ] + }, + "CancelOperation": { + "methods": [ + "cancelOperation" + ] + }, + "GetServerConfig": { + "methods": [ + "getServerConfig" + ] + }, + "GetJSONWebKeys": { + "methods": [ + "getJSONWebKeys" + ] + }, + "ListNodePools": { + "methods": [ + "listNodePools" + ] + }, + "GetNodePool": { + "methods": [ + "getNodePool" + ] + }, + "CreateNodePool": { + "methods": [ + "createNodePool" + ] + }, + "DeleteNodePool": { + "methods": [ + "deleteNodePool" + ] + }, + "CompleteNodePoolUpgrade": { + "methods": [ + "completeNodePoolUpgrade" + ] + }, + "RollbackNodePoolUpgrade": { + "methods": [ + "rollbackNodePoolUpgrade" + ] + }, + "SetNodePoolManagement": { + "methods": [ + "setNodePoolManagement" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "SetLegacyAbac": { + "methods": [ + "setLegacyAbac" + ] + }, + "StartIPRotation": { + "methods": [ + "startIPRotation" + ] + }, + "CompleteIPRotation": { + "methods": [ + "completeIPRotation" + ] + }, + "SetNodePoolSize": { + "methods": [ + "setNodePoolSize" + ] + }, + "SetNetworkPolicy": { + "methods": [ + "setNetworkPolicy" + ] + }, + "SetMaintenancePolicy": { + "methods": [ + "setMaintenancePolicy" + ] + }, + "CheckAutopilotCompatibility": { + "methods": [ + "checkAutopilotCompatibility" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + }, + "ListUsableSubnetworks": { + "methods": [ + "listUsableSubnetworks", + "listUsableSubnetworksStream", + "listUsableSubnetworksAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-container/v1beta1/src/v1beta1/index.ts b/owl-bot-staging/google-container/v1beta1/src/v1beta1/index.ts new file mode 100644 index 00000000000..b1b39233034 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/src/v1beta1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {ClusterManagerClient} from './cluster_manager_client'; diff --git a/owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..1101d781caa --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const container = require('@google-cloud/container'); + +function main() { + const clusterManagerClient = new container.ClusterManagerClient(); +} + +main(); diff --git a/owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..6685b8649e6 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {ClusterManagerClient} from '@google-cloud/container'; + +// check that the client class type name can be used +function doStuffWithClusterManagerClient(client: ClusterManagerClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const clusterManagerClient = new ClusterManagerClient(); + doStuffWithClusterManagerClient(clusterManagerClient); +} + +main(); diff --git a/owl-bot-staging/google-container/v1beta1/system-test/install.ts b/owl-bot-staging/google-container/v1beta1/system-test/install.ts new file mode 100644 index 00000000000..c8f81b25a86 --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-container/v1beta1/test/gapic_cluster_manager_v1beta1.ts b/owl-bot-staging/google-container/v1beta1/test/gapic_cluster_manager_v1beta1.ts new file mode 100644 index 00000000000..7f93f752f2c --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/test/gapic_cluster_manager_v1beta1.ts @@ -0,0 +1,5238 @@ +// Copyright 2023 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as clustermanagerModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta1.ClusterManagerClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = clustermanagerModule.v1beta1.ClusterManagerClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = clustermanagerModule.v1beta1.ClusterManagerClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = clustermanagerModule.v1beta1.ClusterManagerClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.clusterManagerStub, undefined); + await client.initialize(); + assert(client.clusterManagerStub); + }); + + it('has close method for the initialized client', done => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.clusterManagerStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.clusterManagerStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('listClusters', () => { + it('invokes listClusters without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.ListClustersResponse() + ); + client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); + const [response] = await client.listClusters(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.ListClustersResponse() + ); + client.innerApiCalls.listClusters = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listClusters( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IListClustersResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listClusters = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listClusters(request), expectedError); + const actualRequest = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['zone']); + request.zone = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listClusters(request), expectedError); + }); + }); + + describe('getCluster', () => { + it('invokes getCluster without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Cluster() + ); + client.innerApiCalls.getCluster = stubSimpleCall(expectedResponse); + const [response] = await client.getCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Cluster() + ); + client.innerApiCalls.getCluster = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCluster( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.ICluster|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCluster = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCluster(request), expectedError); + }); + }); + + describe('createCluster', () => { + it('invokes createCluster without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.createCluster = stubSimpleCall(expectedResponse); + const [response] = await client.createCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.createCluster = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCluster( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCluster = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['zone']); + request.zone = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createCluster(request), expectedError); + }); + }); + + describe('updateCluster', () => { + it('invokes updateCluster without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.UpdateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.updateCluster = stubSimpleCall(expectedResponse); + const [response] = await client.updateCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.UpdateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.updateCluster = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCluster( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.UpdateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCluster = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.UpdateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateCluster(request), expectedError); + }); + }); + + describe('updateNodePool', () => { + it('invokes updateNodePool without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.UpdateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.updateNodePool = stubSimpleCall(expectedResponse); + const [response] = await client.updateNodePool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateNodePool without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.UpdateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.updateNodePool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateNodePool( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateNodePool with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.UpdateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateNodePool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateNodePool(request), expectedError); + const actualRequest = (client.innerApiCalls.updateNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateNodePool with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.UpdateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateNodePool(request), expectedError); + }); + }); + + describe('setNodePoolAutoscaling', () => { + it('invokes setNodePoolAutoscaling without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNodePoolAutoscalingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCall(expectedResponse); + const [response] = await client.setNodePoolAutoscaling(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolAutoscaling without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNodePoolAutoscalingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setNodePoolAutoscaling( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolAutoscaling with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNodePoolAutoscalingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setNodePoolAutoscaling(request), expectedError); + const actualRequest = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolAutoscaling with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNodePoolAutoscalingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setNodePoolAutoscaling(request), expectedError); + }); + }); + + describe('setLoggingService', () => { + it('invokes setLoggingService without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLoggingServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setLoggingService = stubSimpleCall(expectedResponse); + const [response] = await client.setLoggingService(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLoggingService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLoggingService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLoggingService without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLoggingServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setLoggingService = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLoggingService( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLoggingService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLoggingService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLoggingService with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLoggingServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setLoggingService = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLoggingService(request), expectedError); + const actualRequest = (client.innerApiCalls.setLoggingService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLoggingService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLoggingService with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLoggingServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setLoggingService(request), expectedError); + }); + }); + + describe('setMonitoringService', () => { + it('invokes setMonitoringService without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetMonitoringServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setMonitoringService = stubSimpleCall(expectedResponse); + const [response] = await client.setMonitoringService(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMonitoringService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMonitoringService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMonitoringService without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetMonitoringServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setMonitoringService = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setMonitoringService( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMonitoringService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMonitoringService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMonitoringService with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetMonitoringServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setMonitoringService = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setMonitoringService(request), expectedError); + const actualRequest = (client.innerApiCalls.setMonitoringService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMonitoringService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMonitoringService with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetMonitoringServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setMonitoringService(request), expectedError); + }); + }); + + describe('setAddonsConfig', () => { + it('invokes setAddonsConfig without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetAddonsConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setAddonsConfig = stubSimpleCall(expectedResponse); + const [response] = await client.setAddonsConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setAddonsConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setAddonsConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setAddonsConfig without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetAddonsConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setAddonsConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setAddonsConfig( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setAddonsConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setAddonsConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setAddonsConfig with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetAddonsConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setAddonsConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setAddonsConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.setAddonsConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setAddonsConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setAddonsConfig with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetAddonsConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setAddonsConfig(request), expectedError); + }); + }); + + describe('setLocations', () => { + it('invokes setLocations without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLocationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setLocations = stubSimpleCall(expectedResponse); + const [response] = await client.setLocations(request); + assert(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLocations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLocations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLocations without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLocationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setLocations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLocations( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLocations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLocations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLocations with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLocationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setLocations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLocations(request), expectedError); + assert(stub.calledOnce); + const actualRequest = (client.innerApiCalls.setLocations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLocations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLocations with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLocationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setLocations(request), expectedError); + assert(stub.calledOnce); + }); + }); + + describe('updateMaster', () => { + it('invokes updateMaster without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.UpdateMasterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.updateMaster = stubSimpleCall(expectedResponse); + const [response] = await client.updateMaster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateMaster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMaster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMaster without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.UpdateMasterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.updateMaster = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateMaster( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateMaster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMaster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMaster with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.UpdateMasterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMaster = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateMaster(request), expectedError); + const actualRequest = (client.innerApiCalls.updateMaster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMaster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMaster with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.UpdateMasterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateMaster(request), expectedError); + }); + }); + + describe('setMasterAuth', () => { + it('invokes setMasterAuth without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetMasterAuthRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setMasterAuth = stubSimpleCall(expectedResponse); + const [response] = await client.setMasterAuth(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMasterAuth as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMasterAuth as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMasterAuth without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetMasterAuthRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setMasterAuth = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setMasterAuth( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMasterAuth as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMasterAuth as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMasterAuth with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetMasterAuthRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setMasterAuth = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setMasterAuth(request), expectedError); + const actualRequest = (client.innerApiCalls.setMasterAuth as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMasterAuth as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMasterAuth with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetMasterAuthRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setMasterAuth(request), expectedError); + }); + }); + + describe('deleteCluster', () => { + it('invokes deleteCluster without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.deleteCluster = stubSimpleCall(expectedResponse); + const [response] = await client.deleteCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.deleteCluster = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCluster( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCluster = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteCluster(request), expectedError); + }); + }); + + describe('listOperations', () => { + it('invokes listOperations without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.ListOperationsResponse() + ); + client.innerApiCalls.listOperations = stubSimpleCall(expectedResponse); + const [response] = await client.listOperations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOperations without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.ListOperationsResponse() + ); + client.innerApiCalls.listOperations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listOperations( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IListOperationsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOperations with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listOperations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listOperations(request), expectedError); + const actualRequest = (client.innerApiCalls.listOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOperations with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['zone']); + request.zone = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listOperations(request), expectedError); + }); + }); + + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.getOperation = stubSimpleCall(expectedResponse); + const [response] = await client.getOperation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOperation without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.getOperation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getOperation( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOperation with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getOperation(request), expectedError); + const actualRequest = (client.innerApiCalls.getOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOperation with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getOperation(request), expectedError); + }); + }); + + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CancelOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelOperation = stubSimpleCall(expectedResponse); + const [response] = await client.cancelOperation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelOperation without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CancelOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelOperation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelOperation( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelOperation with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CancelOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelOperation(request), expectedError); + const actualRequest = (client.innerApiCalls.cancelOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelOperation with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CancelOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['operationId']); + request.operationId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelOperation(request), expectedError); + }); + }); + + describe('getServerConfig', () => { + it('invokes getServerConfig without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetServerConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.ServerConfig() + ); + client.innerApiCalls.getServerConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getServerConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getServerConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getServerConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getServerConfig without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetServerConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.ServerConfig() + ); + client.innerApiCalls.getServerConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getServerConfig( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IServerConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getServerConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getServerConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getServerConfig with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetServerConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['zone']); + request.zone = defaultValue3; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getServerConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getServerConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.getServerConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getServerConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getServerConfig with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetServerConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['zone']); + request.zone = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getServerConfig(request), expectedError); + }); + }); + + describe('getJSONWebKeys', () => { + it('invokes getJSONWebKeys without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetJSONWebKeysRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetJSONWebKeysRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.GetJSONWebKeysResponse() + ); + client.innerApiCalls.getJsonWebKeys = stubSimpleCall(expectedResponse); + const [response] = await client.getJSONWebKeys(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJsonWebKeys as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJsonWebKeys as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJSONWebKeys without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetJSONWebKeysRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetJSONWebKeysRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.GetJSONWebKeysResponse() + ); + client.innerApiCalls.getJsonWebKeys = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getJSONWebKeys( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IGetJSONWebKeysResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJsonWebKeys as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJsonWebKeys as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJSONWebKeys with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetJSONWebKeysRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetJSONWebKeysRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getJsonWebKeys = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getJSONWebKeys(request), expectedError); + const actualRequest = (client.innerApiCalls.getJsonWebKeys as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJsonWebKeys as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJSONWebKeys with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetJSONWebKeysRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetJSONWebKeysRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getJSONWebKeys(request), expectedError); + }); + }); + + describe('listNodePools', () => { + it('invokes listNodePools without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListNodePoolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.ListNodePoolsResponse() + ); + client.innerApiCalls.listNodePools = stubSimpleCall(expectedResponse); + const [response] = await client.listNodePools(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listNodePools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listNodePools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNodePools without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListNodePoolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.ListNodePoolsResponse() + ); + client.innerApiCalls.listNodePools = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listNodePools( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IListNodePoolsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listNodePools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listNodePools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNodePools with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListNodePoolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listNodePools = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listNodePools(request), expectedError); + const actualRequest = (client.innerApiCalls.listNodePools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listNodePools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNodePools with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListNodePoolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listNodePools(request), expectedError); + }); + }); + + describe('getNodePool', () => { + it('invokes getNodePool without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.NodePool() + ); + client.innerApiCalls.getNodePool = stubSimpleCall(expectedResponse); + const [response] = await client.getNodePool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNodePool without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.NodePool() + ); + client.innerApiCalls.getNodePool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getNodePool( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.INodePool|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNodePool with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getNodePool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getNodePool(request), expectedError); + const actualRequest = (client.innerApiCalls.getNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNodePool with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.GetNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getNodePool(request), expectedError); + }); + }); + + describe('createNodePool', () => { + it('invokes createNodePool without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CreateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.createNodePool = stubSimpleCall(expectedResponse); + const [response] = await client.createNodePool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNodePool without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CreateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.createNodePool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createNodePool( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNodePool with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CreateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createNodePool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createNodePool(request), expectedError); + const actualRequest = (client.innerApiCalls.createNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNodePool with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CreateNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['parent']); + request.parent = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createNodePool(request), expectedError); + }); + }); + + describe('deleteNodePool', () => { + it('invokes deleteNodePool without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.DeleteNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.deleteNodePool = stubSimpleCall(expectedResponse); + const [response] = await client.deleteNodePool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNodePool without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.DeleteNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.deleteNodePool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteNodePool( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNodePool with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.DeleteNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteNodePool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteNodePool(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteNodePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteNodePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNodePool with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.DeleteNodePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteNodePool(request), expectedError); + }); + }); + + describe('completeNodePoolUpgrade', () => { + it('invokes completeNodePoolUpgrade without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CompleteNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CompleteNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.completeNodePoolUpgrade = stubSimpleCall(expectedResponse); + const [response] = await client.completeNodePoolUpgrade(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeNodePoolUpgrade without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CompleteNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CompleteNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.completeNodePoolUpgrade = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.completeNodePoolUpgrade( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeNodePoolUpgrade with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CompleteNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CompleteNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.completeNodePoolUpgrade = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.completeNodePoolUpgrade(request), expectedError); + const actualRequest = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeNodePoolUpgrade with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CompleteNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CompleteNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.completeNodePoolUpgrade(request), expectedError); + }); + }); + + describe('rollbackNodePoolUpgrade', () => { + it('invokes rollbackNodePoolUpgrade without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.RollbackNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCall(expectedResponse); + const [response] = await client.rollbackNodePoolUpgrade(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackNodePoolUpgrade without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.RollbackNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.rollbackNodePoolUpgrade( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackNodePoolUpgrade with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.RollbackNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.rollbackNodePoolUpgrade(request), expectedError); + const actualRequest = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackNodePoolUpgrade with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.RollbackNodePoolUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.rollbackNodePoolUpgrade(request), expectedError); + }); + }); + + describe('setNodePoolManagement', () => { + it('invokes setNodePoolManagement without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNodePoolManagementRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setNodePoolManagement = stubSimpleCall(expectedResponse); + const [response] = await client.setNodePoolManagement(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNodePoolManagement as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolManagement as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolManagement without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNodePoolManagementRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setNodePoolManagement = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setNodePoolManagement( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNodePoolManagement as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolManagement as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolManagement with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNodePoolManagementRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setNodePoolManagement = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setNodePoolManagement(request), expectedError); + const actualRequest = (client.innerApiCalls.setNodePoolManagement as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolManagement as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolManagement with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNodePoolManagementRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setNodePoolManagement(request), expectedError); + }); + }); + + describe('setLabels', () => { + it('invokes setLabels without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLabelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); + const [response] = await client.setLabels(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLabels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLabels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLabels without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLabelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setLabels = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLabels( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLabels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLabels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLabels with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLabelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setLabels = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLabels(request), expectedError); + const actualRequest = (client.innerApiCalls.setLabels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLabels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLabels with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLabelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setLabels(request), expectedError); + }); + }); + + describe('setLegacyAbac', () => { + it('invokes setLegacyAbac without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLegacyAbacRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setLegacyAbac = stubSimpleCall(expectedResponse); + const [response] = await client.setLegacyAbac(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLegacyAbac as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLegacyAbac as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLegacyAbac without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLegacyAbacRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setLegacyAbac = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLegacyAbac( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setLegacyAbac as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLegacyAbac as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLegacyAbac with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLegacyAbacRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setLegacyAbac = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLegacyAbac(request), expectedError); + const actualRequest = (client.innerApiCalls.setLegacyAbac as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setLegacyAbac as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setLegacyAbac with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetLegacyAbacRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setLegacyAbac(request), expectedError); + }); + }); + + describe('startIPRotation', () => { + it('invokes startIPRotation without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.StartIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.startIpRotation = stubSimpleCall(expectedResponse); + const [response] = await client.startIPRotation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.startIpRotation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startIpRotation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startIPRotation without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.StartIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.startIpRotation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.startIPRotation( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.startIpRotation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startIpRotation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startIPRotation with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.StartIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startIpRotation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.startIPRotation(request), expectedError); + const actualRequest = (client.innerApiCalls.startIpRotation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startIpRotation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startIPRotation with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.StartIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.startIPRotation(request), expectedError); + }); + }); + + describe('completeIPRotation', () => { + it('invokes completeIPRotation without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CompleteIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.completeIpRotation = stubSimpleCall(expectedResponse); + const [response] = await client.completeIPRotation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.completeIpRotation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeIpRotation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeIPRotation without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CompleteIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.completeIpRotation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.completeIPRotation( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.completeIpRotation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeIpRotation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeIPRotation with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CompleteIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.completeIpRotation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.completeIPRotation(request), expectedError); + const actualRequest = (client.innerApiCalls.completeIpRotation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeIpRotation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeIPRotation with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CompleteIPRotationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.completeIPRotation(request), expectedError); + }); + }); + + describe('setNodePoolSize', () => { + it('invokes setNodePoolSize without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNodePoolSizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setNodePoolSize = stubSimpleCall(expectedResponse); + const [response] = await client.setNodePoolSize(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNodePoolSize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolSize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolSize without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNodePoolSizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setNodePoolSize = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setNodePoolSize( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNodePoolSize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolSize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolSize with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNodePoolSizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setNodePoolSize = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setNodePoolSize(request), expectedError); + const actualRequest = (client.innerApiCalls.setNodePoolSize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolSize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNodePoolSize with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNodePoolSizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['clusterId']); + request.clusterId = defaultValue4; + const defaultValue5 = + getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['nodePoolId']); + request.nodePoolId = defaultValue5; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setNodePoolSize(request), expectedError); + }); + }); + + describe('setNetworkPolicy', () => { + it('invokes setNetworkPolicy without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNetworkPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setNetworkPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setNetworkPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNetworkPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNetworkPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNetworkPolicy without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNetworkPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setNetworkPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setNetworkPolicy( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setNetworkPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNetworkPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNetworkPolicy with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNetworkPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setNetworkPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setNetworkPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.setNetworkPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setNetworkPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setNetworkPolicy with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetNetworkPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setNetworkPolicy(request), expectedError); + }); + }); + + describe('setMaintenancePolicy', () => { + it('invokes setMaintenancePolicy without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetMaintenancePolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setMaintenancePolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setMaintenancePolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMaintenancePolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMaintenancePolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMaintenancePolicy without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetMaintenancePolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.Operation() + ); + client.innerApiCalls.setMaintenancePolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setMaintenancePolicy( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMaintenancePolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMaintenancePolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMaintenancePolicy with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetMaintenancePolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setMaintenancePolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setMaintenancePolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.setMaintenancePolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setMaintenancePolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMaintenancePolicy with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.SetMaintenancePolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['name']); + request.name = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['projectId']); + request.projectId = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['zone']); + request.zone = defaultValue3; + const defaultValue4 = + getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['clusterId']); + request.clusterId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setMaintenancePolicy(request), expectedError); + }); + }); + + describe('checkAutopilotCompatibility', () => { + it('invokes checkAutopilotCompatibility without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CheckAutopilotCompatibilityRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CheckAutopilotCompatibilityRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.CheckAutopilotCompatibilityResponse() + ); + client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCall(expectedResponse); + const [response] = await client.checkAutopilotCompatibility(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAutopilotCompatibility without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CheckAutopilotCompatibilityRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CheckAutopilotCompatibilityRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.CheckAutopilotCompatibilityResponse() + ); + client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.checkAutopilotCompatibility( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAutopilotCompatibility with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CheckAutopilotCompatibilityRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CheckAutopilotCompatibilityRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkAutopilotCompatibility(request), expectedError); + const actualRequest = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAutopilotCompatibility with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CheckAutopilotCompatibilityRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.CheckAutopilotCompatibilityRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.checkAutopilotCompatibility(request), expectedError); + }); + }); + + describe('listLocations', () => { + it('invokes listLocations without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListLocationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListLocationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.ListLocationsResponse() + ); + client.innerApiCalls.listLocations = stubSimpleCall(expectedResponse); + const [response] = await client.listLocations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listLocations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listLocations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLocations without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListLocationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListLocationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.ListLocationsResponse() + ); + client.innerApiCalls.listLocations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listLocations( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IListLocationsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listLocations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listLocations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLocations with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListLocationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListLocationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listLocations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listLocations(request), expectedError); + const actualRequest = (client.innerApiCalls.listLocations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listLocations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLocations with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListLocationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListLocationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listLocations(request), expectedError); + }); + }); + + describe('listUsableSubnetworks', () => { + it('invokes listUsableSubnetworks without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), + ]; + client.innerApiCalls.listUsableSubnetworks = stubSimpleCall(expectedResponse); + const [response] = await client.listUsableSubnetworks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUsableSubnetworks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUsableSubnetworks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsableSubnetworks without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), + ]; + client.innerApiCalls.listUsableSubnetworks = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listUsableSubnetworks( + request, + (err?: Error|null, result?: protos.google.container.v1beta1.IUsableSubnetwork[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUsableSubnetworks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUsableSubnetworks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsableSubnetworks with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listUsableSubnetworks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listUsableSubnetworks(request), expectedError); + const actualRequest = (client.innerApiCalls.listUsableSubnetworks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUsableSubnetworks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsableSubnetworksStream without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), + ]; + client.descriptors.page.listUsableSubnetworks.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listUsableSubnetworksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.container.v1beta1.UsableSubnetwork[] = []; + stream.on('data', (response: protos.google.container.v1beta1.UsableSubnetwork) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUsableSubnetworks, request)); + assert( + (client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listUsableSubnetworksStream with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listUsableSubnetworks.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listUsableSubnetworksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.container.v1beta1.UsableSubnetwork[] = []; + stream.on('data', (response: protos.google.container.v1beta1.UsableSubnetwork) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUsableSubnetworks, request)); + assert( + (client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUsableSubnetworks without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), + generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), + ]; + client.descriptors.page.listUsableSubnetworks.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.container.v1beta1.IUsableSubnetwork[] = []; + const iterable = client.listUsableSubnetworksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUsableSubnetworks with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.ListUsableSubnetworksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listUsableSubnetworks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listUsableSubnetworksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.container.v1beta1.IUsableSubnetwork[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); +}); diff --git a/owl-bot-staging/google-container/v1beta1/tsconfig.json b/owl-bot-staging/google-container/v1beta1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/google-container/v1beta1/webpack.config.js b/owl-bot-staging/google-container/v1beta1/webpack.config.js new file mode 100644 index 00000000000..9032271af9d --- /dev/null +++ b/owl-bot-staging/google-container/v1beta1/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 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. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'ClusterManager', + filename: './cluster-manager.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; From 6228b11c40086c36e3c909af18619407124f4e44 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 12 Jul 2023 20:05:59 +0000 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../google-container/v1/.eslintignore | 7 - .../google-container/v1/.eslintrc.json | 3 - .../google-container/v1/.gitignore | 14 - owl-bot-staging/google-container/v1/.jsdoc.js | 55 - .../google-container/v1/.mocharc.js | 33 - .../google-container/v1/.prettierrc.js | 22 - owl-bot-staging/google-container/v1/README.md | 1 - .../v1/linkinator.config.json | 16 - .../google-container/v1/package.json | 64 - .../google/container/v1/cluster_service.proto | 5156 --------------- .../v1/cluster_manager.cancel_operation.js | 61 - ...r_manager.check_autopilot_compatibility.js | 61 - .../cluster_manager.complete_i_p_rotation.js | 61 - ...ster_manager.complete_node_pool_upgrade.js | 62 - .../v1/cluster_manager.create_cluster.js | 67 - .../v1/cluster_manager.create_node_pool.js | 67 - .../v1/cluster_manager.delete_cluster.js | 61 - .../v1/cluster_manager.delete_node_pool.js | 62 - .../v1/cluster_manager.get_cluster.js | 61 - .../cluster_manager.get_j_s_o_n_web_keys.js | 61 - .../v1/cluster_manager.get_node_pool.js | 62 - .../v1/cluster_manager.get_operation.js | 61 - .../v1/cluster_manager.get_server_config.js | 61 - .../v1/cluster_manager.list_clusters.js | 62 - .../v1/cluster_manager.list_node_pools.js | 61 - .../v1/cluster_manager.list_operations.js | 62 - ...cluster_manager.list_usable_subnetworks.js | 82 - ...ster_manager.rollback_node_pool_upgrade.js | 67 - .../v1/cluster_manager.set_addons_config.js | 67 - .../v1/cluster_manager.set_labels.js | 76 - .../v1/cluster_manager.set_legacy_abac.js | 66 - .../v1/cluster_manager.set_locations.js | 71 - .../v1/cluster_manager.set_logging_service.js | 74 - .../cluster_manager.set_maintenance_policy.js | 86 - .../v1/cluster_manager.set_master_auth.js | 71 - .../cluster_manager.set_monitoring_service.js | 74 - .../v1/cluster_manager.set_network_policy.js | 66 - ...uster_manager.set_node_pool_autoscaling.js | 67 - ...luster_manager.set_node_pool_management.js | 67 - .../v1/cluster_manager.set_node_pool_size.js | 67 - .../v1/cluster_manager.start_i_p_rotation.js | 65 - .../v1/cluster_manager.update_cluster.js | 66 - .../v1/cluster_manager.update_master.js | 73 - .../v1/cluster_manager.update_node_pool.js | 164 - .../snippet_metadata.google.container.v1.json | 1915 ------ .../google-container/v1/src/index.ts | 25 - .../v1/src/v1/cluster_manager_client.ts | 3551 ----------- .../src/v1/cluster_manager_client_config.json | 192 - .../v1/src/v1/cluster_manager_proto_list.json | 3 - .../v1/src/v1/gapic_metadata.json | 367 -- .../google-container/v1/src/v1/index.ts | 19 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - .../v1/system-test/install.ts | 49 - .../v1/test/gapic_cluster_manager_v1.ts | 5130 --------------- .../google-container/v1/tsconfig.json | 19 - .../google-container/v1/webpack.config.js | 64 - .../google-container/v1beta1/.eslintignore | 7 - .../google-container/v1beta1/.eslintrc.json | 3 - .../google-container/v1beta1/.gitignore | 14 - .../google-container/v1beta1/.jsdoc.js | 55 - .../google-container/v1beta1/.mocharc.js | 33 - .../google-container/v1beta1/.prettierrc.js | 22 - .../google-container/v1beta1/README.md | 1 - .../v1beta1/linkinator.config.json | 16 - .../google-container/v1beta1/package.json | 64 - .../container/v1beta1/cluster_service.proto | 5617 ----------------- .../cluster_manager.cancel_operation.js | 64 - ...r_manager.check_autopilot_compatibility.js | 61 - .../cluster_manager.complete_i_p_rotation.js | 64 - ...ster_manager.complete_node_pool_upgrade.js | 62 - .../v1beta1/cluster_manager.create_cluster.js | 69 - .../cluster_manager.create_node_pool.js | 70 - .../v1beta1/cluster_manager.delete_cluster.js | 64 - .../cluster_manager.delete_node_pool.js | 66 - .../v1beta1/cluster_manager.get_cluster.js | 64 - .../cluster_manager.get_j_s_o_n_web_keys.js | 61 - .../v1beta1/cluster_manager.get_node_pool.js | 66 - .../v1beta1/cluster_manager.get_operation.js | 64 - .../cluster_manager.get_server_config.js | 63 - .../v1beta1/cluster_manager.list_clusters.js | 64 - .../v1beta1/cluster_manager.list_locations.js | 62 - .../cluster_manager.list_node_pools.js | 64 - .../cluster_manager.list_operations.js | 64 - ...cluster_manager.list_usable_subnetworks.js | 83 - ...ster_manager.rollback_node_pool_upgrade.js | 71 - .../cluster_manager.set_addons_config.js | 70 - .../v1beta1/cluster_manager.set_labels.js | 79 - .../cluster_manager.set_legacy_abac.js | 69 - .../v1beta1/cluster_manager.set_locations.js | 74 - .../cluster_manager.set_logging_service.js | 77 - .../cluster_manager.set_maintenance_policy.js | 86 - .../cluster_manager.set_master_auth.js | 74 - .../cluster_manager.set_monitoring_service.js | 77 - .../cluster_manager.set_network_policy.js | 69 - ...uster_manager.set_node_pool_autoscaling.js | 71 - ...luster_manager.set_node_pool_management.js | 71 - .../cluster_manager.set_node_pool_size.js | 71 - .../cluster_manager.start_i_p_rotation.js | 68 - .../v1beta1/cluster_manager.update_cluster.js | 69 - .../v1beta1/cluster_manager.update_master.js | 76 - .../cluster_manager.update_node_pool.js | 168 - ...pet_metadata.google.container.v1beta1.json | 1955 ------ .../google-container/v1beta1/src/index.ts | 25 - .../src/v1beta1/cluster_manager_client.ts | 3623 ----------- .../cluster_manager_client_config.json | 198 - .../v1beta1/cluster_manager_proto_list.json | 3 - .../v1beta1/src/v1beta1/gapic_metadata.json | 377 -- .../v1beta1/src/v1beta1/index.ts | 19 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - .../v1beta1/system-test/install.ts | 49 - .../test/gapic_cluster_manager_v1beta1.ts | 5238 --------------- .../google-container/v1beta1/tsconfig.json | 19 - .../v1beta1/webpack.config.js | 64 - .../google/container/v1/cluster_service.proto | 71 +- packages/google-container/protos/protos.d.ts | 362 ++ packages/google-container/protos/protos.js | 937 ++- packages/google-container/protos/protos.json | 106 + 119 files changed, 1474 insertions(+), 39104 deletions(-) delete mode 100644 owl-bot-staging/google-container/v1/.eslintignore delete mode 100644 owl-bot-staging/google-container/v1/.eslintrc.json delete mode 100644 owl-bot-staging/google-container/v1/.gitignore delete mode 100644 owl-bot-staging/google-container/v1/.jsdoc.js delete mode 100644 owl-bot-staging/google-container/v1/.mocharc.js delete mode 100644 owl-bot-staging/google-container/v1/.prettierrc.js delete mode 100644 owl-bot-staging/google-container/v1/README.md delete mode 100644 owl-bot-staging/google-container/v1/linkinator.config.json delete mode 100644 owl-bot-staging/google-container/v1/package.json delete mode 100644 owl-bot-staging/google-container/v1/protos/google/container/v1/cluster_service.proto delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.cancel_operation.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_i_p_rotation.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_cluster.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_node_pool.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_cluster.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_node_pool.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_cluster.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_j_s_o_n_web_keys.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_node_pool.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_operation.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_server_config.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_clusters.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_node_pools.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_operations.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_usable_subnetworks.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.rollback_node_pool_upgrade.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_addons_config.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_labels.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_legacy_abac.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_locations.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_logging_service.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_maintenance_policy.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_master_auth.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_monitoring_service.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_network_policy.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_autoscaling.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_management.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_size.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.start_i_p_rotation.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_cluster.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_master.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_node_pool.js delete mode 100644 owl-bot-staging/google-container/v1/samples/generated/v1/snippet_metadata.google.container.v1.json delete mode 100644 owl-bot-staging/google-container/v1/src/index.ts delete mode 100644 owl-bot-staging/google-container/v1/src/v1/cluster_manager_client.ts delete mode 100644 owl-bot-staging/google-container/v1/src/v1/cluster_manager_client_config.json delete mode 100644 owl-bot-staging/google-container/v1/src/v1/cluster_manager_proto_list.json delete mode 100644 owl-bot-staging/google-container/v1/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-container/v1/src/v1/index.ts delete mode 100644 owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-container/v1/system-test/install.ts delete mode 100644 owl-bot-staging/google-container/v1/test/gapic_cluster_manager_v1.ts delete mode 100644 owl-bot-staging/google-container/v1/tsconfig.json delete mode 100644 owl-bot-staging/google-container/v1/webpack.config.js delete mode 100644 owl-bot-staging/google-container/v1beta1/.eslintignore delete mode 100644 owl-bot-staging/google-container/v1beta1/.eslintrc.json delete mode 100644 owl-bot-staging/google-container/v1beta1/.gitignore delete mode 100644 owl-bot-staging/google-container/v1beta1/.jsdoc.js delete mode 100644 owl-bot-staging/google-container/v1beta1/.mocharc.js delete mode 100644 owl-bot-staging/google-container/v1beta1/.prettierrc.js delete mode 100644 owl-bot-staging/google-container/v1beta1/README.md delete mode 100644 owl-bot-staging/google-container/v1beta1/linkinator.config.json delete mode 100644 owl-bot-staging/google-container/v1beta1/package.json delete mode 100644 owl-bot-staging/google-container/v1beta1/protos/google/container/v1beta1/cluster_service.proto delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.cancel_operation.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_i_p_rotation.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_node_pool_upgrade.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_cluster.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_node_pool.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_cluster.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_node_pool.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_cluster.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_j_s_o_n_web_keys.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_node_pool.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_operation.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_server_config.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_clusters.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_locations.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_node_pools.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_operations.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_usable_subnetworks.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.rollback_node_pool_upgrade.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_addons_config.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_labels.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_legacy_abac.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_locations.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_logging_service.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_maintenance_policy.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_master_auth.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_monitoring_service.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_network_policy.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_autoscaling.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_management.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_size.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.start_i_p_rotation.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_cluster.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_master.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_node_pool.js delete mode 100644 owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json delete mode 100644 owl-bot-staging/google-container/v1beta1/src/index.ts delete mode 100644 owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client.ts delete mode 100644 owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client_config.json delete mode 100644 owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_proto_list.json delete mode 100644 owl-bot-staging/google-container/v1beta1/src/v1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-container/v1beta1/src/v1beta1/index.ts delete mode 100644 owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-container/v1beta1/system-test/install.ts delete mode 100644 owl-bot-staging/google-container/v1beta1/test/gapic_cluster_manager_v1beta1.ts delete mode 100644 owl-bot-staging/google-container/v1beta1/tsconfig.json delete mode 100644 owl-bot-staging/google-container/v1beta1/webpack.config.js diff --git a/owl-bot-staging/google-container/v1/.eslintignore b/owl-bot-staging/google-container/v1/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-container/v1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-container/v1/.eslintrc.json b/owl-bot-staging/google-container/v1/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-container/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-container/v1/.gitignore b/owl-bot-staging/google-container/v1/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-container/v1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -/.coverage -/coverage -/.nyc_output -/docs/ -/out/ -/build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/google-container/v1/.jsdoc.js b/owl-bot-staging/google-container/v1/.jsdoc.js deleted file mode 100644 index 6dc18e81193..00000000000 --- a/owl-bot-staging/google-container/v1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2023 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/container', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-container/v1/.mocharc.js b/owl-bot-staging/google-container/v1/.mocharc.js deleted file mode 100644 index 1a38f257db7..00000000000 --- a/owl-bot-staging/google-container/v1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/google-container/v1/.prettierrc.js b/owl-bot-staging/google-container/v1/.prettierrc.js deleted file mode 100644 index 55639e70f9e..00000000000 --- a/owl-bot-staging/google-container/v1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-container/v1/README.md b/owl-bot-staging/google-container/v1/README.md deleted file mode 100644 index f32441d7e6b..00000000000 --- a/owl-bot-staging/google-container/v1/README.md +++ /dev/null @@ -1 +0,0 @@ -Container: Nodejs Client diff --git a/owl-bot-staging/google-container/v1/linkinator.config.json b/owl-bot-staging/google-container/v1/linkinator.config.json deleted file mode 100644 index befd23c8633..00000000000 --- a/owl-bot-staging/google-container/v1/linkinator.config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "recurse": true, - "skip": [ - "https://codecov.io/gh/googleapis/", - "www.googleapis.com", - "img.shields.io", - "https://console.cloud.google.com/cloudshell", - "https://support.google.com" - ], - "silent": true, - "concurrency": 5, - "retry": true, - "retryErrors": true, - "retryErrorsCount": 5, - "retryErrorsJitter": 3000 -} diff --git a/owl-bot-staging/google-container/v1/package.json b/owl-bot-staging/google-container/v1/package.json deleted file mode 100644 index 9795068794e..00000000000 --- a/owl-bot-staging/google-container/v1/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@google-cloud/container", - "version": "0.1.0", - "description": "Container client for Node.js", - "repository": "googleapis/nodejs-container", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google container", - "container", - "cluster manager" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "predocs-test": "npm run docs", - "docs-test": "linkinator docs", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^3.5.7" - }, - "devDependencies": { - "@types/mocha": "^10.0.1", - "@types/node": "^18.11.18", - "@types/sinon": "^10.0.13", - "c8": "^7.12.0", - "gts": "^3.1.1", - "jsdoc": "^4.0.0", - "jsdoc-fresh": "^2.0.1", - "jsdoc-region-tag": "^2.0.1", - "linkinator": "^4.1.2", - "mocha": "^10.2.0", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^15.0.1", - "ts-loader": "^8.4.0", - "typescript": "^4.8.4", - "webpack": "^4.46.0", - "webpack-cli": "^4.10.0" - }, - "engines": { - "node": ">=v12" - } -} diff --git a/owl-bot-staging/google-container/v1/protos/google/container/v1/cluster_service.proto b/owl-bot-staging/google-container/v1/protos/google/container/v1/cluster_service.proto deleted file mode 100644 index 83149cc4f44..00000000000 --- a/owl-bot-staging/google-container/v1/protos/google/container/v1/cluster_service.proto +++ /dev/null @@ -1,5156 +0,0 @@ -// Copyright 2023 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. - -syntax = "proto3"; - -package google.container.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; -import "google/rpc/code.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.Container.V1"; -option go_package = "cloud.google.com/go/container/apiv1/containerpb;containerpb"; -option java_multiple_files = true; -option java_outer_classname = "ClusterServiceProto"; -option java_package = "com.google.container.v1"; -option php_namespace = "Google\\Cloud\\Container\\V1"; -option ruby_package = "Google::Cloud::Container::V1"; -option (google.api.resource_definition) = { - type: "pubsub.googleapis.com/Topic" - pattern: "projects/{project}/topics/{topic}" -}; - -// Google Kubernetes Engine Cluster Manager v1 -service ClusterManager { - option (google.api.default_host) = "container.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Lists all clusters owned by a project in either the specified zone or all - // zones. - rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/clusters" - additional_bindings { - get: "/v1/projects/{project_id}/zones/{zone}/clusters" - } - }; - option (google.api.method_signature) = "project_id,zone"; - option (google.api.method_signature) = "parent"; - } - - // Gets the details of a specific cluster. - rpc GetCluster(GetClusterRequest) returns (Cluster) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/clusters/*}" - additional_bindings { - get: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - option (google.api.method_signature) = "name"; - } - - // 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](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). - // - // 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. - rpc CreateCluster(CreateClusterRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/clusters" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster"; - option (google.api.method_signature) = "parent,cluster"; - } - - // Updates the settings of a specific cluster. - rpc UpdateCluster(UpdateClusterRequest) returns (Operation) { - option (google.api.http) = { - put: "/v1/{name=projects/*/locations/*/clusters/*}" - body: "*" - additional_bindings { - put: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id,update"; - option (google.api.method_signature) = "name,update"; - } - - // Updates the version and/or image type for the specified node pool. - rpc UpdateNodePool(UpdateNodePoolRequest) returns (Operation) { - option (google.api.http) = { - put: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/update" - body: "*" - } - }; - } - - // Sets the autoscaling settings for the specified node pool. - rpc SetNodePoolAutoscaling(SetNodePoolAutoscalingRequest) - returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setAutoscaling" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/autoscaling" - body: "*" - } - }; - } - - // Sets the logging service for a specific cluster. - rpc SetLoggingService(SetLoggingServiceRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setLogging" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/logging" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,logging_service"; - option (google.api.method_signature) = "name,logging_service"; - } - - // Sets the monitoring service for a specific cluster. - rpc SetMonitoringService(SetMonitoringServiceRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setMonitoring" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/monitoring" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,monitoring_service"; - option (google.api.method_signature) = "name,monitoring_service"; - } - - // Sets the addons for a specific cluster. - rpc SetAddonsConfig(SetAddonsConfigRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setAddons" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/addons" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,addons_config"; - option (google.api.method_signature) = "name,addons_config"; - } - - // Sets the locations for a specific cluster. - // Deprecated. Use - // [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update) - // instead. - rpc SetLocations(SetLocationsRequest) returns (Operation) { - option deprecated = true; - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setLocations" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/locations" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,locations"; - option (google.api.method_signature) = "name,locations"; - } - - // Updates the master for a specific cluster. - rpc UpdateMaster(UpdateMasterRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:updateMaster" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/master" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,master_version"; - option (google.api.method_signature) = "name,master_version"; - } - - // Sets master auth materials. Currently supports changing the admin password - // or a specific cluster, either via password generation or explicitly setting - // the password. - rpc SetMasterAuth(SetMasterAuthRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setMasterAuth" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setMasterAuth" - body: "*" - } - }; - } - - // 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. - rpc DeleteCluster(DeleteClusterRequest) returns (Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/clusters/*}" - additional_bindings { - delete: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - option (google.api.method_signature) = "name"; - } - - // Lists all operations in a project in a specific zone or all zones. - rpc ListOperations(ListOperationsRequest) returns (ListOperationsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/operations" - additional_bindings { - get: "/v1/projects/{project_id}/zones/{zone}/operations" - } - }; - option (google.api.method_signature) = "project_id,zone"; - } - - // Gets the specified operation. - rpc GetOperation(GetOperationRequest) returns (Operation) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/operations/*}" - additional_bindings { - get: "/v1/projects/{project_id}/zones/{zone}/operations/{operation_id}" - } - }; - option (google.api.method_signature) = "project_id,zone,operation_id"; - option (google.api.method_signature) = "name"; - } - - // Cancels the specified operation. - rpc CancelOperation(CancelOperationRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/operations/*}:cancel" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/operations/{operation_id}:cancel" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,operation_id"; - option (google.api.method_signature) = "name"; - } - - // Returns configuration info about the Google Kubernetes Engine service. - rpc GetServerConfig(GetServerConfigRequest) returns (ServerConfig) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*}/serverConfig" - additional_bindings { - get: "/v1/projects/{project_id}/zones/{zone}/serverconfig" - } - }; - option (google.api.method_signature) = "project_id,zone"; - option (google.api.method_signature) = "name"; - } - - // Gets the public component of the cluster signing keys in - // JSON Web Key format. - // This API is not yet intended for general use, and is not available for all - // clusters. - rpc GetJSONWebKeys(GetJSONWebKeysRequest) returns (GetJSONWebKeysResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/clusters/*}/jwks" - }; - } - - // Lists the node pools for a cluster. - rpc ListNodePools(ListNodePoolsRequest) returns (ListNodePoolsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/clusters/*}/nodePools" - additional_bindings { - get: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - option (google.api.method_signature) = "parent"; - } - - // Retrieves the requested node pool. - rpc GetNodePool(GetNodePoolRequest) returns (NodePool) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}" - additional_bindings { - get: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,node_pool_id"; - option (google.api.method_signature) = "name"; - } - - // Creates a node pool for a cluster. - rpc CreateNodePool(CreateNodePoolRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/clusters/*}/nodePools" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,node_pool"; - option (google.api.method_signature) = "parent,node_pool"; - } - - // Deletes a node pool from a cluster. - rpc DeleteNodePool(DeleteNodePoolRequest) returns (Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}" - additional_bindings { - delete: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,node_pool_id"; - option (google.api.method_signature) = "name"; - } - - // CompleteNodePoolUpgrade will signal an on-going node pool upgrade to - // complete. - rpc CompleteNodePoolUpgrade(CompleteNodePoolUpgradeRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}:completeUpgrade" - body: "*" - }; - } - - // Rolls back a previously Aborted or Failed NodePool upgrade. - // This makes no changes if the last upgrade successfully completed. - rpc RollbackNodePoolUpgrade(RollbackNodePoolUpgradeRequest) - returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}:rollback" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}:rollback" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,node_pool_id"; - option (google.api.method_signature) = "name"; - } - - // Sets the NodeManagement options for a node pool. - rpc SetNodePoolManagement(SetNodePoolManagementRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setManagement" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/setManagement" - body: "*" - } - }; - } - - // Sets labels on a cluster. - rpc SetLabels(SetLabelsRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setResourceLabels" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/resourceLabels" - body: "*" - } - }; - } - - // Enables or disables the ABAC authorization mechanism on a cluster. - rpc SetLegacyAbac(SetLegacyAbacRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setLegacyAbac" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/legacyAbac" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id,enabled"; - option (google.api.method_signature) = "name,enabled"; - } - - // Starts master IP rotation. - rpc StartIPRotation(StartIPRotationRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:startIpRotation" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:startIpRotation" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - option (google.api.method_signature) = "name"; - } - - // Completes master IP rotation. - rpc CompleteIPRotation(CompleteIPRotationRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:completeIpRotation" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:completeIpRotation" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - option (google.api.method_signature) = "name"; - } - - // Sets the size for a specific node pool. The new size will be used for all - // replicas, including future replicas created by modifying - // [NodePool.locations][google.container.v1.NodePool.locations]. - rpc SetNodePoolSize(SetNodePoolSizeRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setSize" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/setSize" - body: "*" - } - }; - } - - // Enables or disables Network Policy for a cluster. - rpc SetNetworkPolicy(SetNetworkPolicyRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setNetworkPolicy" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setNetworkPolicy" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,network_policy"; - option (google.api.method_signature) = "name,network_policy"; - } - - // Sets the maintenance policy for a cluster. - rpc SetMaintenancePolicy(SetMaintenancePolicyRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setMaintenancePolicy" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setMaintenancePolicy" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,maintenance_policy"; - option (google.api.method_signature) = "name,maintenance_policy"; - } - - // Lists subnetworks that are usable for creating clusters in a project. - rpc ListUsableSubnetworks(ListUsableSubnetworksRequest) - returns (ListUsableSubnetworksResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*}/aggregated/usableSubnetworks" - }; - } - - // Checks the cluster compatibility with Autopilot mode, and returns a list of - // compatibility issues. - rpc CheckAutopilotCompatibility(CheckAutopilotCompatibilityRequest) - returns (CheckAutopilotCompatibilityResponse) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/clusters/*}:checkAutopilotCompatibility" - }; - } -} - -// Parameters that can be configured on Linux nodes. -message LinuxNodeConfig { - // Possible cgroup modes that can be used. - enum CgroupMode { - // CGROUP_MODE_UNSPECIFIED is when unspecified cgroup configuration is used. - // The default for the GKE node OS image will be used. - CGROUP_MODE_UNSPECIFIED = 0; - - // CGROUP_MODE_V1 specifies to use cgroupv1 for the cgroup configuration on - // the node image. - CGROUP_MODE_V1 = 1; - - // CGROUP_MODE_V2 specifies to use cgroupv2 for the cgroup configuration on - // the node image. - CGROUP_MODE_V2 = 2; - } - - // The Linux kernel parameters to be applied to the nodes and all pods running - // on the nodes. - // - // The following parameters are supported. - // - // net.core.busy_poll - // net.core.busy_read - // net.core.netdev_max_backlog - // net.core.rmem_max - // net.core.wmem_default - // net.core.wmem_max - // net.core.optmem_max - // net.core.somaxconn - // net.ipv4.tcp_rmem - // net.ipv4.tcp_wmem - // net.ipv4.tcp_tw_reuse - map sysctls = 1; - - // cgroup_mode specifies the cgroup mode to be used on the node. - CgroupMode cgroup_mode = 2; -} - -// Parameters that can be configured on Windows nodes. -// Windows Node Config that define the parameters that will be used to -// configure the Windows node pool settings -message WindowsNodeConfig { - // Possible OS version that can be used. - enum OSVersion { - // When OSVersion is not specified - OS_VERSION_UNSPECIFIED = 0; - - // LTSC2019 specifies to use LTSC2019 as the Windows Servercore Base Image - OS_VERSION_LTSC2019 = 1; - - // LTSC2022 specifies to use LTSC2022 as the Windows Servercore Base Image - OS_VERSION_LTSC2022 = 2; - } - - // OSVersion specifies the Windows node config to be used on the node - OSVersion os_version = 1; -} - -// Node kubelet configs. -message NodeKubeletConfig { - // Control the CPU management policy on the node. - // See - // https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/ - // - // The following values are allowed. - // * "none": the default, which represents the existing scheduling behavior. - // * "static": allows pods with certain resource characteristics to be granted - // increased CPU affinity and exclusivity on the node. - // The default value is 'none' if unspecified. - string cpu_manager_policy = 1; - - // Enable CPU CFS quota enforcement for containers that specify CPU limits. - // - // This option is enabled by default which makes kubelet use CFS quota - // (https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt) to - // enforce container CPU limits. Otherwise, CPU limits will not be enforced at - // all. - // - // Disable this option to mitigate CPU throttling problems while still having - // your pods to be in Guaranteed QoS class by specifying the CPU limits. - // - // The default value is 'true' if unspecified. - google.protobuf.BoolValue cpu_cfs_quota = 2; - - // Set the CPU CFS quota period value 'cpu.cfs_period_us'. - // - // The string must be a sequence of decimal numbers, each with optional - // fraction and a unit suffix, such as "300ms". - // Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". - // The value must be a positive duration. - string cpu_cfs_quota_period = 3; - - // Set the Pod PID limits. See - // https://kubernetes.io/docs/concepts/policy/pid-limiting/#pod-pid-limits - // - // Controls the maximum number of processes allowed to run in a pod. The value - // must be greater than or equal to 1024 and less than 4194304. - int64 pod_pids_limit = 4; - - // Enable or disable Kubelet read only port. - optional bool insecure_kubelet_readonly_port_enabled = 7; -} - -// Parameters that describe the nodes in a cluster. -// -// GKE Autopilot clusters do not -// recognize parameters in `NodeConfig`. Use -// [AutoprovisioningNodePoolDefaults][google.container.v1.AutoprovisioningNodePoolDefaults] -// instead. -message NodeConfig { - // The name of a Google Compute Engine [machine - // type](https://cloud.google.com/compute/docs/machine-types) - // - // If unspecified, the default machine type is `e2-medium`. - string machine_type = 1; - - // 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. - int32 disk_size_gb = 2; - - // 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](https://cloud.google.com/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. - repeated string oauth_scopes = 3; - - // The Google Cloud Platform Service Account to be used by the node VMs. - // Specify the email address of the Service Account; otherwise, if no Service - // Account is specified, the "default" service account is used. - string service_account = 9; - - // 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-ensure-gke-docker" - // - "gci-metrics-enabled" - // - "gci-update-strategy" - // - "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" - // - // 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. - map metadata = 4; - - // The image type to use for this node. Note that for a given image type, - // the latest version of it will be used. Please see - // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for - // available image types. - string image_type = 5; - - // 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/ - map labels = 6; - - // 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. - int32 local_ssd_count = 7; - - // 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. - repeated string tags = 8; - - // 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. - bool preemptible = 10; - - // 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. - repeated AcceleratorConfig accelerators = 11; - - // Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or - // 'pd-balanced') - // - // If unspecified, the default disk type is 'pd-standard' - string disk_type = 12; - - // 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](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform) - string min_cpu_platform = 13; - - // The workload metadata configuration for this node. - WorkloadMetadataConfig workload_metadata_config = 14; - - // 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/ - repeated NodeTaint taints = 15; - - // Sandbox configuration for this node. - SandboxConfig sandbox_config = 17; - - // Setting this field will assign instances of this - // pool to run on the specified node group. This is useful for running - // workloads on [sole tenant - // nodes](https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes). - string node_group = 18; - - // The optional reservation affinity. Setting this field will apply - // the specified [Zonal Compute - // Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources) - // to this node pool. - ReservationAffinity reservation_affinity = 19; - - // Shielded Instance options. - ShieldedInstanceConfig shielded_instance_config = 20; - - // Parameters that can be configured on Linux nodes. - LinuxNodeConfig linux_node_config = 21; - - // Node kubelet configs. - NodeKubeletConfig kubelet_config = 22; - - // - // The Customer Managed Encryption Key used to encrypt the boot disk attached - // to each node in the node pool. This should be of the form - // projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. - // For more information about protecting resources with Cloud KMS Keys please - // see: - // https://cloud.google.com/compute/docs/disks/customer-managed-encryption - string boot_disk_kms_key = 23; - - // Google Container File System (image streaming) configs. - GcfsConfig gcfs_config = 25; - - // Advanced features for the Compute Engine VM. - AdvancedMachineFeatures advanced_machine_features = 26; - - // Enable or disable gvnic in the node pool. - VirtualNIC gvnic = 29; - - // Spot flag for enabling Spot VM, which is a rebrand of - // the existing preemptible flag. - bool spot = 32; - - // Confidential nodes config. - // All the nodes in the node pool will be Confidential VM once enabled. - ConfidentialNodes confidential_nodes = 35; - - // Enable or disable NCCL fast socket for the node pool. - optional FastSocket fast_socket = 36; - - // The resource labels for the node pool to use to annotate any related - // Google Compute Engine resources. - map resource_labels = 37; - - // Logging configuration. - NodePoolLoggingConfig logging_config = 38; - - // Parameters that can be configured on Windows nodes. - WindowsNodeConfig windows_node_config = 39; - - // Parameters for using raw-block Local NVMe SSDs. - LocalNvmeSsdBlockConfig local_nvme_ssd_block_config = 40; - - // Parameters for the node ephemeral storage using Local SSDs. - // If unspecified, ephemeral storage is backed by the boot disk. - EphemeralStorageLocalSsdConfig ephemeral_storage_local_ssd_config = 41; - - // Parameters for node pools to be backed by shared sole tenant node groups. - SoleTenantConfig sole_tenant_config = 42; -} - -// Specifies options for controlling advanced machine features. -message AdvancedMachineFeatures { - // The number of threads per physical core. To disable simultaneous - // multithreading (SMT) set this to 1. If unset, the maximum number of threads - // supported per core by the underlying processor is assumed. - optional int64 threads_per_core = 1; -} - -// Parameters for node pool-level network config. -message NodeNetworkConfig { - // Configuration of all network bandwidth tiers - message NetworkPerformanceConfig { - // Node network tier - enum Tier { - // Default value - TIER_UNSPECIFIED = 0; - - // Higher bandwidth, actual values based on VM size. - TIER_1 = 1; - } - - // Specifies the total network bandwidth tier for the NodePool. - optional Tier total_egress_bandwidth_tier = 1; - } - - // Input only. Whether to create a new range for pod IPs in this node pool. - // Defaults are provided for `pod_range` and `pod_ipv4_cidr_block` if they - // are not specified. - // - // If neither `create_pod_range` or `pod_range` are specified, the - // cluster-level default (`ip_allocation_policy.cluster_ipv4_cidr_block`) is - // used. - // - // Only applicable if `ip_allocation_policy.use_ip_aliases` is true. - // - // This field cannot be changed after the node pool has been created. - bool create_pod_range = 4 [(google.api.field_behavior) = INPUT_ONLY]; - - // The ID of the secondary range for pod IPs. - // If `create_pod_range` is true, this ID is used for the new range. - // If `create_pod_range` is false, uses an existing secondary range with this - // ID. - // - // Only applicable if `ip_allocation_policy.use_ip_aliases` is true. - // - // This field cannot be changed after the node pool has been created. - string pod_range = 5; - - // The IP address range for pod IPs in this node pool. - // - // Only applicable if `create_pod_range` 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](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `10.96.0.0/14`) to pick a specific range to use. - // - // Only applicable if `ip_allocation_policy.use_ip_aliases` is true. - // - // This field cannot be changed after the node pool has been created. - string pod_ipv4_cidr_block = 6; - - // Whether nodes have internal IP addresses only. - // If enable_private_nodes is not specified, then the value is derived from - // [cluster.privateClusterConfig.enablePrivateNodes][google.container.v1beta1.PrivateClusterConfig.enablePrivateNodes] - optional bool enable_private_nodes = 9; - - // Network bandwidth tier configuration. - optional NetworkPerformanceConfig network_performance_config = 11; - - // [PRIVATE FIELD] - // Pod CIDR size overprovisioning config for the nodepool. - // - // Pod CIDR size per node depends on max_pods_per_node. By default, the value - // of max_pods_per_node is rounded off to next power of 2 and we then double - // that to get the size of pod CIDR block per node. - // Example: max_pods_per_node of 30 would result in 64 IPs (/26). - // - // This config can disable the doubling of IPs (we still round off to next - // power of 2) - // Example: max_pods_per_node of 30 will result in 32 IPs (/27) when - // overprovisioning is disabled. - PodCIDROverprovisionConfig pod_cidr_overprovision_config = 13; - - // Output only. [Output only] The utilization of the IPv4 range for the pod. - // The ratio is Usage/[Total number of IPs in the secondary range], - // Usage=numNodes*numZones*podIPsPerNode. - double pod_ipv4_range_utilization = 16 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A set of Shielded Instance options. -message ShieldedInstanceConfig { - // 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. - bool enable_secure_boot = 1; - - // 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. - bool enable_integrity_monitoring = 2; -} - -// SandboxConfig contains configurations of the sandbox to use for the node. -message SandboxConfig { - // Possible types of sandboxes. - enum Type { - // Default value. This should not be used. - UNSPECIFIED = 0; - - // Run sandbox using gvisor. - GVISOR = 1; - } - - // Type of the sandbox to use for the node. - Type type = 2; -} - -// GcfsConfig contains configurations of Google Container File System -// (image streaming). -message GcfsConfig { - // Whether to use GCFS. - bool enabled = 1; -} - -// [ReservationAffinity](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources) -// is the configuration of desired reservation which instances could take -// capacity from. -message ReservationAffinity { - // Indicates whether to consume capacity from a reservation or not. - enum Type { - // Default value. This should not be used. - UNSPECIFIED = 0; - - // Do not consume from any reserved capacity. - NO_RESERVATION = 1; - - // Consume any reservation available. - ANY_RESERVATION = 2; - - // Must consume from a specific reservation. Must specify key value fields - // for specifying the reservations. - SPECIFIC_RESERVATION = 3; - } - - // Corresponds to the type of reservation consumption. - Type consume_reservation_type = 1; - - // Corresponds to the label key of a reservation resource. To target a - // SPECIFIC_RESERVATION by name, specify - // "compute.googleapis.com/reservation-name" as the key and specify the name - // of your reservation as its value. - string key = 2; - - // Corresponds to the label value(s) of reservation resource(s). - repeated string values = 3; -} - -// SoleTenantConfig contains the NodeAffinities to specify what shared sole -// tenant node groups should back the node pool. -message SoleTenantConfig { - // Specifies the NodeAffinity key, values, and affinity operator according to - // [shared sole tenant node group - // affinities](https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes#node_affinity_and_anti-affinity). - message NodeAffinity { - // Operator allows user to specify affinity or anti-affinity for the - // given key values. - enum Operator { - // Invalid or unspecified affinity operator. - OPERATOR_UNSPECIFIED = 0; - - // Affinity operator. - IN = 1; - - // Anti-affinity operator. - NOT_IN = 2; - } - - // Key for NodeAffinity. - string key = 1; - - // Operator for NodeAffinity. - Operator operator = 2; - - // Values for NodeAffinity. - repeated string values = 3; - } - - // NodeAffinities used to match to a shared sole tenant node group. - repeated NodeAffinity node_affinities = 1; -} - -// Kubernetes taint is composed of three fields: key, value, and effect. Effect -// can only be one of three types: NoSchedule, PreferNoSchedule or NoExecute. -// -// See -// [here](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration) -// for more information, including usage and the valid values. -message NodeTaint { - // Possible values for Effect in taint. - enum Effect { - // Not set - EFFECT_UNSPECIFIED = 0; - - // NoSchedule - NO_SCHEDULE = 1; - - // PreferNoSchedule - PREFER_NO_SCHEDULE = 2; - - // NoExecute - NO_EXECUTE = 3; - } - - // Key for taint. - string key = 1; - - // Value for taint. - string value = 2; - - // Effect for taint. - Effect effect = 3; -} - -// Collection of Kubernetes [node -// taints](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration). -message NodeTaints { - // List of node taints. - repeated NodeTaint taints = 1; -} - -// Collection of node-level [Kubernetes -// labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels). -message NodeLabels { - // Map of node label keys and node label values. - map labels = 1; -} - -// Collection of [GCP -// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). -message ResourceLabels { - // Map of node label keys and node label values. - map labels = 1; -} - -// Collection of Compute Engine network tags that can be applied to a node's -// underlying VM instance. -message NetworkTags { - // List of network tags. - repeated string tags = 1; -} - -// The authentication information for accessing the master endpoint. -// Authentication can be done using HTTP basic auth or using client -// certificates. -message MasterAuth { - // 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). - // - // Warning: basic authentication is deprecated, and will be removed in GKE - // control plane versions 1.19 and newer. For a list of recommended - // authentication methods, see: - // https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication - string username = 1 [deprecated = true]; - - // 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. - // - // Warning: basic authentication is deprecated, and will be removed in GKE - // control plane versions 1.19 and newer. For a list of recommended - // authentication methods, see: - // https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication - string password = 2 [deprecated = true]; - - // Configuration for client certificate authentication on the cluster. For - // clusters before v1.12, if no configuration is specified, a client - // certificate is issued. - ClientCertificateConfig client_certificate_config = 3; - - // [Output only] Base64-encoded public certificate that is the root of - // trust for the cluster. - string cluster_ca_certificate = 100; - - // [Output only] Base64-encoded public certificate used by clients to - // authenticate to the cluster endpoint. - string client_certificate = 101; - - // [Output only] Base64-encoded private key used by clients to authenticate - // to the cluster endpoint. - string client_key = 102; -} - -// Configuration for client certificates on the cluster. -message ClientCertificateConfig { - // Issue a client certificate. - bool issue_client_certificate = 1; -} - -// Configuration for the addons that can be automatically spun up in the -// cluster, enabling additional functionality. -message AddonsConfig { - // Configuration for the HTTP (L7) load balancing controller addon, which - // makes it easy to set up HTTP load balancers for services in a cluster. - HttpLoadBalancing http_load_balancing = 1; - - // 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. - HorizontalPodAutoscaling horizontal_pod_autoscaling = 2; - - // 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 - KubernetesDashboard kubernetes_dashboard = 3 [deprecated = true]; - - // 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. - NetworkPolicyConfig network_policy_config = 4; - - // Configuration for the Cloud Run addon, which allows the user to use a - // managed Knative service. - CloudRunConfig cloud_run_config = 7; - - // Configuration for NodeLocalDNS, a dns cache running on cluster nodes - DnsCacheConfig dns_cache_config = 8; - - // Configuration for the ConfigConnector add-on, a Kubernetes - // extension to manage hosted GCP services through the Kubernetes API - ConfigConnectorConfig config_connector_config = 10; - - // Configuration for the Compute Engine Persistent Disk CSI driver. - GcePersistentDiskCsiDriverConfig gce_persistent_disk_csi_driver_config = 11; - - // Configuration for the GCP Filestore CSI driver. - GcpFilestoreCsiDriverConfig gcp_filestore_csi_driver_config = 14; - - // Configuration for the Backup for GKE agent addon. - GkeBackupAgentConfig gke_backup_agent_config = 16; - - // Configuration for the Cloud Storage Fuse CSI driver. - GcsFuseCsiDriverConfig gcs_fuse_csi_driver_config = 17; -} - -// 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. -message HttpLoadBalancing { - // 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. - bool disabled = 1; -} - -// 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. -message HorizontalPodAutoscaling { - // Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. - // When enabled, it ensures that metrics are collected into Stackdriver - // Monitoring. - bool disabled = 1; -} - -// Configuration for the Kubernetes Dashboard. -message KubernetesDashboard { - // Whether the Kubernetes Dashboard is enabled for this cluster. - bool disabled = 1; -} - -// 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. -message NetworkPolicyConfig { - // Whether NetworkPolicy is enabled for this cluster. - bool disabled = 1; -} - -// Configuration for NodeLocal DNSCache -message DnsCacheConfig { - // Whether NodeLocal DNSCache is enabled for this cluster. - bool enabled = 1; -} - -// Configuration for controlling master global access settings. -message PrivateClusterMasterGlobalAccessConfig { - // Whenever master is accessible globally or not. - bool enabled = 1; -} - -// Configuration options for private clusters. -message PrivateClusterConfig { - // 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. - bool enable_private_nodes = 1; - - // Whether the master's internal IP address is used as the cluster endpoint. - bool enable_private_endpoint = 2; - - // 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. - string master_ipv4_cidr_block = 3; - - // Output only. The internal IP address of this cluster's master endpoint. - string private_endpoint = 4; - - // Output only. The external IP address of this cluster's master endpoint. - string public_endpoint = 5; - - // Output only. The peering name in the customer VPC used by this cluster. - string peering_name = 7; - - // Controls master global access settings. - PrivateClusterMasterGlobalAccessConfig master_global_access_config = 8; - - // Subnet to provision the master's private endpoint during cluster creation. - // Specified in projects/*/regions/*/subnetworks/* format. - string private_endpoint_subnetwork = 10; -} - -// Configuration for returning group information from authenticators. -message AuthenticatorGroupsConfig { - // Whether this cluster should return group membership lookups - // during authentication using a group of security groups. - bool enabled = 1; - - // The name of the security group-of-groups to be used. Only relevant - // if enabled = true. - string security_group = 2; -} - -// Configuration options for the Cloud Run feature. -message CloudRunConfig { - // Load balancer type of ingress service of Cloud Run. - enum LoadBalancerType { - // Load balancer type for Cloud Run is unspecified. - LOAD_BALANCER_TYPE_UNSPECIFIED = 0; - - // Install external load balancer for Cloud Run. - LOAD_BALANCER_TYPE_EXTERNAL = 1; - - // Install internal load balancer for Cloud Run. - LOAD_BALANCER_TYPE_INTERNAL = 2; - } - - // Whether Cloud Run addon is enabled for this cluster. - bool disabled = 1; - - // Which load balancer type is installed for Cloud Run. - LoadBalancerType load_balancer_type = 3; -} - -// Configuration options for the Config Connector add-on. -message ConfigConnectorConfig { - // Whether Cloud Connector is enabled for this cluster. - bool enabled = 1; -} - -// Configuration for the Compute Engine PD CSI driver. -message GcePersistentDiskCsiDriverConfig { - // Whether the Compute Engine PD CSI driver is enabled for this cluster. - bool enabled = 1; -} - -// Configuration for the GCP Filestore CSI driver. -message GcpFilestoreCsiDriverConfig { - // Whether the GCP Filestore CSI driver is enabled for this cluster. - bool enabled = 1; -} - -// Configuration for the Cloud Storage Fuse CSI driver. -message GcsFuseCsiDriverConfig { - // Whether the Cloud Storage Fuse CSI driver is enabled for this cluster. - bool enabled = 1; -} - -// Configuration for the Backup for GKE Agent. -message GkeBackupAgentConfig { - // Whether the Backup for GKE agent is enabled for this cluster. - bool enabled = 1; -} - -// 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. -message MasterAuthorizedNetworksConfig { - // CidrBlock contains an optional name and one CIDR block. - message CidrBlock { - // display_name is an optional field for users to identify CIDR blocks. - string display_name = 1; - - // cidr_block must be specified in CIDR notation. - string cidr_block = 2; - } - - // Whether or not master authorized networks is enabled. - bool enabled = 1; - - // cidr_blocks define up to 50 external networks that could access - // Kubernetes master through HTTPS. - repeated CidrBlock cidr_blocks = 2; - - // Whether master is accessbile via Google Compute Engine Public IP addresses. - optional bool gcp_public_cidrs_access_enabled = 3; -} - -// Configuration for the legacy Attribute Based Access Control authorization -// mode. -message LegacyAbac { - // 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. - bool enabled = 1; -} - -// Configuration options for the NetworkPolicy feature. -// https://kubernetes.io/docs/concepts/services-networking/networkpolicies/ -message NetworkPolicy { - // Allowed Network Policy providers. - enum Provider { - // Not set - PROVIDER_UNSPECIFIED = 0; - - // Tigera (Calico Felix). - CALICO = 1; - } - - // The selected network policy provider. - Provider provider = 1; - - // Whether network policy is enabled on the cluster. - bool enabled = 2; -} - -// Configuration for Binary Authorization. -message BinaryAuthorization { - // Binary Authorization mode of operation. - enum EvaluationMode { - // Default value - EVALUATION_MODE_UNSPECIFIED = 0; - - // Disable BinaryAuthorization - DISABLED = 1; - - // Enforce Kubernetes admission requests with BinaryAuthorization using the - // project's singleton policy. This is equivalent to setting the - // enabled boolean to true. - PROJECT_SINGLETON_POLICY_ENFORCE = 2; - } - - // This field is deprecated. Leave this unset and instead configure - // BinaryAuthorization using evaluation_mode. If evaluation_mode is set to - // anything other than EVALUATION_MODE_UNSPECIFIED, this field is ignored. - bool enabled = 1 [deprecated = true]; - - // Mode of operation for binauthz policy evaluation. If unspecified, defaults - // to DISABLED. - EvaluationMode evaluation_mode = 2; -} - -// [PRIVATE FIELD] -// Config for pod CIDR size overprovisioning. -message PodCIDROverprovisionConfig { - // Whether Pod CIDR overprovisioning is disabled. - // Note: Pod CIDR overprovisioning is enabled by default. - bool disable = 1; -} - -// Configuration for controlling how IPs are allocated in the cluster. -message IPAllocationPolicy { - // Whether alias IPs will be used for pod IPs in the cluster. - // This is used in conjunction with use_routes. It cannot - // be true if use_routes is true. If both use_ip_aliases and use_routes are - // false, then the server picks the default IP allocation mode - bool use_ip_aliases = 1; - - // Whether a new subnetwork will be created automatically for the cluster. - // - // This field is only applicable when `use_ip_aliases` is true. - bool create_subnetwork = 2; - - // 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. - string subnetwork_name = 3; - - // This field is deprecated, use cluster_ipv4_cidr_block. - string cluster_ipv4_cidr = 4 [deprecated = true]; - - // This field is deprecated, use node_ipv4_cidr_block. - string node_ipv4_cidr = 5 [deprecated = true]; - - // This field is deprecated, use services_ipv4_cidr_block. - string services_ipv4_cidr = 6 [deprecated = true]; - - // 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. - string cluster_secondary_range_name = 7; - - // 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. - string services_secondary_range_name = 8; - - // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // 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. - string cluster_ipv4_cidr_block = 9; - - // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // 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. - string node_ipv4_cidr_block = 10; - - // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // 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. - string services_ipv4_cidr_block = 11; - - // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // 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. - string tpu_ipv4_cidr_block = 13; - - // Whether routes will be used for pod IPs in the cluster. - // This is used in conjunction with use_ip_aliases. It cannot be true if - // use_ip_aliases is true. If both use_ip_aliases and use_routes are false, - // then the server picks the default IP allocation mode - bool use_routes = 15; - - // The IP stack type of the cluster - StackType stack_type = 16; - - // The ipv6 access type (internal or external) when create_subnetwork is true - IPv6AccessType ipv6_access_type = 17; - - // [PRIVATE FIELD] - // Pod CIDR size overprovisioning config for the cluster. - // - // Pod CIDR size per node depends on max_pods_per_node. By default, the value - // of max_pods_per_node is doubled and then rounded off to next power of 2 to - // get the size of pod CIDR block per node. - // Example: max_pods_per_node of 30 would result in 64 IPs (/26). - // - // This config can disable the doubling of IPs (we still round off to next - // power of 2) - // Example: max_pods_per_node of 30 will result in 32 IPs (/27) when - // overprovisioning is disabled. - PodCIDROverprovisionConfig pod_cidr_overprovision_config = 21; - - // Output only. [Output only] The subnet's IPv6 CIDR block used by nodes and - // pods. - string subnet_ipv6_cidr_block = 22 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. [Output only] The services IPv6 CIDR block for the cluster. - string services_ipv6_cidr_block = 23 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. [Output only] The additional pod ranges that are added to the - // cluster. These pod ranges can be used by new node pools to allocate pod IPs - // automatically. Once the range is removed it will not show up in - // IPAllocationPolicy. - AdditionalPodRangesConfig additional_pod_ranges_config = 24 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. [Output only] The utilization of the cluster default IPv4 - // range for the pod. The ratio is Usage/[Total number of IPs in the secondary - // range], Usage=numNodes*numZones*podIPsPerNode. - double default_pod_ipv4_range_utilization = 25 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A Google Kubernetes Engine cluster. -message Cluster { - // The current status of the cluster. - enum Status { - // Not set. - STATUS_UNSPECIFIED = 0; - - // The PROVISIONING state indicates the cluster is being created. - PROVISIONING = 1; - - // The RUNNING state indicates the cluster has been created and is fully - // usable. - RUNNING = 2; - - // 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. - RECONCILING = 3; - - // The STOPPING state indicates the cluster is being deleted. - STOPPING = 4; - - // The ERROR state indicates the cluster is unusable. It will be - // automatically deleted. Details can be found in the `statusMessage` field. - ERROR = 5; - - // The DEGRADED state indicates the cluster requires user action to restore - // full functionality. Details can be found in the `statusMessage` field. - DEGRADED = 6; - } - - // 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. - string name = 1; - - // An optional description of this cluster. - string description = 2; - - // The number of nodes to create in this cluster. You must ensure that your - // 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 - // "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. - int32 initial_node_count = 3 [deprecated = true]; - - // 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. - NodeConfig node_config = 4 [deprecated = true]; - - // 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. - MasterAuth master_auth = 5; - - // The logging service the cluster should use to write logs. - // Currently available options: - // - // * `logging.googleapis.com/kubernetes` - The Cloud Logging - // service with a Kubernetes-native resource model - // * `logging.googleapis.com` - The legacy Cloud Logging service (no longer - // available as of GKE 1.15). - // * `none` - no logs will be exported from the cluster. - // - // If left as an empty string,`logging.googleapis.com/kubernetes` will be - // used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. - string logging_service = 6; - - // The monitoring service the cluster should use to write metrics. - // Currently available options: - // - // * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring - // service with a Kubernetes-native resource model - // * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no - // longer available as of GKE 1.15). - // * `none` - No metrics will be exported from the cluster. - // - // If left as an empty string,`monitoring.googleapis.com/kubernetes` will be - // used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. - string monitoring_service = 7; - - // The name of the Google Compute Engine - // [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) - // to which the cluster is connected. If left unspecified, the `default` - // network will be used. - string network = 8; - - // The IP address range of the container pods in this cluster, in - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // 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`. - string cluster_ipv4_cidr = 9; - - // Configurations for the various addons available to run in the cluster. - AddonsConfig addons_config = 10; - - // The name of the Google Compute Engine - // [subnetwork](https://cloud.google.com/compute/docs/subnetworks) to which - // the cluster is connected. - string subnetwork = 11; - - // The node pools associated with this cluster. - // This field should not be set if "node_config" or "initial_node_count" are - // specified. - repeated NodePool node_pools = 12; - - // The list of Google Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster's nodes should be located. - // - // This field provides a default value if - // [NodePool.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools#NodePool.FIELDS.locations) - // are not specified during node pool creation. - // - // Warning: changing cluster locations will update the - // [NodePool.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools#NodePool.FIELDS.locations) - // of all node pools and will result in nodes being added and/or removed. - repeated string locations = 13; - - // 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. - bool enable_kubernetes_alpha = 14; - - // The resource labels for the cluster to use to annotate any related - // Google Compute Engine resources. - map resource_labels = 15; - - // The fingerprint of the set of labels for this cluster. - string label_fingerprint = 16; - - // Configuration for the legacy ABAC authorization mode. - LegacyAbac legacy_abac = 18; - - // Configuration options for the NetworkPolicy feature. - NetworkPolicy network_policy = 19; - - // Configuration for cluster IP allocation. - IPAllocationPolicy ip_allocation_policy = 20; - - // The configuration options for master authorized networks feature. - MasterAuthorizedNetworksConfig master_authorized_networks_config = 22; - - // Configure the maintenance policy for this cluster. - MaintenancePolicy maintenance_policy = 23; - - // Configuration for Binary Authorization. - BinaryAuthorization binary_authorization = 24; - - // Cluster-level autoscaling configuration. - ClusterAutoscaling autoscaling = 26; - - // Configuration for cluster networking. - NetworkConfig network_config = 27; - - // 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. - MaxPodsConstraint default_max_pods_constraint = 30; - - // Configuration for exporting resource usages. Resource usage export is - // disabled when this config is unspecified. - ResourceUsageExportConfig resource_usage_export_config = 33; - - // Configuration controlling RBAC group membership information. - AuthenticatorGroupsConfig authenticator_groups_config = 34; - - // Configuration for private cluster. - PrivateClusterConfig private_cluster_config = 37; - - // Configuration of etcd encryption. - DatabaseEncryption database_encryption = 38; - - // Cluster-level Vertical Pod Autoscaling configuration. - VerticalPodAutoscaling vertical_pod_autoscaling = 39; - - // Shielded Nodes configuration. - ShieldedNodes shielded_nodes = 40; - - // Release channel configuration. If left unspecified on cluster creation and - // a version is specified, the cluster is enrolled in the most mature release - // channel where the version is available (first checking STABLE, then - // REGULAR, and finally RAPID). Otherwise, if no release channel - // configuration and no version is specified, the cluster is enrolled in the - // REGULAR channel with its default version. - ReleaseChannel release_channel = 41; - - // Configuration for the use of Kubernetes Service Accounts in GCP IAM - // policies. - WorkloadIdentityConfig workload_identity_config = 43; - - // Configuration for issuance of mTLS keys and certificates to Kubernetes - // pods. - MeshCertificates mesh_certificates = 67; - - // Configuration for the fine-grained cost management feature. - CostManagementConfig cost_management_config = 45; - - // Notification configuration of the cluster. - NotificationConfig notification_config = 49; - - // Configuration of Confidential Nodes. - // All the nodes in the cluster will be Confidential VM once enabled. - ConfidentialNodes confidential_nodes = 50; - - // Configuration for Identity Service component. - IdentityServiceConfig identity_service_config = 54; - - // [Output only] Server-defined URL for the resource. - string self_link = 100; - - // [Output only] The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field is deprecated, use location instead. - string zone = 101 [deprecated = true]; - - // [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. - string endpoint = 102; - - // 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 - string initial_cluster_version = 103; - - // [Output only] The current software version of the master endpoint. - string current_master_version = 104; - - // [Output only] Deprecated, use - // [NodePools.version](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools) - // 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. - string current_node_version = 105 [deprecated = true]; - - // [Output only] The time the cluster was created, in - // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string create_time = 106; - - // [Output only] The current status of this cluster. - Status status = 107; - - // [Output only] Deprecated. Use conditions instead. - // Additional information about the current status of this - // cluster, if available. - string status_message = 108 [deprecated = true]; - - // [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. - int32 node_ipv4_cidr_size = 109; - - // [Output only] The IP address range of the Kubernetes services in - // this cluster, in - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `1.2.3.4/29`). Service addresses are - // typically put in the last `/16` from the container CIDR. - string services_ipv4_cidr = 110; - - // Deprecated. Use node_pools.instance_group_urls. - repeated string instance_group_urls = 111 [deprecated = true]; - - // [Output only] The number of nodes currently in the cluster. Deprecated. - // Call Kubernetes API directly to retrieve node information. - int32 current_node_count = 112 [deprecated = true]; - - // [Output only] The time the cluster will be automatically - // deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string expire_time = 113; - - // [Output only] The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) - // or - // [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) - // in which the cluster resides. - string location = 114; - - // Enable the ability to use Cloud TPUs in this cluster. - bool enable_tpu = 115; - - // [Output only] The IP address range of the Cloud TPUs in this cluster, in - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `1.2.3.4/29`). - string tpu_ipv4_cidr_block = 116; - - // Which conditions caused the current cluster state. - repeated StatusCondition conditions = 118; - - // Autopilot configuration for the cluster. - Autopilot autopilot = 128; - - // Output only. Unique id for the cluster. - string id = 129 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Default NodePool settings for the entire cluster. These settings are - // overridden if specified on the specific NodePool object. - optional NodePoolDefaults node_pool_defaults = 131; - - // Logging configuration for the cluster. - LoggingConfig logging_config = 132; - - // Monitoring configuration for the cluster. - MonitoringConfig monitoring_config = 133; - - // Node pool configs that apply to all auto-provisioned node pools - // in autopilot clusters and node auto-provisioning enabled clusters. - NodePoolAutoConfig node_pool_auto_config = 136; - - // This checksum is computed by the server based on the value of cluster - // fields, and may be sent on update requests to ensure the client has an - // up-to-date value before proceeding. - string etag = 139; - - // Fleet information for the cluster. - Fleet fleet = 140; - - // Enable/Disable Security Posture API features for the cluster. - SecurityPostureConfig security_posture_config = 145; - - // Beta APIs Config - K8sBetaAPIConfig enable_k8s_beta_apis = 143; -} - -// K8sBetaAPIConfig , configuration for beta APIs -message K8sBetaAPIConfig { - // Enabled k8s beta APIs. - repeated string enabled_apis = 1; -} - -// SecurityPostureConfig defines the flags needed to enable/disable features for -// the Security Posture API. -message SecurityPostureConfig { - // Mode defines enablement mode for GKE Security posture features. - enum Mode { - // Default value not specified. - MODE_UNSPECIFIED = 0; - - // Disables Security Posture features on the cluster. - DISABLED = 1; - - // Applies Security Posture features on the cluster. - BASIC = 2; - } - - // VulnerabilityMode defines enablement mode for vulnerability scanning. - enum VulnerabilityMode { - // Default value not specified. - VULNERABILITY_MODE_UNSPECIFIED = 0; - - // Disables vulnerability scanning on the cluster. - VULNERABILITY_DISABLED = 1; - - // Applies basic vulnerability scanning on the cluster. - VULNERABILITY_BASIC = 2; - } - - // Sets which mode to use for Security Posture features. - optional Mode mode = 1; - - // Sets which mode to use for vulnerability scanning. - optional VulnerabilityMode vulnerability_mode = 2; -} - -// Node pool configs that apply to all auto-provisioned node pools -// in autopilot clusters and node auto-provisioning enabled clusters. -message NodePoolAutoConfig { - // 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 creation. Each tag within the list - // must comply with RFC1035. - NetworkTags network_tags = 1; -} - -// Subset of Nodepool message that has defaults. -message NodePoolDefaults { - // Subset of NodeConfig message that has defaults. - NodeConfigDefaults node_config_defaults = 1; -} - -// Subset of NodeConfig message that has defaults. -message NodeConfigDefaults { - // GCFS (Google Container File System, also known as Riptide) options. - GcfsConfig gcfs_config = 1; - - // Logging configuration for node pools. - NodePoolLoggingConfig logging_config = 3; -} - -// 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. -message ClusterUpdate { - // 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 - string desired_node_version = 4; - - // The monitoring service the cluster should use to write metrics. - // Currently available options: - // - // * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring - // service with a Kubernetes-native resource model - // * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no - // longer available as of GKE 1.15). - // * `none` - No metrics will be exported from the cluster. - // - // If left as an empty string,`monitoring.googleapis.com/kubernetes` will be - // used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. - string desired_monitoring_service = 5; - - // Configurations for the various addons available to run in the cluster. - AddonsConfig desired_addons_config = 6; - - // 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. - string desired_node_pool_id = 7; - - // The desired image type for the node pool. - // NOTE: Set the "desired_node_pool" field as well. - string desired_image_type = 8; - - // Configuration of etcd encryption. - DatabaseEncryption desired_database_encryption = 46; - - // Configuration for Workload Identity. - WorkloadIdentityConfig desired_workload_identity_config = 47; - - // Configuration for issuance of mTLS keys and certificates to Kubernetes - // pods. - MeshCertificates desired_mesh_certificates = 67; - - // Configuration for Shielded Nodes. - ShieldedNodes desired_shielded_nodes = 48; - - // The desired configuration for the fine-grained cost management feature. - CostManagementConfig desired_cost_management_config = 49; - - // DNSConfig contains clusterDNS config for this cluster. - DNSConfig desired_dns_config = 53; - - // 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. - NodePoolAutoscaling desired_node_pool_autoscaling = 9; - - // The desired list of Google Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster's nodes should be located. - // - // This list must always include the cluster's primary zone. - // - // Warning: changing cluster locations will update the locations of all node - // pools and will result in nodes being added and/or removed. - repeated string desired_locations = 10; - - // The desired configuration options for master authorized networks feature. - MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12; - - // Cluster-level autoscaling configuration. - ClusterAutoscaling desired_cluster_autoscaling = 15; - - // The desired configuration options for the Binary Authorization feature. - BinaryAuthorization desired_binary_authorization = 16; - - // The logging service the cluster should use to write logs. - // Currently available options: - // - // * `logging.googleapis.com/kubernetes` - The Cloud Logging - // service with a Kubernetes-native resource model - // * `logging.googleapis.com` - The legacy Cloud Logging service (no longer - // available as of GKE 1.15). - // * `none` - no logs will be exported from the cluster. - // - // If left as an empty string,`logging.googleapis.com/kubernetes` will be - // used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. - string desired_logging_service = 19; - - // The desired configuration for exporting resource usage. - ResourceUsageExportConfig desired_resource_usage_export_config = 21; - - // Cluster-level Vertical Pod Autoscaling configuration. - VerticalPodAutoscaling desired_vertical_pod_autoscaling = 22; - - // The desired private cluster configuration. - PrivateClusterConfig desired_private_cluster_config = 25; - - // The desired config of Intra-node visibility. - IntraNodeVisibilityConfig desired_intra_node_visibility_config = 26; - - // The desired status of whether to disable default sNAT for this cluster. - DefaultSnatStatus desired_default_snat_status = 28; - - // The desired release channel configuration. - ReleaseChannel desired_release_channel = 31; - - // The desired L4 Internal Load Balancer Subsetting configuration. - ILBSubsettingConfig desired_l4ilb_subsetting_config = 39; - - // The desired datapath provider for the cluster. - DatapathProvider desired_datapath_provider = 50; - - // The desired state of IPv6 connectivity to Google Services. - PrivateIPv6GoogleAccess desired_private_ipv6_google_access = 51; - - // The desired notification configuration. - NotificationConfig desired_notification_config = 55; - - // The desired authenticator groups config for the cluster. - AuthenticatorGroupsConfig desired_authenticator_groups_config = 63; - - // The desired logging configuration. - LoggingConfig desired_logging_config = 64; - - // The desired monitoring configuration. - MonitoringConfig desired_monitoring_config = 65; - - // The desired Identity Service component configuration. - IdentityServiceConfig desired_identity_service_config = 66; - - // ServiceExternalIPsConfig specifies the config for the use of Services with - // ExternalIPs field. - ServiceExternalIPsConfig desired_service_external_ips_config = 60; - - // Enable/Disable private endpoint for the cluster's master. - optional bool desired_enable_private_endpoint = 71; - - // 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 - string desired_master_version = 100; - - // The desired GCFS config for the cluster - GcfsConfig desired_gcfs_config = 109; - - // The desired network tags that apply to all auto-provisioned node pools - // in autopilot clusters and node auto-provisioning enabled clusters. - NetworkTags desired_node_pool_auto_config_network_tags = 110; - - // The desired config of Gateway API on this cluster. - GatewayAPIConfig desired_gateway_api_config = 114; - - // The current etag of the cluster. - // If an etag is provided and does not match the current etag of the cluster, - // update will be blocked and an ABORTED error will be returned. - string etag = 115; - - // The desired node pool logging configuration defaults for the cluster. - NodePoolLoggingConfig desired_node_pool_logging_config = 116; - - // The desired fleet configuration for the cluster. - Fleet desired_fleet = 117; - - // The desired stack type of the cluster. - // If a stack type is provided and does not match the current stack type of - // the cluster, update will attempt to change the stack type to the new type. - StackType desired_stack_type = 119; - - // The additional pod ranges to be added to the cluster. These pod ranges - // can be used by node pools to allocate pod IPs. - AdditionalPodRangesConfig additional_pod_ranges_config = 120; - - // The additional pod ranges that are to be removed from the cluster. - // The pod ranges specified here must have been specified earlier in the - // 'additional_pod_ranges_config' argument. - AdditionalPodRangesConfig removed_additional_pod_ranges_config = 121; - - // Kubernetes open source beta apis enabled on the cluster. Only beta apis - K8sBetaAPIConfig enable_k8s_beta_apis = 122; - - // Enable/Disable Security Posture API features for the cluster. - SecurityPostureConfig desired_security_posture_config = 124; - - // The desired network performance config. - NetworkConfig.ClusterNetworkPerformanceConfig - desired_network_performance_config = 125; - - // Enable/Disable FQDN Network Policy for the cluster. - optional bool desired_enable_fqdn_network_policy = 126; - - // The desired workload policy configuration for the autopilot cluster. - WorkloadPolicyConfig desired_autopilot_workload_policy_config = 128; - - // Desired Beta APIs to be enabled for cluster. - K8sBetaAPIConfig desired_k8s_beta_apis = 131; -} - -// AdditionalPodRangesConfig is the configuration for additional pod secondary -// ranges supporting the ClusterUpdate message. -message AdditionalPodRangesConfig { - // Name for pod secondary ipv4 range which has the actual range defined ahead. - repeated string pod_range_names = 1; - - // Output only. [Output only] Information for additional pod range. - repeated RangeInfo pod_range_info = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// RangeInfo contains the range name and the range utilization by this cluster. -message RangeInfo { - // Output only. [Output only] Name of a range. - string range_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. [Output only] The utilization of the range. - double utilization = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// This operation resource represents operations that may have happened or are -// happening on the cluster. All fields are output only. -message Operation { - // Current status of the operation. - enum Status { - // Not set. - STATUS_UNSPECIFIED = 0; - - // The operation has been created. - PENDING = 1; - - // The operation is currently running. - RUNNING = 2; - - // The operation is done, either cancelled or completed. - DONE = 3; - - // The operation is aborting. - ABORTING = 4; - } - - // Operation type categorizes the operation. - enum Type { - // Not set. - TYPE_UNSPECIFIED = 0; - - // The cluster is being created. The cluster should be assumed to be - // unusable until the operation finishes. - // - // In the event of the operation failing, the cluster will enter the [ERROR - // state][Cluster.Status.ERROR] and eventually be deleted. - CREATE_CLUSTER = 1; - - // The cluster is being deleted. The cluster should be assumed to be - // unusable as soon as this operation starts. - // - // In the event of the operation failing, the cluster will enter the [ERROR - // state][Cluster.Status.ERROR] and the deletion will be automatically - // retried until completed. - DELETE_CLUSTER = 2; - - // The [cluster - // version][google.container.v1.ClusterUpdate.desired_master_version] is - // being updated. Note that this includes "upgrades" to the same version, - // which are simply a recreation. This also includes - // [auto-upgrades](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades#upgrading_automatically). - // For more details, see [documentation on cluster - // upgrades](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades#cluster_upgrades). - UPGRADE_MASTER = 3; - - // A node pool is being updated. Despite calling this an "upgrade", this - // includes most forms of updates to node pools. This also includes - // [auto-upgrades](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-upgrades). - // - // This operation sets the - // [progress][google.container.v1.Operation.progress] field and may be - // [canceled][google.container.v1.ClusterManager.CancelOperation]. - // - // The upgrade strategy depends on [node pool - // configuration](https://cloud.google.com/kubernetes-engine/docs/concepts/node-pool-upgrade-strategies). - // The nodes are generally still usable during this operation. - UPGRADE_NODES = 4; - - // A problem has been detected with the control plane and is being repaired. - // This operation type is initiated by GKE. For more details, see - // [documentation on - // repairs](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#repairs). - REPAIR_CLUSTER = 5; - - // The cluster is being updated. This is a broad category of operations and - // includes operations that only change metadata as well as those that must - // recreate the entire cluster. If the control plane must be recreated, this - // will cause temporary downtime for zonal clusters. - // - // Some features require recreating the nodes as well. Those will be - // recreated as separate operations and the update may not be completely - // functional until the node pools recreations finish. Node recreations will - // generally follow [maintenance - // policies](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions). - // - // Some GKE-initiated operations use this type. This includes certain types - // of auto-upgrades and incident mitigations. - UPDATE_CLUSTER = 6; - - // A node pool is being created. The node pool should be assumed to be - // unusable until this operation finishes. In the event of an error, the - // node pool may be partially created. - // - // If enabled, [node - // autoprovisioning](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-provisioning) - // may have automatically initiated such operations. - CREATE_NODE_POOL = 7; - - // The node pool is being deleted. The node pool should be assumed to be - // unusable as soon as this operation starts. - DELETE_NODE_POOL = 8; - - // The node pool's [manamagent][google.container.v1.NodePool.management] - // field is being updated. These operations only update metadata and may be - // concurrent with most other operations. - SET_NODE_POOL_MANAGEMENT = 9; - - // A problem has been detected with nodes and [they are being - // repaired](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-repair). - // This operation type is initiated by GKE, typically automatically. This - // operation may be concurrent with other operations and there may be - // multiple repairs occurring on the same node pool. - AUTO_REPAIR_NODES = 10; - - // Unused. Automatic node upgrade uses - // [UPGRADE_NODES][google.container.v1.Operation.Type.UPGRADE_NODES]. - AUTO_UPGRADE_NODES = 11 [deprecated = true]; - - // Unused. Updating labels uses - // [UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER]. - SET_LABELS = 12 [deprecated = true]; - - // Unused. Updating master auth uses - // [UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER]. - SET_MASTER_AUTH = 13 [deprecated = true]; - - // The node pool is being resized. With the exception of resizing to or from - // size zero, the node pool is generally usable during this operation. - SET_NODE_POOL_SIZE = 14; - - // Unused. Updating network policy uses - // [UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER]. - SET_NETWORK_POLICY = 15 [deprecated = true]; - - // Unused. Updating maintenance policy uses - // [UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER]. - SET_MAINTENANCE_POLICY = 16 [deprecated = true]; - - // The control plane is being resized. This operation type is initiated by - // GKE. These operations are often performed preemptively to ensure that the - // control plane has sufficient resources and is not typically an indication - // of issues. For more details, see - // [documentation on - // resizes](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#repairs). - RESIZE_CLUSTER = 18; - } - - // The server-assigned ID for the operation. - string name = 1; - - // The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // operation is taking place. This field is deprecated, use location instead. - string zone = 2 [deprecated = true]; - - // The operation type. - Type operation_type = 3; - - // The current status of the operation. - Status status = 4; - - // Detailed operation progress, if available. - string detail = 8; - - // Output only. If an error has occurred, a textual description of the error. - // Deprecated. Use the field error instead. - string status_message = 5 - [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; - - // Server-defined URI for the operation. Example: - // `https://container.googleapis.com/v1alpha1/projects/123/locations/us-central1/operations/operation-123`. - string self_link = 6; - - // Server-defined URI for the target of the operation. The format of this is a - // URI to the resource being modified (such as a cluster, node pool, or node). - // For node pool repairs, there may be multiple nodes being repaired, but only - // one will be the target. - // - // Examples: - // - // - - // ## - // `https://container.googleapis.com/v1/projects/123/locations/us-central1/clusters/my-cluster` - // - // ## - // `https://container.googleapis.com/v1/projects/123/zones/us-central1-c/clusters/my-cluster/nodePools/my-np` - // - // `https://container.googleapis.com/v1/projects/123/zones/us-central1-c/clusters/my-cluster/nodePools/my-np/node/my-node` - string target_link = 7; - - // [Output only] The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) - // or - // [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) - // in which the cluster resides. - string location = 9; - - // [Output only] The time the operation started, in - // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string start_time = 10; - - // [Output only] The time the operation completed, in - // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string end_time = 11; - - // Output only. [Output only] Progress information for an operation. - OperationProgress progress = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Which conditions caused the current cluster state. - // Deprecated. Use field error instead. - repeated StatusCondition cluster_conditions = 13 [deprecated = true]; - - // Which conditions caused the current node pool state. - // Deprecated. Use field error instead. - repeated StatusCondition nodepool_conditions = 14 [deprecated = true]; - - // The error result of the operation in case of failure. - google.rpc.Status error = 15; -} - -// Information about operation (or operation stage) progress. -message OperationProgress { - // Progress metric is (string, int|float|string) pair. - message Metric { - // Required. Metric name, e.g., "nodes total", "percent done". - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Strictly one of the values is required. - oneof value { - // For metrics with integer value. - int64 int_value = 2; - - // For metrics with floating point value. - double double_value = 3; - - // For metrics with custom values (ratios, visual progress, etc.). - string string_value = 4; - } - } - - // A non-parameterized string describing an operation stage. - // Unset for single-stage operations. - string name = 1; - - // Status of an operation stage. - // Unset for single-stage operations. - Operation.Status status = 2; - - // Progress metric bundle, for example: - // metrics: [{name: "nodes done", int_value: 15}, - // {name: "nodes total", int_value: 32}] - // or - // metrics: [{name: "progress", double_value: 0.56}, - // {name: "progress scale", double_value: 1.0}] - repeated Metric metrics = 3; - - // Substages of an operation or a stage. - repeated OperationProgress stages = 4; -} - -// CreateClusterRequest creates a cluster. -message CreateClusterRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the parent - // field. - string zone = 2 [deprecated = true]; - - // Required. A [cluster - // resource](https://cloud.google.com/container-engine/reference/rest/v1/projects.locations.clusters) - Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; - - // The parent (project and location) where the cluster will be created. - // Specified in the format `projects/*/locations/*`. - string parent = 5; -} - -// GetClusterRequest gets the settings of a cluster. -message GetClusterRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to retrieve. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // The name (project, location, cluster) of the cluster to retrieve. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 5; -} - -// UpdateClusterRequest updates the settings of a cluster. -message UpdateClusterRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Required. A description of the update. - ClusterUpdate update = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to update. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 5; -} - -// UpdateNodePoolRequests update a node pool's image and/or version. -message UpdateNodePoolRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Deprecated. The name of the node pool to upgrade. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [deprecated = true]; - - // 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 - string node_version = 5 [(google.api.field_behavior) = REQUIRED]; - - // Required. The desired image type for the node pool. Please see - // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for - // available image types. - string image_type = 6 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster, node pool) of the node pool to - // update. Specified in the format - // `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 8; - - // The desired list of Google Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) in which the - // node pool's nodes should be located. Changing the locations for a node pool - // will result in nodes being either created or removed from the node pool, - // depending on whether locations are being added or removed. - repeated string locations = 13; - - // The desired workload metadata config for the node pool. - WorkloadMetadataConfig workload_metadata_config = 14; - - // Upgrade settings control disruption and speed of the upgrade. - NodePool.UpgradeSettings upgrade_settings = 15; - - // The desired network tags to be applied to all nodes in the node pool. - // If this field is not present, the tags will not be changed. Otherwise, - // the existing network tags will be *replaced* with the provided tags. - NetworkTags tags = 16; - - // The desired node taints to be applied to all nodes in the node pool. - // If this field is not present, the taints will not be changed. Otherwise, - // the existing node taints will be *replaced* with the provided taints. - NodeTaints taints = 17; - - // The desired node labels to be applied to all nodes in the node pool. - // If this field is not present, the labels will not be changed. Otherwise, - // the existing node labels will be *replaced* with the provided labels. - NodeLabels labels = 18; - - // Parameters that can be configured on Linux nodes. - LinuxNodeConfig linux_node_config = 19; - - // Node kubelet configs. - NodeKubeletConfig kubelet_config = 20; - - // Node network config. - NodeNetworkConfig node_network_config = 21; - - // GCFS config. - GcfsConfig gcfs_config = 22; - - // Confidential nodes config. - // All the nodes in the node pool will be Confidential VM once enabled. - ConfidentialNodes confidential_nodes = 23; - - // Enable or disable gvnic on the node pool. - VirtualNIC gvnic = 29; - - // The current etag of the node pool. - // If an etag is provided and does not match the current etag of the node - // pool, update will be blocked and an ABORTED error will be returned. - string etag = 30; - - // Enable or disable NCCL fast socket for the node pool. - FastSocket fast_socket = 31; - - // Logging configuration. - NodePoolLoggingConfig logging_config = 32; - - // The resource labels for the node pool to use to annotate any related - // Google Compute Engine resources. - ResourceLabels resource_labels = 33; - - // Parameters that can be configured on Windows nodes. - WindowsNodeConfig windows_node_config = 34; -} - -// SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool. -message SetNodePoolAutoscalingRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Deprecated. The name of the node pool to upgrade. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [deprecated = true]; - - // Required. Autoscaling configuration for the node pool. - NodePoolAutoscaling autoscaling = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster, node pool) of the node pool to set - // autoscaler settings. Specified in the format - // `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 6; -} - -// SetLoggingServiceRequest sets the logging service of a cluster. -message SetLoggingServiceRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Required. The logging service the cluster should use to write logs. - // Currently available options: - // - // * `logging.googleapis.com/kubernetes` - The Cloud Logging - // service with a Kubernetes-native resource model - // * `logging.googleapis.com` - The legacy Cloud Logging service (no longer - // available as of GKE 1.15). - // * `none` - no logs will be exported from the cluster. - // - // If left as an empty string,`logging.googleapis.com/kubernetes` will be - // used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. - string logging_service = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set logging. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 5; -} - -// SetMonitoringServiceRequest sets the monitoring service of a cluster. -message SetMonitoringServiceRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Required. The monitoring service the cluster should use to write metrics. - // Currently available options: - // - // * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring - // service with a Kubernetes-native resource model - // * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no - // longer available as of GKE 1.15). - // * `none` - No metrics will be exported from the cluster. - // - // If left as an empty string,`monitoring.googleapis.com/kubernetes` will be - // used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. - string monitoring_service = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set monitoring. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 6; -} - -// SetAddonsConfigRequest sets the addons associated with the cluster. -message SetAddonsConfigRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Required. The desired configurations for the various addons available to - // run in the cluster. - AddonsConfig addons_config = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set addons. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 6; -} - -// SetLocationsRequest sets the locations of the cluster. -message SetLocationsRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Required. The desired list of Google Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) 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. - repeated string locations = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set locations. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 6; -} - -// UpdateMasterRequest updates the master of the cluster. -message UpdateMasterRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // 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 - string master_version = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to update. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 7; -} - -// SetMasterAuthRequest updates the admin password of a cluster. -message SetMasterAuthRequest { - // Operation type: what type update to perform. - enum Action { - // Operation is unknown and will error out. - UNKNOWN = 0; - - // Set the password to a user generated value. - SET_PASSWORD = 1; - - // Generate a new password and set it to that. - GENERATE_PASSWORD = 2; - - // 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. - SET_USERNAME = 3; - } - - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Required. The exact form of action to be taken on the master auth. - Action action = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. A description of the update. - MasterAuth update = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set auth. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 7; -} - -// DeleteClusterRequest deletes a cluster. -message DeleteClusterRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to delete. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // The name (project, location, cluster) of the cluster to delete. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 4; -} - -// ListClustersRequest lists clusters. -message ListClustersRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides, or "-" for all zones. This field has been deprecated and - // replaced by the parent field. - string zone = 2 [deprecated = true]; - - // The parent (project and location) where the clusters will be listed. - // Specified in the format `projects/*/locations/*`. - // Location "-" matches all zones and all regions. - string parent = 4; -} - -// ListClustersResponse is the result of ListClustersRequest. -message ListClustersResponse { - // A list of clusters in the project in the specified zone, or - // across all ones. - repeated Cluster clusters = 1; - - // If any zones are listed here, the list of clusters returned - // may be missing those zones. - repeated string missing_zones = 2; -} - -// GetOperationRequest gets a single operation. -message GetOperationRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The server-assigned `name` of the operation. - // This field has been deprecated and replaced by the name field. - string operation_id = 3 [deprecated = true]; - - // The name (project, location, operation id) of the operation to get. - // Specified in the format `projects/*/locations/*/operations/*`. - string name = 5; -} - -// ListOperationsRequest lists operations. -message ListOperationsRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) to return - // operations for, or `-` for all zones. This field has been deprecated and - // replaced by the parent field. - string zone = 2 [deprecated = true]; - - // The parent (project and location) where the operations will be listed. - // Specified in the format `projects/*/locations/*`. - // Location "-" matches all zones and all regions. - string parent = 4; -} - -// CancelOperationRequest cancels a single operation. -message CancelOperationRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // operation resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The server-assigned `name` of the operation. - // This field has been deprecated and replaced by the name field. - string operation_id = 3 [deprecated = true]; - - // The name (project, location, operation id) of the operation to cancel. - // Specified in the format `projects/*/locations/*/operations/*`. - string name = 4; -} - -// ListOperationsResponse is the result of ListOperationsRequest. -message ListOperationsResponse { - // A list of operations in the project in the specified zone. - repeated Operation operations = 1; - - // If any zones are listed here, the list of operations returned - // may be missing the operations from those zones. - repeated string missing_zones = 2; -} - -// Gets the current Kubernetes Engine service configuration. -message GetServerConfigRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) to return - // operations for. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // The name (project and location) of the server config to get, - // specified in the format `projects/*/locations/*`. - string name = 4; -} - -// Kubernetes Engine service configuration. -message ServerConfig { - // ReleaseChannelConfig exposes configuration for a release channel. - message ReleaseChannelConfig { - // The release channel this configuration applies to. - ReleaseChannel.Channel channel = 1; - - // The default version for newly created clusters on the channel. - string default_version = 2; - - // List of valid versions for the channel. - repeated string valid_versions = 4; - } - - // Version of Kubernetes the service deploys by default. - string default_cluster_version = 1; - - // List of valid node upgrade target versions, in descending order. - repeated string valid_node_versions = 3; - - // Default image type. - string default_image_type = 4; - - // List of valid image types. - repeated string valid_image_types = 5; - - // List of valid master versions, in descending order. - repeated string valid_master_versions = 6; - - // List of release channel configurations. - repeated ReleaseChannelConfig channels = 9; -} - -// CreateNodePoolRequest creates a node pool for a cluster. -message CreateNodePoolRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the parent - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the parent field. - string cluster_id = 3 [deprecated = true]; - - // Required. The node pool to create. - NodePool node_pool = 4 [(google.api.field_behavior) = REQUIRED]; - - // The parent (project, location, cluster name) where the node pool will be - // created. Specified in the format - // `projects/*/locations/*/clusters/*`. - string parent = 6; -} - -// DeleteNodePoolRequest deletes a node pool for a cluster. -message DeleteNodePoolRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Deprecated. The name of the node pool to delete. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [deprecated = true]; - - // The name (project, location, cluster, node pool id) of the node pool to - // delete. Specified in the format - // `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 6; -} - -// ListNodePoolsRequest lists the node pool(s) for a cluster. -message ListNodePoolsRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the parent - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the parent field. - string cluster_id = 3 [deprecated = true]; - - // The parent (project, location, cluster name) where the node pools will be - // listed. Specified in the format `projects/*/locations/*/clusters/*`. - string parent = 5; -} - -// GetNodePoolRequest retrieves a node pool for a cluster. -message GetNodePoolRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Deprecated. The name of the node pool. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [deprecated = true]; - - // The name (project, location, cluster, node pool id) of the node pool to - // get. Specified in the format - // `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 6; -} - -// Settings for blue-green upgrade. -message BlueGreenSettings { - // Standard rollout policy is the default policy for blue-green. - message StandardRolloutPolicy { - // Blue pool size to drain in a batch. - oneof update_batch_size { - // Percentage of the blue pool nodes to drain in a batch. - // The range of this field should be (0.0, 1.0]. - float batch_percentage = 1; - - // Number of blue nodes to drain in a batch. - int32 batch_node_count = 2; - } - - // Soak time after each batch gets drained. Default to zero. - optional google.protobuf.Duration batch_soak_duration = 3; - } - - // The rollout policy controls the general rollout progress of blue-green. - oneof rollout_policy { - // Standard policy for the blue-green upgrade. - StandardRolloutPolicy standard_rollout_policy = 1; - } - - // Time needed after draining entire blue pool. After this period, blue pool - // will be cleaned up. - optional google.protobuf.Duration node_pool_soak_duration = 2; -} - -// 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. -message NodePool { - // These upgrade settings control the level of parallelism and the level of - // disruption caused by an upgrade. - // - // maxUnavailable controls the number of nodes that can be simultaneously - // unavailable. - // - // maxSurge controls the number of additional nodes that can be added to the - // node pool temporarily for the time of the upgrade to increase the number of - // available nodes. - // - // (maxUnavailable + maxSurge) determines the level of parallelism (how many - // nodes are being upgraded at the same time). - // - // Note: upgrades inevitably introduce some disruption since workloads need to - // be moved from old nodes to new, upgraded ones. Even if maxUnavailable=0, - // this holds true. (Disruption stays within the limits of - // PodDisruptionBudget, if it is configured.) - // - // Consider a hypothetical node pool with 5 nodes having maxSurge=2, - // maxUnavailable=1. This means the upgrade process upgrades 3 nodes - // simultaneously. It creates 2 additional (upgraded) nodes, then it brings - // down 3 old (not yet upgraded) nodes at the same time. This ensures that - // there are always at least 4 nodes available. - // - // These upgrade settings configure the upgrade strategy for the node pool. - // Use strategy to switch between the strategies applied to the node pool. - // - // If the strategy is ROLLING, use max_surge and max_unavailable to control - // the level of parallelism and the level of disruption caused by upgrade. - // 1. maxSurge controls the number of additional nodes that can be added to - // the node pool temporarily for the time of the upgrade to increase the - // number of available nodes. - // 2. maxUnavailable controls the number of nodes that can be simultaneously - // unavailable. - // 3. (maxUnavailable + maxSurge) determines the level of parallelism (how - // many nodes are being upgraded at the same time). - // - // If the strategy is BLUE_GREEN, use blue_green_settings to configure the - // blue-green upgrade related settings. - // 1. standard_rollout_policy is the default policy. The policy is used to - // control the way blue pool gets drained. The draining is executed in the - // batch mode. The batch size could be specified as either percentage of the - // node pool size or the number of nodes. batch_soak_duration is the soak - // time after each batch gets drained. - // 2. node_pool_soak_duration is the soak time after all blue nodes are - // drained. After this period, the blue pool nodes will be deleted. - message UpgradeSettings { - // The maximum number of nodes that can be created beyond the current size - // of the node pool during the upgrade process. - int32 max_surge = 1; - - // The maximum number of nodes that can be simultaneously unavailable during - // the upgrade process. A node is considered available if its status is - // Ready. - int32 max_unavailable = 2; - - // Update strategy of the node pool. - optional NodePoolUpdateStrategy strategy = 3; - - // Settings for blue-green upgrade strategy. - optional BlueGreenSettings blue_green_settings = 4; - } - - // UpdateInfo contains resource (instance groups, etc), status and other - // intermediate information relevant to a node pool upgrade. - message UpdateInfo { - // Information relevant to blue-green upgrade. - message BlueGreenInfo { - // Phase represents the different stages blue-green upgrade is running in. - enum Phase { - // Unspecified phase. - PHASE_UNSPECIFIED = 0; - - // blue-green upgrade has been initiated. - UPDATE_STARTED = 1; - - // Start creating green pool nodes. - CREATING_GREEN_POOL = 2; - - // Start cordoning blue pool nodes. - CORDONING_BLUE_POOL = 3; - - // Start draining blue pool nodes. - DRAINING_BLUE_POOL = 4; - - // Start soaking time after draining entire blue pool. - NODE_POOL_SOAKING = 5; - - // Start deleting blue nodes. - DELETING_BLUE_POOL = 6; - - // Rollback has been initiated. - ROLLBACK_STARTED = 7; - } - - // Current blue-green upgrade phase. - Phase phase = 1; - - // The resource URLs of the [managed instance groups] - // (/compute/docs/instance-groups/creating-groups-of-managed-instances) - // associated with blue pool. - repeated string blue_instance_group_urls = 2; - - // The resource URLs of the [managed instance groups] - // (/compute/docs/instance-groups/creating-groups-of-managed-instances) - // associated with green pool. - repeated string green_instance_group_urls = 3; - - // Time to start deleting blue pool to complete blue-green upgrade, - // in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string blue_pool_deletion_start_time = 4; - - // Version of green pool. - string green_pool_version = 5; - } - - // Information of a blue-green upgrade. - BlueGreenInfo blue_green_info = 1; - } - - // The current status of the node pool instance. - enum Status { - // Not set. - STATUS_UNSPECIFIED = 0; - - // The PROVISIONING state indicates the node pool is being created. - PROVISIONING = 1; - - // The RUNNING state indicates the node pool has been created - // and is fully usable. - RUNNING = 2; - - // 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. - RUNNING_WITH_ERROR = 3; - - // 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. - RECONCILING = 4; - - // The STOPPING state indicates the node pool is being deleted. - STOPPING = 5; - - // The ERROR state indicates the node pool may be unusable. Details - // can be found in the `statusMessage` field. - ERROR = 6; - } - - // PlacementPolicy defines the placement policy used by the node pool. - message PlacementPolicy { - // Type defines the type of placement policy. - enum Type { - // TYPE_UNSPECIFIED specifies no requirements on nodes - // placement. - TYPE_UNSPECIFIED = 0; - - // COMPACT specifies node placement in the same availability domain to - // ensure low communication latency. - COMPACT = 1; - } - - // The type of placement. - Type type = 1; - } - - // The name of the node pool. - string name = 1; - - // The node configuration of the pool. - NodeConfig config = 2; - - // The initial node count for the pool. You must ensure that your - // 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; - - // The list of Google Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) in which the - // NodePool's nodes should be located. - // - // If this value is unspecified during node pool creation, the - // [Cluster.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters#Cluster.FIELDS.locations) - // value will be used, instead. - // - // Warning: changing node pool locations will result in nodes being added - // and/or removed. - repeated string locations = 13; - - // Networking configuration for this NodePool. If specified, it overrides the - // cluster-level defaults. - NodeNetworkConfig network_config = 14; - - // [Output only] Server-defined URL for the resource. - string self_link = 100; - - // The version of Kubernetes running on this NodePool's nodes. If unspecified, - // it defaults as described - // [here](https://cloud.google.com/kubernetes-engine/versioning#specifying_node_version). - string version = 101; - - // [Output only] The resource URLs of the [managed instance - // groups](https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-managed-instances) - // associated with this node pool. - // During the node pool blue-green upgrade operation, the URLs contain both - // blue and green resources. - repeated string instance_group_urls = 102; - - // [Output only] The status of the nodes in this pool instance. - Status status = 103; - - // [Output only] Deprecated. Use conditions instead. - // Additional information about the current status of this - // node pool instance, if available. - string status_message = 104 [deprecated = true]; - - // Autoscaler configuration for this NodePool. Autoscaler is enabled - // only if a valid configuration is present. - NodePoolAutoscaling autoscaling = 4; - - // NodeManagement configuration for this NodePool. - NodeManagement management = 5; - - // The constraint on the maximum number of pods that can be run - // simultaneously on a node in the node pool. - MaxPodsConstraint max_pods_constraint = 6; - - // Which conditions caused the current node pool state. - repeated StatusCondition conditions = 105; - - // [Output only] The pod CIDR block size per node in this node pool. - int32 pod_ipv4_cidr_size = 7; - - // Upgrade settings control disruption and speed of the upgrade. - UpgradeSettings upgrade_settings = 107; - - // Specifies the node placement policy. - PlacementPolicy placement_policy = 108; - - // Output only. [Output only] Update info contains relevant information during - // a node pool update. - UpdateInfo update_info = 109 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // This checksum is computed by the server based on the value of node pool - // fields, and may be sent on update requests to ensure the client has an - // up-to-date value before proceeding. - string etag = 110; - - // Enable best effort provisioning for nodes - BestEffortProvisioning best_effort_provisioning = 113; -} - -// NodeManagement defines the set of node management services turned on for the -// node pool. -message NodeManagement { - // 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. - bool auto_upgrade = 1; - - // 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. - bool auto_repair = 2; - - // Specifies the Auto Upgrade knobs for the node pool. - AutoUpgradeOptions upgrade_options = 10; -} - -// Best effort provisioning. -message BestEffortProvisioning { - // When this is enabled, cluster/node pool creations will ignore non-fatal - // errors like stockout to best provision as many nodes as possible right now - // and eventually bring up all target number of nodes - bool enabled = 1; - - // Minimum number of nodes to be provisioned to be considered as succeeded, - // and the rest of nodes will be provisioned gradually and eventually when - // stockout issue has been resolved. - int32 min_provision_nodes = 2; -} - -// AutoUpgradeOptions defines the set of options for the user to control how -// the Auto Upgrades will proceed. -message AutoUpgradeOptions { - // [Output only] This field is set when upgrades are about to commence - // with the approximate start time for the upgrades, in - // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string auto_upgrade_start_time = 1; - - // [Output only] This field is set when upgrades are about to commence - // with the description of the upgrade. - string description = 2; -} - -// MaintenancePolicy defines the maintenance policy to be used for the cluster. -message MaintenancePolicy { - // Specifies the maintenance window in which maintenance may be performed. - MaintenanceWindow window = 1; - - // 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. - string resource_version = 3; -} - -// MaintenanceWindow defines the maintenance window to be used for the cluster. -message MaintenanceWindow { - oneof policy { - // DailyMaintenanceWindow specifies a daily maintenance operation window. - DailyMaintenanceWindow daily_maintenance_window = 2; - - // 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. - RecurringTimeWindow recurring_window = 3; - } - - // Exceptions to maintenance window. Non-emergency maintenance should not - // occur in these windows. - map maintenance_exclusions = 4; -} - -// Represents an arbitrary window of time. -message TimeWindow { - oneof options { - // MaintenanceExclusionOptions provides maintenance exclusion related - // options. - MaintenanceExclusionOptions maintenance_exclusion_options = 3; - } - - // The time that the window first starts. - google.protobuf.Timestamp start_time = 1; - - // The time that the window ends. The end time should take place after the - // start time. - google.protobuf.Timestamp end_time = 2; -} - -// Represents the Maintenance exclusion option. -message MaintenanceExclusionOptions { - // Scope of exclusion. - enum Scope { - // NO_UPGRADES excludes all upgrades, including patch upgrades and minor - // upgrades across control planes and nodes. This is the default exclusion - // behavior. - NO_UPGRADES = 0; - - // NO_MINOR_UPGRADES excludes all minor upgrades for the cluster, only - // patches are allowed. - NO_MINOR_UPGRADES = 1; - - // NO_MINOR_OR_NODE_UPGRADES excludes all minor upgrades for the cluster, - // and also exclude all node pool upgrades. Only control - // plane patches are allowed. - NO_MINOR_OR_NODE_UPGRADES = 2; - } - - // Scope specifies the upgrade scope which upgrades are blocked by the - // exclusion. - Scope scope = 1; -} - -// Represents an arbitrary window of time that recurs. -message RecurringTimeWindow { - // The window of the first recurrence. - TimeWindow window = 1; - - // 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. - string recurrence = 2; -} - -// Time window specified for daily maintenance operations. -message DailyMaintenanceWindow { - // Time within the maintenance window to start the maintenance operations. - // Time format should be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) - // format "HH:MM", where HH : [00-23] and MM : [00-59] GMT. - string start_time = 2; - - // [Output only] Duration of the time window, automatically chosen to be - // smallest possible in the given scenario. - // Duration will be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) - // format "PTnHnMnS". - string duration = 3; -} - -// SetNodePoolManagementRequest sets the node management properties of a node -// pool. -message SetNodePoolManagementRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to update. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Deprecated. The name of the node pool to update. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [deprecated = true]; - - // Required. NodeManagement configuration for the node pool. - NodeManagement management = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster, node pool id) of the node pool to set - // management properties. Specified in the format - // `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 7; -} - -// SetNodePoolSizeRequest sets the size of a node pool. -message SetNodePoolSizeRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to update. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Deprecated. The name of the node pool to update. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [deprecated = true]; - - // Required. The desired node count for the pool. - int32 node_count = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster, node pool id) of the node pool to set - // size. - // Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 7; -} - -// CompleteNodePoolUpgradeRequest sets the name of target node pool to complete -// upgrade. -message CompleteNodePoolUpgradeRequest { - // The name (project, location, cluster, node pool id) of the node pool to - // complete upgrade. - // Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 1; -} - -// RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed -// NodePool upgrade. This will be an no-op if the last upgrade successfully -// completed. -message RollbackNodePoolUpgradeRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to rollback. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Deprecated. The name of the node pool to rollback. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [deprecated = true]; - - // The name (project, location, cluster, node pool id) of the node poll to - // rollback upgrade. - // Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 6; - - // Option for rollback to ignore the PodDisruptionBudget. - // Default value is false. - bool respect_pdb = 7; -} - -// ListNodePoolsResponse is the result of ListNodePoolsRequest. -message ListNodePoolsResponse { - // A list of node pools for a cluster. - repeated NodePool node_pools = 1; -} - -// 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. -message ClusterAutoscaling { - // Defines possible options for autoscaling_profile field. - enum AutoscalingProfile { - // No change to autoscaling configuration. - PROFILE_UNSPECIFIED = 0; - - // Prioritize optimizing utilization of resources. - OPTIMIZE_UTILIZATION = 1; - - // Use default (balanced) autoscaling configuration. - BALANCED = 2; - } - - // Enables automatic node pool creation and deletion. - bool enable_node_autoprovisioning = 1; - - // Contains global constraints regarding minimum and maximum - // amount of resources in the cluster. - repeated ResourceLimit resource_limits = 2; - - // Defines autoscaling behaviour. - AutoscalingProfile autoscaling_profile = 3; - - // AutoprovisioningNodePoolDefaults contains defaults for a node pool - // created by NAP. - AutoprovisioningNodePoolDefaults autoprovisioning_node_pool_defaults = 4; - - // The list of Google Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) in which the - // NodePool's nodes can be created by NAP. - repeated string autoprovisioning_locations = 5; -} - -// AutoprovisioningNodePoolDefaults contains defaults for a node pool created -// by NAP. -message AutoprovisioningNodePoolDefaults { - // Scopes that are used by NAP when creating node pools. - repeated string oauth_scopes = 1; - - // The Google Cloud Platform Service Account to be used by the node VMs. - string service_account = 2; - - // Specifies the upgrade settings for NAP created node pools - NodePool.UpgradeSettings upgrade_settings = 3; - - // Specifies the node management options for NAP created node-pools. - NodeManagement management = 4; - - // Deprecated. Minimum CPU platform to be used for NAP created node pools. - // 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](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform). - // This field is deprecated, min_cpu_platform should be specified using - // `cloud.google.com/requested-min-cpu-platform` label selector on the pod. - // To unset the min cpu platform field pass "automatic" - // as field value. - string min_cpu_platform = 5 [deprecated = true]; - - // 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. - int32 disk_size_gb = 6; - - // Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or - // 'pd-balanced') - // - // If unspecified, the default disk type is 'pd-standard' - string disk_type = 7; - - // Shielded Instance options. - ShieldedInstanceConfig shielded_instance_config = 8; - - // The Customer Managed Encryption Key used to encrypt the boot disk attached - // to each node in the node pool. This should be of the form - // projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. - // For more information about protecting resources with Cloud KMS Keys please - // see: - // https://cloud.google.com/compute/docs/disks/customer-managed-encryption - string boot_disk_kms_key = 9; - - // The image type to use for NAP created node. Please see - // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for - // available image types. - string image_type = 10; - - // Enable or disable Kubelet read only port. - optional bool insecure_kubelet_readonly_port_enabled = 13; -} - -// Contains information about amount of some resource in the cluster. -// For memory, value should be in GB. -message ResourceLimit { - // Resource name "cpu", "memory" or gpu-specific string. - string resource_type = 1; - - // Minimum amount of the resource in the cluster. - int64 minimum = 2; - - // Maximum amount of the resource in the cluster. - int64 maximum = 3; -} - -// NodePoolAutoscaling contains information required by cluster autoscaler to -// adjust the size of the node pool to the current cluster usage. -message NodePoolAutoscaling { - // Location policy specifies how zones are picked when scaling up the - // nodepool. - enum LocationPolicy { - // Not set. - LOCATION_POLICY_UNSPECIFIED = 0; - - // BALANCED is a best effort policy that aims to balance the sizes of - // different zones. - BALANCED = 1; - - // ANY policy picks zones that have the highest capacity available. - ANY = 2; - } - - // Is autoscaling enabled for this node pool. - bool enabled = 1; - - // Minimum number of nodes for one location in the NodePool. Must be >= 1 and - // <= max_node_count. - int32 min_node_count = 2; - - // Maximum number of nodes for one location in the NodePool. Must be >= - // min_node_count. There has to be enough quota to scale up the cluster. - int32 max_node_count = 3; - - // Can this node pool be deleted automatically. - bool autoprovisioned = 4; - - // Location policy used when scaling up a nodepool. - LocationPolicy location_policy = 5; - - // Minimum number of nodes in the node pool. Must be greater than 1 less than - // total_max_node_count. - // The total_*_node_count fields are mutually exclusive with the *_node_count - // fields. - int32 total_min_node_count = 6; - - // Maximum number of nodes in the node pool. Must be greater than - // total_min_node_count. There has to be enough quota to scale up the cluster. - // The total_*_node_count fields are mutually exclusive with the *_node_count - // fields. - int32 total_max_node_count = 7; -} - -// 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 -message SetLabelsRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Required. The labels to set for that cluster. - map resource_labels = 4 - [(google.api.field_behavior) = REQUIRED]; - - // 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. - string label_fingerprint = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster name) of the cluster to set labels. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 7; -} - -// SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for -// a cluster. -message SetLegacyAbacRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to update. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Required. Whether ABAC authorization will be enabled in the cluster. - bool enabled = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster name) of the cluster to set legacy - // abac. Specified in the format `projects/*/locations/*/clusters/*`. - string name = 6; -} - -// StartIPRotationRequest creates a new IP for the cluster and then performs -// a node upgrade on each node pool to point to the new IP. -message StartIPRotationRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // The name (project, location, cluster name) of the cluster to start IP - // rotation. Specified in the format `projects/*/locations/*/clusters/*`. - string name = 6; - - // Whether to rotate credentials during IP rotation. - bool rotate_credentials = 7; -} - -// CompleteIPRotationRequest moves the cluster master back into single-IP mode. -message CompleteIPRotationRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // The name (project, location, cluster name) of the cluster to complete IP - // rotation. Specified in the format `projects/*/locations/*/clusters/*`. - string name = 7; -} - -// AcceleratorConfig represents a Hardware Accelerator request. -message AcceleratorConfig { - // The number of the accelerator cards exposed to an instance. - int64 accelerator_count = 1; - - // The accelerator type resource name. List of supported accelerators - // [here](https://cloud.google.com/compute/docs/gpus) - string accelerator_type = 2; - - // Size of partitions to create on the GPU. Valid values are described in the - // NVIDIA [mig user - // guide](https://docs.nvidia.com/datacenter/tesla/mig-user-guide/#partitioning). - string gpu_partition_size = 3; - - // The configuration for GPU sharing options. - optional GPUSharingConfig gpu_sharing_config = 5; - - // The configuration for auto installation of GPU driver. - optional GPUDriverInstallationConfig gpu_driver_installation_config = 6; -} - -// GPUSharingConfig represents the GPU sharing configuration for Hardware -// Accelerators. -message GPUSharingConfig { - // The type of GPU sharing strategy currently provided. - enum GPUSharingStrategy { - // Default value. - GPU_SHARING_STRATEGY_UNSPECIFIED = 0; - - // GPUs are time-shared between containers. - TIME_SHARING = 1; - } - - // The max number of containers that can share a physical GPU. - int64 max_shared_clients_per_gpu = 1; - - // The type of GPU sharing strategy to enable on the GPU node. - optional GPUSharingStrategy gpu_sharing_strategy = 2; -} - -// GPUDriverInstallationConfig specifies the version of GPU driver to be auto -// installed. -message GPUDriverInstallationConfig { - // The GPU driver version to install. - enum GPUDriverVersion { - // Default value is to not install any GPU driver. - GPU_DRIVER_VERSION_UNSPECIFIED = 0; - - // Disable GPU driver auto installation and needs manual installation - INSTALLATION_DISABLED = 1; - - // "Default" GPU driver in COS and Ubuntu. - DEFAULT = 2; - - // "Latest" GPU driver in COS. - LATEST = 3; - } - - // Mode for how the GPU driver is installed. - optional GPUDriverVersion gpu_driver_version = 1; -} - -// WorkloadMetadataConfig defines the metadata configuration to expose to -// workloads on the node pool. -message WorkloadMetadataConfig { - // Mode is the configuration for how to expose metadata to workloads running - // on the node. - enum Mode { - // Not set. - MODE_UNSPECIFIED = 0; - - // Expose all Compute Engine metadata to pods. - GCE_METADATA = 1; - - // Run the GKE Metadata Server on this node. The GKE Metadata Server exposes - // a metadata API to workloads that is compatible with the V1 Compute - // Metadata APIs exposed by the Compute Engine and App Engine Metadata - // Servers. This feature can only be enabled if Workload Identity is enabled - // at the cluster level. - GKE_METADATA = 2; - } - - // Mode is the configuration for how to expose metadata to workloads running - // on the node pool. - Mode mode = 2; -} - -// SetNetworkPolicyRequest enables/disables network policy for a cluster. -message SetNetworkPolicyRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Required. Configuration options for the NetworkPolicy feature. - NetworkPolicy network_policy = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster name) of the cluster to set networking - // policy. Specified in the format `projects/*/locations/*/clusters/*`. - string name = 6; -} - -// SetMaintenancePolicyRequest sets the maintenance policy for a cluster. -message SetMaintenancePolicyRequest { - // Required. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. - string zone = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the cluster to update. - string cluster_id = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. The maintenance policy to be set for the cluster. An empty field - // clears the existing maintenance policy. - MaintenancePolicy maintenance_policy = 4 - [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster name) of the cluster to set - // maintenance policy. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 5; -} - -// StatusCondition describes why a cluster or a node pool has a certain status -// (e.g., ERROR or DEGRADED). -message StatusCondition { - // Code for each condition - enum Code { - // UNKNOWN indicates a generic condition. - UNKNOWN = 0; - - // GCE_STOCKOUT indicates that Google Compute Engine resources are - // temporarily unavailable. - GCE_STOCKOUT = 1; - - // GKE_SERVICE_ACCOUNT_DELETED indicates that the user deleted their robot - // service account. - GKE_SERVICE_ACCOUNT_DELETED = 2; - - // Google Compute Engine quota was exceeded. - GCE_QUOTA_EXCEEDED = 3; - - // Cluster state was manually changed by an SRE due to a system logic error. - SET_BY_OPERATOR = 4; - - // Unable to perform an encrypt operation against the CloudKMS key used for - // etcd level encryption. - CLOUD_KMS_KEY_ERROR = 7; - - // Cluster CA is expiring soon. - CA_EXPIRING = 9; - } - - // Machine-friendly representation of the condition - // Deprecated. Use canonical_code instead. - Code code = 1 [deprecated = true]; - - // Human-friendly representation of the condition - string message = 2; - - // Canonical code of the condition. - google.rpc.Code canonical_code = 3; -} - -// NetworkConfig reports the relative names of network & subnetwork. -message NetworkConfig { - // Configuration of network bandwidth tiers - message ClusterNetworkPerformanceConfig { - // Node network tier - enum Tier { - // Default value - TIER_UNSPECIFIED = 0; - - // Higher bandwidth, actual values based on VM size. - TIER_1 = 1; - } - - // Specifies the total network bandwidth tier for NodePools in the cluster. - optional Tier total_egress_bandwidth_tier = 1; - } - - // Output only. The relative name of the Google Compute Engine - // [network][google.container.v1.NetworkConfig.network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) - // to which the cluster is connected. Example: - // projects/my-project/global/networks/my-network - string network = 1; - - // Output only. The relative name of the Google Compute Engine - // [subnetwork](https://cloud.google.com/compute/docs/vpc) to which the - // cluster is connected. Example: - // projects/my-project/regions/us-central1/subnetworks/my-subnet - string subnetwork = 2; - - // Whether Intra-node visibility is enabled for this cluster. - // This makes same node pod to pod traffic visible for VPC network. - bool enable_intra_node_visibility = 5; - - // Whether the cluster disables default in-node sNAT rules. In-node sNAT rules - // will be disabled when default_snat_status is disabled. When disabled is set - // to false, default IP masquerade rules will be applied to the nodes to - // prevent sNAT on cluster internal traffic. - DefaultSnatStatus default_snat_status = 7; - - // Whether L4ILB Subsetting is enabled for this cluster. - bool enable_l4ilb_subsetting = 10; - - // The desired datapath provider for this cluster. By default, uses the - // IPTables-based kube-proxy implementation. - DatapathProvider datapath_provider = 11; - - // The desired state of IPv6 connectivity to Google Services. - // By default, no private IPv6 access to or from Google Services (all access - // will be via IPv4) - PrivateIPv6GoogleAccess private_ipv6_google_access = 12; - - // DNSConfig contains clusterDNS config for this cluster. - DNSConfig dns_config = 13; - - // ServiceExternalIPsConfig specifies if services with externalIPs field are - // blocked or not. - ServiceExternalIPsConfig service_external_ips_config = 15; - - // GatewayAPIConfig contains the desired config of Gateway API on this - // cluster. - GatewayAPIConfig gateway_api_config = 16; - - // Network bandwidth tier configuration. - ClusterNetworkPerformanceConfig network_performance_config = 18; - - // Whether FQDN Network Policy is enabled on this cluster. - optional bool enable_fqdn_network_policy = 19; -} - -// GatewayAPIConfig contains the desired config of Gateway API on this cluster. -message GatewayAPIConfig { - // Channel describes if/how Gateway API should be installed and implemented in - // a cluster. - enum Channel { - // Default value. - CHANNEL_UNSPECIFIED = 0; - - // Gateway API support is disabled - CHANNEL_DISABLED = 1; - - // Gateway API support is enabled, experimental CRDs are installed - CHANNEL_EXPERIMENTAL = 3; - - // Gateway API support is enabled, standard CRDs are installed - CHANNEL_STANDARD = 4; - } - - // The Gateway API release channel to use for Gateway API. - Channel channel = 1; -} - -// Config to block services with externalIPs field. -message ServiceExternalIPsConfig { - // Whether Services with ExternalIPs field are allowed or not. - bool enabled = 1; -} - -// GetOpenIDConfigRequest gets the OIDC discovery document for the -// cluster. See the OpenID Connect Discovery 1.0 specification for details. -message GetOpenIDConfigRequest { - // The cluster (project, location, cluster name) to get the discovery document - // for. Specified in the format `projects/*/locations/*/clusters/*`. - string parent = 1; -} - -// GetOpenIDConfigResponse is an OIDC discovery document for the cluster. -// See the OpenID Connect Discovery 1.0 specification for details. -message GetOpenIDConfigResponse { - // OIDC Issuer. - string issuer = 1; - - // JSON Web Key uri. - string jwks_uri = 2; - - // Supported response types. - repeated string response_types_supported = 3; - - // Supported subject types. - repeated string subject_types_supported = 4; - - // supported ID Token signing Algorithms. - repeated string id_token_signing_alg_values_supported = 5; - - // Supported claims. - repeated string claims_supported = 6; - - // Supported grant types. - repeated string grant_types = 7; -} - -// GetJSONWebKeysRequest gets the public component of the keys used by the -// cluster to sign token requests. This will be the jwks_uri for the discover -// document returned by getOpenIDConfig. See the OpenID Connect -// Discovery 1.0 specification for details. -message GetJSONWebKeysRequest { - // The cluster (project, location, cluster name) to get keys for. Specified in - // the format `projects/*/locations/*/clusters/*`. - string parent = 1; -} - -// Jwk is a JSON Web Key as specified in RFC 7517 -message Jwk { - // Key Type. - string kty = 1; - - // Algorithm. - string alg = 2; - - // Permitted uses for the public keys. - string use = 3; - - // Key ID. - string kid = 4; - - // Used for RSA keys. - string n = 5; - - // Used for RSA keys. - string e = 6; - - // Used for ECDSA keys. - string x = 7; - - // Used for ECDSA keys. - string y = 8; - - // Used for ECDSA keys. - string crv = 9; -} - -// GetJSONWebKeysResponse is a valid JSON Web Key Set as specififed in rfc 7517 -message GetJSONWebKeysResponse { - // The public component of the keys used by the cluster to sign token - // requests. - repeated Jwk keys = 1; -} - -// CheckAutopilotCompatibilityRequest requests getting the blockers for the -// given operation in the cluster. -message CheckAutopilotCompatibilityRequest { - // The name (project, location, cluster) of the cluster to retrieve. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 1; -} - -// AutopilotCompatibilityIssue contains information about a specific -// compatibility issue with Autopilot mode. -message AutopilotCompatibilityIssue { - // The type of the reported issue. - enum IssueType { - // Default value, should not be used. - UNSPECIFIED = 0; - - // Indicates that the issue is a known incompatibility between the - // cluster and Autopilot mode. - INCOMPATIBILITY = 1; - - // Indicates the issue is an incompatibility if customers take no further - // action to resolve. - ADDITIONAL_CONFIG_REQUIRED = 2; - - // Indicates the issue is not an incompatibility, but depending on the - // workloads business logic, there is a potential that they won't work on - // Autopilot. - PASSED_WITH_OPTIONAL_CONFIG = 3; - } - - // The last time when this issue was observed. - google.protobuf.Timestamp last_observation = 1; - - // The constraint type of the issue. - string constraint_type = 2; - - // The incompatibility type of this issue. - IssueType incompatibility_type = 3; - - // The name of the resources which are subject to this issue. - repeated string subjects = 4; - - // A URL to a public documnetation, which addresses resolving this issue. - string documentation_url = 5; - - // The description of the issue. - string description = 6; -} - -// CheckAutopilotCompatibilityResponse has a list of compatibility issues. -message CheckAutopilotCompatibilityResponse { - // The list of issues for the given operation. - repeated AutopilotCompatibilityIssue issues = 1; - - // The summary of the autopilot compatibility response. - string summary = 2; -} - -// ReleaseChannel indicates which release channel a cluster is -// subscribed to. Release channels are arranged in order of risk. -// -// When a cluster is subscribed to a release channel, Google maintains -// both the master version and the node version. Node auto-upgrade -// defaults to true and cannot be disabled. -message ReleaseChannel { - // Possible values for 'channel'. - enum Channel { - // No channel specified. - UNSPECIFIED = 0; - - // RAPID channel is offered on an early access basis for customers who want - // to test new releases. - // - // WARNING: Versions available in the RAPID Channel may be subject to - // unresolved issues with no known workaround and are not subject to any - // SLAs. - RAPID = 1; - - // Clusters subscribed to REGULAR receive versions that are considered GA - // quality. REGULAR is intended for production users who want to take - // advantage of new features. - REGULAR = 2; - - // Clusters subscribed to STABLE receive versions that are known to be - // stable and reliable in production. - STABLE = 3; - } - - // channel specifies which release channel the cluster is subscribed to. - Channel channel = 1; -} - -// Configuration for fine-grained cost management feature. -message CostManagementConfig { - // Whether the feature is enabled or not. - bool enabled = 1; -} - -// IntraNodeVisibilityConfig contains the desired config of the intra-node -// visibility on this cluster. -message IntraNodeVisibilityConfig { - // Enables intra node visibility for this cluster. - bool enabled = 1; -} - -// ILBSubsettingConfig contains the desired config of L4 Internal LoadBalancer -// subsetting on this cluster. -message ILBSubsettingConfig { - // Enables l4 ILB subsetting for this cluster. - bool enabled = 1; -} - -// DNSConfig contains the desired set of options for configuring clusterDNS. -message DNSConfig { - // Provider lists the various in-cluster DNS providers. - enum Provider { - // Default value - PROVIDER_UNSPECIFIED = 0; - - // Use GKE default DNS provider(kube-dns) for DNS resolution. - PLATFORM_DEFAULT = 1; - - // Use CloudDNS for DNS resolution. - CLOUD_DNS = 2; - - // Use KubeDNS for DNS resolution. - KUBE_DNS = 3; - } - - // DNSScope lists the various scopes of access to cluster DNS records. - enum DNSScope { - // Default value, will be inferred as cluster scope. - DNS_SCOPE_UNSPECIFIED = 0; - - // DNS records are accessible from within the cluster. - CLUSTER_SCOPE = 1; - - // DNS records are accessible from within the VPC. - VPC_SCOPE = 2; - } - - // cluster_dns indicates which in-cluster DNS provider should be used. - Provider cluster_dns = 1; - - // cluster_dns_scope indicates the scope of access to cluster DNS records. - DNSScope cluster_dns_scope = 2; - - // cluster_dns_domain is the suffix used for all cluster service records. - string cluster_dns_domain = 3; -} - -// Constraints applied to pods. -message MaxPodsConstraint { - // Constraint enforced on the max num of pods per node. - int64 max_pods_per_node = 1; -} - -// Configuration for the use of Kubernetes Service Accounts in GCP IAM -// policies. -message WorkloadIdentityConfig { - // The workload pool to attach all Kubernetes service accounts to. - string workload_pool = 2; -} - -// IdentityServiceConfig is configuration for Identity Service which allows -// customers to use external identity providers with the K8S API -message IdentityServiceConfig { - // Whether to enable the Identity Service component - bool enabled = 1; -} - -// Configuration for issuance of mTLS keys and certificates to Kubernetes pods. -message MeshCertificates { - // enable_certificates controls issuance of workload mTLS certificates. - // - // If set, the GKE Workload Identity Certificates controller and node agent - // will be deployed in the cluster, which can then be configured by creating a - // WorkloadCertificateConfig Custom Resource. - // - // Requires Workload Identity - // ([workload_pool][google.container.v1.WorkloadIdentityConfig.workload_pool] - // must be non-empty). - google.protobuf.BoolValue enable_certificates = 1; -} - -// Configuration of etcd encryption. -message DatabaseEncryption { - // State of etcd encryption. - enum State { - // Should never be set - UNKNOWN = 0; - - // Secrets in etcd are encrypted. - ENCRYPTED = 1; - - // Secrets in etcd are stored in plain text (at etcd level) - this is - // unrelated to Compute Engine level full disk encryption. - DECRYPTED = 2; - } - - // 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 - string key_name = 1; - - // The desired state of etcd encryption. - State state = 2; -} - -// ListUsableSubnetworksRequest requests the list of usable subnetworks -// available to a user for creating clusters. -message ListUsableSubnetworksRequest { - // The parent project where subnetworks are usable. - // Specified in the format `projects/*`. - string parent = 1; - - // 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. - string filter = 2; - - // 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) - int32 page_size = 3; - - // Specifies a page token to use. Set this to the nextPageToken returned by - // previous list requests to get the next page of results. - string page_token = 4; -} - -// ListUsableSubnetworksResponse is the response of -// ListUsableSubnetworksRequest. -message ListUsableSubnetworksResponse { - // A list of usable subnetworks in the specified network project. - repeated UsableSubnetwork subnetworks = 1; - - // 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. - string next_page_token = 2; -} - -// Secondary IP range of a usable subnetwork. -message UsableSubnetworkSecondaryRange { - // Status shows the current usage of a secondary IP range. - enum Status { - // UNKNOWN is the zero value of the Status enum. It's not a valid status. - UNKNOWN = 0; - - // UNUSED denotes that this range is unclaimed by any cluster. - UNUSED = 1; - - // IN_USE_SERVICE denotes that this range is claimed by cluster(s) for - // services. User-managed services range can be shared between clusters - // within the same subnetwork. - IN_USE_SERVICE = 2; - - // 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_SHAREABLE_POD = 3; - - // IN_USE_MANAGED_POD denotes this range was created by GKE and is claimed - // for pods. It cannot be used for other clusters. - IN_USE_MANAGED_POD = 4; - } - - // The name associated with this subnetwork secondary range, used when adding - // an alias IP range to a VM instance. - string range_name = 1; - - // The range of IP addresses belonging to this subnetwork secondary range. - string ip_cidr_range = 2; - - // This field is to determine the status of the secondary range programmably. - Status status = 3; -} - -// UsableSubnetwork resource returns the subnetwork name, its associated network -// and the primary CIDR range. -message UsableSubnetwork { - // Subnetwork Name. - // Example: projects/my-project/regions/us-central1/subnetworks/my-subnet - string subnetwork = 1; - - // Network Name. - // Example: projects/my-project/global/networks/my-network - string network = 2; - - // The range of internal addresses that are owned by this subnetwork. - string ip_cidr_range = 3; - - // Secondary IP ranges. - repeated UsableSubnetworkSecondaryRange secondary_ip_ranges = 4; - - // 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. - string status_message = 5; -} - -// Configuration for exporting cluster resource usages. -message ResourceUsageExportConfig { - // Parameters for using BigQuery as the destination of resource usage export. - message BigQueryDestination { - // The ID of a BigQuery Dataset. - string dataset_id = 1; - } - - // Parameters for controlling consumption metering. - message ConsumptionMeteringConfig { - // Whether to enable consumption metering for this cluster. If enabled, a - // second BigQuery table will be created to hold resource consumption - // records. - bool enabled = 1; - } - - // Configuration to use BigQuery as usage export destination. - BigQueryDestination bigquery_destination = 1; - - // Whether to enable network egress metering for this cluster. If enabled, a - // daemonset will be created in the cluster to meter network egress traffic. - bool enable_network_egress_metering = 2; - - // Configuration to enable resource consumption metering. - ConsumptionMeteringConfig consumption_metering_config = 3; -} - -// VerticalPodAutoscaling contains global, per-cluster information -// required by Vertical Pod Autoscaler to automatically adjust -// the resources of pods controlled by it. -message VerticalPodAutoscaling { - // Enables vertical pod autoscaling. - bool enabled = 1; -} - -// DefaultSnatStatus contains the desired state of whether default sNAT should -// be disabled on the cluster. -message DefaultSnatStatus { - // Disables cluster default sNAT rules. - bool disabled = 1; -} - -// Configuration of Shielded Nodes feature. -message ShieldedNodes { - // Whether Shielded Nodes features are enabled on all nodes in this cluster. - bool enabled = 1; -} - -// Configuration of gVNIC feature. -message VirtualNIC { - // Whether gVNIC features are enabled in the node pool. - bool enabled = 1; -} - -// Configuration of Fast Socket feature. -message FastSocket { - // Whether Fast Socket features are enabled in the node pool. - bool enabled = 1; -} - -// PrivateIPv6GoogleAccess controls whether and how the pods can communicate -// with Google Services through gRPC over IPv6. -enum PrivateIPv6GoogleAccess { - // Default value. Same as DISABLED - PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0; - - // No private access to or from Google Services - PRIVATE_IPV6_GOOGLE_ACCESS_DISABLED = 1; - - // Enables private IPv6 access to Google Services from GKE - PRIVATE_IPV6_GOOGLE_ACCESS_TO_GOOGLE = 2; - - // Enables private IPv6 access to and from Google Services - PRIVATE_IPV6_GOOGLE_ACCESS_BIDIRECTIONAL = 3; -} - -// NotificationConfig is the configuration of notifications. -message NotificationConfig { - // Types of notifications currently supported. Can be used to filter what - // notifications are sent. - enum EventType { - // Not set, will be ignored. - EVENT_TYPE_UNSPECIFIED = 0; - - // Corresponds with UpgradeAvailableEvent. - UPGRADE_AVAILABLE_EVENT = 1; - - // Corresponds with UpgradeEvent. - UPGRADE_EVENT = 2; - - // Corresponds with SecurityBulletinEvent. - SECURITY_BULLETIN_EVENT = 3; - } - - // Pub/Sub specific notification config. - message PubSub { - // Enable notifications for Pub/Sub. - bool enabled = 1; - - // The desired Pub/Sub topic to which notifications will be - // sent by GKE. Format is `projects/{project}/topics/{topic}`. - string topic = 2 [ - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } - ]; - - // Allows filtering to one or more specific event types. If no filter is - // specified, or if a filter is specified with no event types, all event - // types will be sent - Filter filter = 3; - } - - // Allows filtering to one or more specific event types. If event types are - // present, those and only those event types will be transmitted to the - // cluster. Other types will be skipped. If no filter is specified, or no - // event types are present, all event types will be sent - message Filter { - // Event types to allowlist. - repeated EventType event_type = 1; - } - - // Notification config for Pub/Sub. - PubSub pubsub = 1; -} - -// ConfidentialNodes is configuration for the confidential nodes feature, which -// makes nodes run on confidential VMs. -message ConfidentialNodes { - // Whether Confidential Nodes feature is enabled. - bool enabled = 1; -} - -// UpgradeResourceType is the resource type that is upgrading. It is used -// in upgrade notifications. -enum UpgradeResourceType { - // Default value. This shouldn't be used. - UPGRADE_RESOURCE_TYPE_UNSPECIFIED = 0; - - // Master / control plane - MASTER = 1; - - // Node pool - NODE_POOL = 2; -} - -// UpgradeEvent is a notification sent to customers by the cluster server when -// a resource is upgrading. -message UpgradeEvent { - // The resource type that is upgrading. - UpgradeResourceType resource_type = 1; - - // The operation associated with this upgrade. - string operation = 2; - - // The time when the operation was started. - google.protobuf.Timestamp operation_start_time = 3; - - // The current version before the upgrade. - string current_version = 4; - - // The target version for the upgrade. - string target_version = 5; - - // Optional relative path to the resource. For example in node pool upgrades, - // the relative path of the node pool. - string resource = 6; -} - -// UpgradeAvailableEvent is a notification sent to customers when a new -// available version is released. -message UpgradeAvailableEvent { - // The release version available for upgrade. - string version = 1; - - // The resource type of the release version. - UpgradeResourceType resource_type = 2; - - // The release channel of the version. If empty, it means a non-channel - // release. - ReleaseChannel release_channel = 3; - - // Optional relative path to the resource. For example, the relative path of - // the node pool. - string resource = 4; -} - -// SecurityBulletinEvent is a notification sent to customers when a security -// bulletin has been posted that they are vulnerable to. -message SecurityBulletinEvent { - // The resource type (node/control plane) that has the vulnerability. Multiple - // notifications (1 notification per resource type) will be sent for a - // vulnerability that affects > 1 resource type. - string resource_type_affected = 1; - - // The ID of the bulletin corresponding to the vulnerability. - string bulletin_id = 2; - - // The CVEs associated with this bulletin. - repeated string cve_ids = 3; - - // The severity of this bulletin as it relates to GKE. - string severity = 4; - - // The URI link to the bulletin on the website for more information. - string bulletin_uri = 5; - - // A brief description of the bulletin. See the bulletin pointed to by the - // bulletin_uri field for an expanded description. - string brief_description = 6; - - // The GKE minor versions affected by this vulnerability. - repeated string affected_supported_minors = 7; - - // The GKE versions where this vulnerability is patched. - repeated string patched_versions = 8; - - // This represents a version selected from the patched_versions field that - // the cluster receiving this notification should most likely want to upgrade - // to based on its current version. Note that if this notification is being - // received by a given cluster, it means that this version is currently - // available as an upgrade target in that cluster's location. - string suggested_upgrade_target = 9; - - // If this field is specified, it means there are manual steps that the user - // must take to make their clusters safe. - bool manual_steps_required = 10; -} - -// Autopilot is the configuration for Autopilot settings on the cluster. -message Autopilot { - // Enable Autopilot - bool enabled = 1; - - // Workload policy configuration for Autopilot. - WorkloadPolicyConfig workload_policy_config = 2; -} - -// WorkloadPolicyConfig is the configuration of workload policy for autopilot -// clusters. -message WorkloadPolicyConfig { - // If true, workloads can use NET_ADMIN capability. - optional bool allow_net_admin = 1; -} - -// LoggingConfig is cluster logging configuration. -message LoggingConfig { - // Logging components configuration - LoggingComponentConfig component_config = 1; -} - -// LoggingComponentConfig is cluster logging component configuration. -message LoggingComponentConfig { - // GKE components exposing logs - enum Component { - // Default value. This shouldn't be used. - COMPONENT_UNSPECIFIED = 0; - - // system components - SYSTEM_COMPONENTS = 1; - - // workloads - WORKLOADS = 2; - - // kube-apiserver - APISERVER = 3; - - // kube-scheduler - SCHEDULER = 4; - - // kube-controller-manager - CONTROLLER_MANAGER = 5; - } - - // Select components to collect logs. An empty set would disable all logging. - repeated Component enable_components = 1; -} - -// MonitoringConfig is cluster monitoring configuration. -message MonitoringConfig { - // Monitoring components configuration - MonitoringComponentConfig component_config = 1; - - // Enable Google Cloud Managed Service for Prometheus - // in the cluster. - ManagedPrometheusConfig managed_prometheus_config = 2; - - // Configuration of Advanced Datapath Observability features. - AdvancedDatapathObservabilityConfig advanced_datapath_observability_config = - 3; -} - -// AdvancedDatapathObservabilityConfig specifies configuration of observability -// features of advanced datapath. -message AdvancedDatapathObservabilityConfig { - // Supported Relay modes - enum RelayMode { - // Default value. This shouldn't be used. - RELAY_MODE_UNSPECIFIED = 0; - - // disabled - DISABLED = 1; - - // exposed via internal load balancer - INTERNAL_VPC_LB = 3; - - // exposed via external load balancer - EXTERNAL_LB = 4; - } - - // Expose flow metrics on nodes - bool enable_metrics = 1; - - // Method used to make Relay available - RelayMode relay_mode = 2; -} - -// NodePoolLoggingConfig specifies logging configuration for nodepools. -message NodePoolLoggingConfig { - // Logging variant configuration. - LoggingVariantConfig variant_config = 1; -} - -// LoggingVariantConfig specifies the behaviour of the logging component. -message LoggingVariantConfig { - // Logging component variants. - enum Variant { - // Default value. This shouldn't be used. - VARIANT_UNSPECIFIED = 0; - - // default logging variant. - DEFAULT = 1; - - // maximum logging throughput variant. - MAX_THROUGHPUT = 2; - } - - // Logging variant deployed on nodes. - Variant variant = 1; -} - -// MonitoringComponentConfig is cluster monitoring component configuration. -message MonitoringComponentConfig { - // GKE components exposing metrics - enum Component { - // Default value. This shouldn't be used. - COMPONENT_UNSPECIFIED = 0; - - // system components - SYSTEM_COMPONENTS = 1; - - // kube-apiserver - APISERVER = 3; - - // kube-scheduler - SCHEDULER = 4; - - // kube-controller-manager - CONTROLLER_MANAGER = 5; - } - - // Select components to collect metrics. An empty set would disable all - // monitoring. - repeated Component enable_components = 1; -} - -// The datapath provider selects the implementation of the Kubernetes networking -// model for service resolution and network policy enforcement. -enum DatapathProvider { - // Default value. - DATAPATH_PROVIDER_UNSPECIFIED = 0; - - // Use the IPTables implementation based on kube-proxy. - LEGACY_DATAPATH = 1; - - // Use the eBPF based GKE Dataplane V2 with additional features. See the [GKE - // Dataplane V2 - // documentation](https://cloud.google.com/kubernetes-engine/docs/how-to/dataplane-v2) - // for more. - ADVANCED_DATAPATH = 2; -} - -// Strategy used for node pool update. -enum NodePoolUpdateStrategy { - // Default value if unset. GKE internally defaults the update strategy to - // SURGE for unspecified strategies. - NODE_POOL_UPDATE_STRATEGY_UNSPECIFIED = 0; - - // blue-green upgrade. - BLUE_GREEN = 2; - - // SURGE is the traditional way of upgrade a node pool. - // max_surge and max_unavailable determines the level of upgrade parallelism. - SURGE = 3; -} - -// ManagedPrometheusConfig defines the configuration for -// Google Cloud Managed Service for Prometheus. -message ManagedPrometheusConfig { - // Enable Managed Collection. - bool enabled = 1; -} - -// Fleet is the fleet configuration for the cluster. -message Fleet { - // The Fleet host project(project ID or project number) where this cluster - // will be registered to. This field cannot be changed after the cluster has - // been registered. - string project = 1; - - // [Output only] The full resource name of the registered fleet membership of - // the cluster, in the format - // `//gkehub.googleapis.com/projects/*/locations/*/memberships/*`. - string membership = 2; - - // [Output only] Whether the cluster has been registered through the fleet - // API. - bool pre_registered = 3; -} - -// Possible values for IP stack type -enum StackType { - // Default value, will be defaulted as IPV4 only - STACK_TYPE_UNSPECIFIED = 0; - - // Cluster is IPV4 only - IPV4 = 1; - - // Cluster can use both IPv4 and IPv6 - IPV4_IPV6 = 2; -} - -// Possible values for IPv6 access type -enum IPv6AccessType { - // Default value, will be defaulted as type external. - IPV6_ACCESS_TYPE_UNSPECIFIED = 0; - - // Access type internal (all v6 addresses are internal IPs) - INTERNAL = 1; - - // Access type external (all v6 addresses are external IPs) - EXTERNAL = 2; -} - -// LocalNvmeSsdBlockConfig contains configuration for using raw-block local -// NVMe SSD. -message LocalNvmeSsdBlockConfig { - // The number of raw-block local NVMe SSD disks to be attached to the node. - // Each local SSD is 375 GB in size. If zero, it means no raw-block local NVMe - // 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. - int32 local_ssd_count = 1; -} - -// EphemeralStorageLocalSsdConfig contains configuration for the node ephemeral -// storage using Local SSD. -message EphemeralStorageLocalSsdConfig { - // Number of local SSDs to use to back ephemeral storage. Uses NVMe - // interfaces. Each local SSD is 375 GB in size. - // If zero, it means to disable using local SSDs as ephemeral storage. - // 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. - int32 local_ssd_count = 1; -} diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.cancel_operation.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.cancel_operation.js deleted file mode 100644 index e556c2aaf76..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.cancel_operation.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_CancelOperation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, operation id) of the operation to cancel. - * Specified in the format `projects/* /locations/* /operations/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callCancelOperation() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.cancelOperation(request); - console.log(response); - } - - callCancelOperation(); - // [END container_v1_generated_ClusterManager_CancelOperation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js deleted file mode 100644 index e4d731fc2d0..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_CheckAutopilotCompatibility_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster) of the cluster to retrieve. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callCheckAutopilotCompatibility() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.checkAutopilotCompatibility(request); - console.log(response); - } - - callCheckAutopilotCompatibility(); - // [END container_v1_generated_ClusterManager_CheckAutopilotCompatibility_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_i_p_rotation.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_i_p_rotation.js deleted file mode 100644 index 82b71531860..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_i_p_rotation.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_CompleteIPRotation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster name) of the cluster to complete IP - * rotation. Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callCompleteIPRotation() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.completeIPRotation(request); - console.log(response); - } - - callCompleteIPRotation(); - // [END container_v1_generated_ClusterManager_CompleteIPRotation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js deleted file mode 100644 index 8cf74642faf..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_CompleteNodePoolUpgrade_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster, node pool id) of the node pool to - * complete upgrade. - * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callCompleteNodePoolUpgrade() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.completeNodePoolUpgrade(request); - console.log(response); - } - - callCompleteNodePoolUpgrade(); - // [END container_v1_generated_ClusterManager_CompleteNodePoolUpgrade_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_cluster.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_cluster.js deleted file mode 100644 index bc132fbb109..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_cluster.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(cluster) { - // [START container_v1_generated_ClusterManager_CreateCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. A cluster - * resource (https://cloud.google.com/container-engine/reference/rest/v1/projects.locations.clusters) - */ - // const cluster = {} - /** - * The parent (project and location) where the cluster will be created. - * Specified in the format `projects/* /locations/*`. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callCreateCluster() { - // Construct request - const request = { - cluster, - }; - - // Run request - const response = await containerClient.createCluster(request); - console.log(response); - } - - callCreateCluster(); - // [END container_v1_generated_ClusterManager_CreateCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_node_pool.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_node_pool.js deleted file mode 100644 index c2526e72425..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.create_node_pool.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(nodePool) { - // [START container_v1_generated_ClusterManager_CreateNodePool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The node pool to create. - */ - // const nodePool = {} - /** - * The parent (project, location, cluster name) where the node pool will be - * created. Specified in the format - * `projects/* /locations/* /clusters/*`. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callCreateNodePool() { - // Construct request - const request = { - nodePool, - }; - - // Run request - const response = await containerClient.createNodePool(request); - console.log(response); - } - - callCreateNodePool(); - // [END container_v1_generated_ClusterManager_CreateNodePool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_cluster.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_cluster.js deleted file mode 100644 index b7f789d7b80..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_cluster.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_DeleteCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster) of the cluster to delete. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callDeleteCluster() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.deleteCluster(request); - console.log(response); - } - - callDeleteCluster(); - // [END container_v1_generated_ClusterManager_DeleteCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_node_pool.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_node_pool.js deleted file mode 100644 index 1d286e9963b..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.delete_node_pool.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_DeleteNodePool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster, node pool id) of the node pool to - * delete. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callDeleteNodePool() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.deleteNodePool(request); - console.log(response); - } - - callDeleteNodePool(); - // [END container_v1_generated_ClusterManager_DeleteNodePool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_cluster.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_cluster.js deleted file mode 100644 index 565479929b5..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_cluster.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_GetCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster) of the cluster to retrieve. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callGetCluster() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.getCluster(request); - console.log(response); - } - - callGetCluster(); - // [END container_v1_generated_ClusterManager_GetCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_j_s_o_n_web_keys.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_j_s_o_n_web_keys.js deleted file mode 100644 index ce76d378ce1..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_j_s_o_n_web_keys.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_GetJSONWebKeys_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The cluster (project, location, cluster name) to get keys for. Specified in - * the format `projects/* /locations/* /clusters/*`. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callGetJSONWebKeys() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.getJSONWebKeys(request); - console.log(response); - } - - callGetJSONWebKeys(); - // [END container_v1_generated_ClusterManager_GetJSONWebKeys_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_node_pool.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_node_pool.js deleted file mode 100644 index fb3301234b1..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_node_pool.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_GetNodePool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster, node pool id) of the node pool to - * get. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callGetNodePool() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.getNodePool(request); - console.log(response); - } - - callGetNodePool(); - // [END container_v1_generated_ClusterManager_GetNodePool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_operation.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_operation.js deleted file mode 100644 index 58a774ae645..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_operation.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_GetOperation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, operation id) of the operation to get. - * Specified in the format `projects/* /locations/* /operations/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callGetOperation() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.getOperation(request); - console.log(response); - } - - callGetOperation(); - // [END container_v1_generated_ClusterManager_GetOperation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_server_config.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_server_config.js deleted file mode 100644 index 6a1e2ef0e69..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.get_server_config.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_GetServerConfig_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project and location) of the server config to get, - * specified in the format `projects/* /locations/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callGetServerConfig() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.getServerConfig(request); - console.log(response); - } - - callGetServerConfig(); - // [END container_v1_generated_ClusterManager_GetServerConfig_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_clusters.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_clusters.js deleted file mode 100644 index fb7dbc835b2..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_clusters.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_ListClusters_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The parent (project and location) where the clusters will be listed. - * Specified in the format `projects/* /locations/*`. - * Location "-" matches all zones and all regions. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callListClusters() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.listClusters(request); - console.log(response); - } - - callListClusters(); - // [END container_v1_generated_ClusterManager_ListClusters_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_node_pools.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_node_pools.js deleted file mode 100644 index fa48c06009a..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_node_pools.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_ListNodePools_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The parent (project, location, cluster name) where the node pools will be - * listed. Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callListNodePools() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.listNodePools(request); - console.log(response); - } - - callListNodePools(); - // [END container_v1_generated_ClusterManager_ListNodePools_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_operations.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_operations.js deleted file mode 100644 index 69eb1730393..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_operations.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_ListOperations_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The parent (project and location) where the operations will be listed. - * Specified in the format `projects/* /locations/*`. - * Location "-" matches all zones and all regions. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callListOperations() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.listOperations(request); - console.log(response); - } - - callListOperations(); - // [END container_v1_generated_ClusterManager_ListOperations_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_usable_subnetworks.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_usable_subnetworks.js deleted file mode 100644 index a70af157bf3..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.list_usable_subnetworks.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_ListUsableSubnetworks_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The parent project where subnetworks are usable. - * Specified in the format `projects/*`. - */ - // const parent = 'abc123' - /** - * 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. - */ - // const filter = 'abc123' - /** - * 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) - */ - // const pageSize = 1234 - /** - * Specifies a page token to use. Set this to the nextPageToken returned by - * previous list requests to get the next page of results. - */ - // const pageToken = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callListUsableSubnetworks() { - // Construct request - const request = { - }; - - // Run request - const iterable = await containerClient.listUsableSubnetworksAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListUsableSubnetworks(); - // [END container_v1_generated_ClusterManager_ListUsableSubnetworks_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.rollback_node_pool_upgrade.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.rollback_node_pool_upgrade.js deleted file mode 100644 index 3356c397660..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.rollback_node_pool_upgrade.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_RollbackNodePoolUpgrade_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster, node pool id) of the node poll to - * rollback upgrade. - * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - /** - * Option for rollback to ignore the PodDisruptionBudget. - * Default value is false. - */ - // const respectPdb = true - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callRollbackNodePoolUpgrade() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.rollbackNodePoolUpgrade(request); - console.log(response); - } - - callRollbackNodePoolUpgrade(); - // [END container_v1_generated_ClusterManager_RollbackNodePoolUpgrade_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_addons_config.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_addons_config.js deleted file mode 100644 index c6e24e63456..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_addons_config.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(addonsConfig) { - // [START container_v1_generated_ClusterManager_SetAddonsConfig_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The desired configurations for the various addons available to - * run in the cluster. - */ - // const addonsConfig = {} - /** - * The name (project, location, cluster) of the cluster to set addons. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetAddonsConfig() { - // Construct request - const request = { - addonsConfig, - }; - - // Run request - const response = await containerClient.setAddonsConfig(request); - console.log(response); - } - - callSetAddonsConfig(); - // [END container_v1_generated_ClusterManager_SetAddonsConfig_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_labels.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_labels.js deleted file mode 100644 index dd281c82cc6..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_labels.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resourceLabels, labelFingerprint) { - // [START container_v1_generated_ClusterManager_SetLabels_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The labels to set for that cluster. - */ - // const resourceLabels = 1234 - /** - * 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. - */ - // const labelFingerprint = 'abc123' - /** - * The name (project, location, cluster name) of the cluster to set labels. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetLabels() { - // Construct request - const request = { - resourceLabels, - labelFingerprint, - }; - - // Run request - const response = await containerClient.setLabels(request); - console.log(response); - } - - callSetLabels(); - // [END container_v1_generated_ClusterManager_SetLabels_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_legacy_abac.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_legacy_abac.js deleted file mode 100644 index 9c2a450c361..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_legacy_abac.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(enabled) { - // [START container_v1_generated_ClusterManager_SetLegacyAbac_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Whether ABAC authorization will be enabled in the cluster. - */ - // const enabled = true - /** - * The name (project, location, cluster name) of the cluster to set legacy - * abac. Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetLegacyAbac() { - // Construct request - const request = { - enabled, - }; - - // Run request - const response = await containerClient.setLegacyAbac(request); - console.log(response); - } - - callSetLegacyAbac(); - // [END container_v1_generated_ClusterManager_SetLegacyAbac_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_locations.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_locations.js deleted file mode 100644 index a5f7a5f0349..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_locations.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(locations) { - // [START container_v1_generated_ClusterManager_SetLocations_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The desired list of Google Compute Engine - * zones (https://cloud.google.com/compute/docs/zones#available) 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. - */ - // const locations = 'abc123' - /** - * The name (project, location, cluster) of the cluster to set locations. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetLocations() { - // Construct request - const request = { - locations, - }; - - // Run request - const response = await containerClient.setLocations(request); - console.log(response); - } - - callSetLocations(); - // [END container_v1_generated_ClusterManager_SetLocations_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_logging_service.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_logging_service.js deleted file mode 100644 index 3333d0219c5..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_logging_service.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(loggingService) { - // [START container_v1_generated_ClusterManager_SetLoggingService_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The logging service the cluster should use to write logs. - * Currently available options: - * * `logging.googleapis.com/kubernetes` - The Cloud Logging - * service with a Kubernetes-native resource model - * * `logging.googleapis.com` - The legacy Cloud Logging service (no longer - * available as of GKE 1.15). - * * `none` - no logs will be exported from the cluster. - * If left as an empty string,`logging.googleapis.com/kubernetes` will be - * used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. - */ - // const loggingService = 'abc123' - /** - * The name (project, location, cluster) of the cluster to set logging. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetLoggingService() { - // Construct request - const request = { - loggingService, - }; - - // Run request - const response = await containerClient.setLoggingService(request); - console.log(response); - } - - callSetLoggingService(); - // [END container_v1_generated_ClusterManager_SetLoggingService_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_maintenance_policy.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_maintenance_policy.js deleted file mode 100644 index 4e675414de2..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_maintenance_policy.js +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, maintenancePolicy) { - // [START container_v1_generated_ClusterManager_SetMaintenancePolicy_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The Google Developers Console project ID or project - * number (https://cloud.google.com/resource-manager/docs/creating-managing-projects). - */ - // const projectId = 'abc123' - /** - * Required. The name of the Google Compute Engine - * zone (https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. - */ - // const zone = 'abc123' - /** - * Required. The name of the cluster to update. - */ - // const clusterId = 'abc123' - /** - * Required. The maintenance policy to be set for the cluster. An empty field - * clears the existing maintenance policy. - */ - // const maintenancePolicy = {} - /** - * The name (project, location, cluster name) of the cluster to set - * maintenance policy. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetMaintenancePolicy() { - // Construct request - const request = { - projectId, - zone, - clusterId, - maintenancePolicy, - }; - - // Run request - const response = await containerClient.setMaintenancePolicy(request); - console.log(response); - } - - callSetMaintenancePolicy(); - // [END container_v1_generated_ClusterManager_SetMaintenancePolicy_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_master_auth.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_master_auth.js deleted file mode 100644 index 4376ebb1adc..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_master_auth.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(action, update) { - // [START container_v1_generated_ClusterManager_SetMasterAuth_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The exact form of action to be taken on the master auth. - */ - // const action = {} - /** - * Required. A description of the update. - */ - // const update = {} - /** - * The name (project, location, cluster) of the cluster to set auth. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetMasterAuth() { - // Construct request - const request = { - action, - update, - }; - - // Run request - const response = await containerClient.setMasterAuth(request); - console.log(response); - } - - callSetMasterAuth(); - // [END container_v1_generated_ClusterManager_SetMasterAuth_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_monitoring_service.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_monitoring_service.js deleted file mode 100644 index 5767da6da8f..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_monitoring_service.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(monitoringService) { - // [START container_v1_generated_ClusterManager_SetMonitoringService_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The monitoring service the cluster should use to write metrics. - * Currently available options: - * * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring - * service with a Kubernetes-native resource model - * * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no - * longer available as of GKE 1.15). - * * `none` - No metrics will be exported from the cluster. - * If left as an empty string,`monitoring.googleapis.com/kubernetes` will be - * used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. - */ - // const monitoringService = 'abc123' - /** - * The name (project, location, cluster) of the cluster to set monitoring. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetMonitoringService() { - // Construct request - const request = { - monitoringService, - }; - - // Run request - const response = await containerClient.setMonitoringService(request); - console.log(response); - } - - callSetMonitoringService(); - // [END container_v1_generated_ClusterManager_SetMonitoringService_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_network_policy.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_network_policy.js deleted file mode 100644 index 70e4a954cd3..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_network_policy.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(networkPolicy) { - // [START container_v1_generated_ClusterManager_SetNetworkPolicy_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Configuration options for the NetworkPolicy feature. - */ - // const networkPolicy = {} - /** - * The name (project, location, cluster name) of the cluster to set networking - * policy. Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetNetworkPolicy() { - // Construct request - const request = { - networkPolicy, - }; - - // Run request - const response = await containerClient.setNetworkPolicy(request); - console.log(response); - } - - callSetNetworkPolicy(); - // [END container_v1_generated_ClusterManager_SetNetworkPolicy_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_autoscaling.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_autoscaling.js deleted file mode 100644 index fde99e8483c..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_autoscaling.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(autoscaling) { - // [START container_v1_generated_ClusterManager_SetNodePoolAutoscaling_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Autoscaling configuration for the node pool. - */ - // const autoscaling = {} - /** - * The name (project, location, cluster, node pool) of the node pool to set - * autoscaler settings. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetNodePoolAutoscaling() { - // Construct request - const request = { - autoscaling, - }; - - // Run request - const response = await containerClient.setNodePoolAutoscaling(request); - console.log(response); - } - - callSetNodePoolAutoscaling(); - // [END container_v1_generated_ClusterManager_SetNodePoolAutoscaling_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_management.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_management.js deleted file mode 100644 index e1ea4030588..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_management.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(management) { - // [START container_v1_generated_ClusterManager_SetNodePoolManagement_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. NodeManagement configuration for the node pool. - */ - // const management = {} - /** - * The name (project, location, cluster, node pool id) of the node pool to set - * management properties. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetNodePoolManagement() { - // Construct request - const request = { - management, - }; - - // Run request - const response = await containerClient.setNodePoolManagement(request); - console.log(response); - } - - callSetNodePoolManagement(); - // [END container_v1_generated_ClusterManager_SetNodePoolManagement_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_size.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_size.js deleted file mode 100644 index aedfdd9f71b..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.set_node_pool_size.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(nodeCount) { - // [START container_v1_generated_ClusterManager_SetNodePoolSize_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The desired node count for the pool. - */ - // const nodeCount = 1234 - /** - * The name (project, location, cluster, node pool id) of the node pool to set - * size. - * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetNodePoolSize() { - // Construct request - const request = { - nodeCount, - }; - - // Run request - const response = await containerClient.setNodePoolSize(request); - console.log(response); - } - - callSetNodePoolSize(); - // [END container_v1_generated_ClusterManager_SetNodePoolSize_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.start_i_p_rotation.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.start_i_p_rotation.js deleted file mode 100644 index a8f65196353..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.start_i_p_rotation.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1_generated_ClusterManager_StartIPRotation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster name) of the cluster to start IP - * rotation. Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - /** - * Whether to rotate credentials during IP rotation. - */ - // const rotateCredentials = true - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callStartIPRotation() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.startIPRotation(request); - console.log(response); - } - - callStartIPRotation(); - // [END container_v1_generated_ClusterManager_StartIPRotation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_cluster.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_cluster.js deleted file mode 100644 index b0280b7fea6..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_cluster.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(update) { - // [START container_v1_generated_ClusterManager_UpdateCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. A description of the update. - */ - // const update = {} - /** - * The name (project, location, cluster) of the cluster to update. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callUpdateCluster() { - // Construct request - const request = { - update, - }; - - // Run request - const response = await containerClient.updateCluster(request); - console.log(response); - } - - callUpdateCluster(); - // [END container_v1_generated_ClusterManager_UpdateCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_master.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_master.js deleted file mode 100644 index 37f555312f8..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_master.js +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(masterVersion) { - // [START container_v1_generated_ClusterManager_UpdateMaster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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 - */ - // const masterVersion = 'abc123' - /** - * The name (project, location, cluster) of the cluster to update. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callUpdateMaster() { - // Construct request - const request = { - masterVersion, - }; - - // Run request - const response = await containerClient.updateMaster(request); - console.log(response); - } - - callUpdateMaster(); - // [END container_v1_generated_ClusterManager_UpdateMaster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_node_pool.js b/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_node_pool.js deleted file mode 100644 index 10715ac0d85..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/cluster_manager.update_node_pool.js +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(nodeVersion, imageType) { - // [START container_v1_generated_ClusterManager_UpdateNodePool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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 - */ - // const nodeVersion = 'abc123' - /** - * Required. The desired image type for the node pool. Please see - * https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for - * available image types. - */ - // const imageType = 'abc123' - /** - * The name (project, location, cluster, node pool) of the node pool to - * update. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - /** - * The desired list of Google Compute Engine - * zones (https://cloud.google.com/compute/docs/zones#available) in which the - * node pool's nodes should be located. Changing the locations for a node pool - * will result in nodes being either created or removed from the node pool, - * depending on whether locations are being added or removed. - */ - // const locations = 'abc123' - /** - * The desired workload metadata config for the node pool. - */ - // const workloadMetadataConfig = {} - /** - * Upgrade settings control disruption and speed of the upgrade. - */ - // const upgradeSettings = {} - /** - * The desired network tags to be applied to all nodes in the node pool. - * If this field is not present, the tags will not be changed. Otherwise, - * the existing network tags will be *replaced* with the provided tags. - */ - // const tags = {} - /** - * The desired node taints to be applied to all nodes in the node pool. - * If this field is not present, the taints will not be changed. Otherwise, - * the existing node taints will be *replaced* with the provided taints. - */ - // const taints = {} - /** - * The desired node labels to be applied to all nodes in the node pool. - * If this field is not present, the labels will not be changed. Otherwise, - * the existing node labels will be *replaced* with the provided labels. - */ - // const labels = {} - /** - * Parameters that can be configured on Linux nodes. - */ - // const linuxNodeConfig = {} - /** - * Node kubelet configs. - */ - // const kubeletConfig = {} - /** - * Node network config. - */ - // const nodeNetworkConfig = {} - /** - * GCFS config. - */ - // const gcfsConfig = {} - /** - * Confidential nodes config. - * All the nodes in the node pool will be Confidential VM once enabled. - */ - // const confidentialNodes = {} - /** - * Enable or disable gvnic on the node pool. - */ - // const gvnic = {} - /** - * The current etag of the node pool. - * If an etag is provided and does not match the current etag of the node - * pool, update will be blocked and an ABORTED error will be returned. - */ - // const etag = 'abc123' - /** - * Enable or disable NCCL fast socket for the node pool. - */ - // const fastSocket = {} - /** - * Logging configuration. - */ - // const loggingConfig = {} - /** - * The resource labels for the node pool to use to annotate any related - * Google Compute Engine resources. - */ - // const resourceLabels = {} - /** - * Parameters that can be configured on Windows nodes. - */ - // const windowsNodeConfig = {} - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callUpdateNodePool() { - // Construct request - const request = { - nodeVersion, - imageType, - }; - - // Run request - const response = await containerClient.updateNodePool(request); - console.log(response); - } - - callUpdateNodePool(); - // [END container_v1_generated_ClusterManager_UpdateNodePool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1/samples/generated/v1/snippet_metadata.google.container.v1.json b/owl-bot-staging/google-container/v1/samples/generated/v1/snippet_metadata.google.container.v1.json deleted file mode 100644 index 66a864e5ad7..00000000000 --- a/owl-bot-staging/google-container/v1/samples/generated/v1/snippet_metadata.google.container.v1.json +++ /dev/null @@ -1,1915 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-container", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.container.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "container_v1_generated_ClusterManager_ListClusters_async", - "title": "ClusterManager listClusters Sample", - "origin": "API_DEFINITION", - "description": " Lists all clusters owned by a project in either the specified zone or all zones.", - "canonical": true, - "file": "cluster_manager.list_clusters.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListClusters", - "fullName": "google.container.v1.ClusterManager.ListClusters", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.ListClustersResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "ListClusters", - "fullName": "google.container.v1.ClusterManager.ListClusters", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_GetCluster_async", - "title": "ClusterManager getCluster Sample", - "origin": "API_DEFINITION", - "description": " Gets the details of a specific cluster.", - "canonical": true, - "file": "cluster_manager.get_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCluster", - "fullName": "google.container.v1.ClusterManager.GetCluster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Cluster", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "GetCluster", - "fullName": "google.container.v1.ClusterManager.GetCluster", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_CreateCluster_async", - "title": "ClusterManager createCluster Sample", - "origin": "API_DEFINITION", - "description": " 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](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). 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.", - "canonical": true, - "file": "cluster_manager.create_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateCluster", - "fullName": "google.container.v1.ClusterManager.CreateCluster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster", - "type": ".google.container.v1.Cluster" - }, - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "CreateCluster", - "fullName": "google.container.v1.ClusterManager.CreateCluster", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_UpdateCluster_async", - "title": "ClusterManager updateCluster Sample", - "origin": "API_DEFINITION", - "description": " Updates the settings of a specific cluster.", - "canonical": true, - "file": "cluster_manager.update_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateCluster", - "fullName": "google.container.v1.ClusterManager.UpdateCluster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "update", - "type": ".google.container.v1.ClusterUpdate" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "UpdateCluster", - "fullName": "google.container.v1.ClusterManager.UpdateCluster", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_UpdateNodePool_async", - "title": "ClusterManager updateNodePool Sample", - "origin": "API_DEFINITION", - "description": " Updates the version and/or image type for the specified node pool.", - "canonical": true, - "file": "cluster_manager.update_node_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 156, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateNodePool", - "fullName": "google.container.v1.ClusterManager.UpdateNodePool", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "node_version", - "type": "TYPE_STRING" - }, - { - "name": "image_type", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "locations", - "type": "TYPE_STRING[]" - }, - { - "name": "workload_metadata_config", - "type": ".google.container.v1.WorkloadMetadataConfig" - }, - { - "name": "upgrade_settings", - "type": ".google.container.v1.NodePool.UpgradeSettings" - }, - { - "name": "tags", - "type": ".google.container.v1.NetworkTags" - }, - { - "name": "taints", - "type": ".google.container.v1.NodeTaints" - }, - { - "name": "labels", - "type": ".google.container.v1.NodeLabels" - }, - { - "name": "linux_node_config", - "type": ".google.container.v1.LinuxNodeConfig" - }, - { - "name": "kubelet_config", - "type": ".google.container.v1.NodeKubeletConfig" - }, - { - "name": "node_network_config", - "type": ".google.container.v1.NodeNetworkConfig" - }, - { - "name": "gcfs_config", - "type": ".google.container.v1.GcfsConfig" - }, - { - "name": "confidential_nodes", - "type": ".google.container.v1.ConfidentialNodes" - }, - { - "name": "gvnic", - "type": ".google.container.v1.VirtualNIC" - }, - { - "name": "etag", - "type": "TYPE_STRING" - }, - { - "name": "fast_socket", - "type": ".google.container.v1.FastSocket" - }, - { - "name": "logging_config", - "type": ".google.container.v1.NodePoolLoggingConfig" - }, - { - "name": "resource_labels", - "type": ".google.container.v1.ResourceLabels" - }, - { - "name": "windows_node_config", - "type": ".google.container.v1.WindowsNodeConfig" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "UpdateNodePool", - "fullName": "google.container.v1.ClusterManager.UpdateNodePool", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_SetNodePoolAutoscaling_async", - "title": "ClusterManager setNodePoolAutoscaling Sample", - "origin": "API_DEFINITION", - "description": " Sets the autoscaling settings for the specified node pool.", - "canonical": true, - "file": "cluster_manager.set_node_pool_autoscaling.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetNodePoolAutoscaling", - "fullName": "google.container.v1.ClusterManager.SetNodePoolAutoscaling", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "autoscaling", - "type": ".google.container.v1.NodePoolAutoscaling" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "SetNodePoolAutoscaling", - "fullName": "google.container.v1.ClusterManager.SetNodePoolAutoscaling", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_SetLoggingService_async", - "title": "ClusterManager setLoggingService Sample", - "origin": "API_DEFINITION", - "description": " Sets the logging service for a specific cluster.", - "canonical": true, - "file": "cluster_manager.set_logging_service.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetLoggingService", - "fullName": "google.container.v1.ClusterManager.SetLoggingService", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "logging_service", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "SetLoggingService", - "fullName": "google.container.v1.ClusterManager.SetLoggingService", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_SetMonitoringService_async", - "title": "ClusterManager setMonitoringService Sample", - "origin": "API_DEFINITION", - "description": " Sets the monitoring service for a specific cluster.", - "canonical": true, - "file": "cluster_manager.set_monitoring_service.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetMonitoringService", - "fullName": "google.container.v1.ClusterManager.SetMonitoringService", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "monitoring_service", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "SetMonitoringService", - "fullName": "google.container.v1.ClusterManager.SetMonitoringService", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_SetAddonsConfig_async", - "title": "ClusterManager setAddonsConfig Sample", - "origin": "API_DEFINITION", - "description": " Sets the addons for a specific cluster.", - "canonical": true, - "file": "cluster_manager.set_addons_config.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetAddonsConfig", - "fullName": "google.container.v1.ClusterManager.SetAddonsConfig", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "addons_config", - "type": ".google.container.v1.AddonsConfig" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "SetAddonsConfig", - "fullName": "google.container.v1.ClusterManager.SetAddonsConfig", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_SetLocations_async", - "title": "ClusterManager setLocations Sample", - "origin": "API_DEFINITION", - "description": " Sets the locations for a specific cluster. Deprecated. Use [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update) instead.", - "canonical": true, - "file": "cluster_manager.set_locations.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetLocations", - "fullName": "google.container.v1.ClusterManager.SetLocations", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "locations", - "type": "TYPE_STRING[]" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "SetLocations", - "fullName": "google.container.v1.ClusterManager.SetLocations", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_UpdateMaster_async", - "title": "ClusterManager updateMaster Sample", - "origin": "API_DEFINITION", - "description": " Updates the master for a specific cluster.", - "canonical": true, - "file": "cluster_manager.update_master.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateMaster", - "fullName": "google.container.v1.ClusterManager.UpdateMaster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "master_version", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "UpdateMaster", - "fullName": "google.container.v1.ClusterManager.UpdateMaster", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_SetMasterAuth_async", - "title": "ClusterManager setMasterAuth Sample", - "origin": "API_DEFINITION", - "description": " Sets master auth materials. Currently supports changing the admin password or a specific cluster, either via password generation or explicitly setting the password.", - "canonical": true, - "file": "cluster_manager.set_master_auth.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetMasterAuth", - "fullName": "google.container.v1.ClusterManager.SetMasterAuth", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "action", - "type": ".google.container.v1.SetMasterAuthRequest.Action" - }, - { - "name": "update", - "type": ".google.container.v1.MasterAuth" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "SetMasterAuth", - "fullName": "google.container.v1.ClusterManager.SetMasterAuth", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_DeleteCluster_async", - "title": "ClusterManager deleteCluster Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "cluster_manager.delete_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteCluster", - "fullName": "google.container.v1.ClusterManager.DeleteCluster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "DeleteCluster", - "fullName": "google.container.v1.ClusterManager.DeleteCluster", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_ListOperations_async", - "title": "ClusterManager listOperations Sample", - "origin": "API_DEFINITION", - "description": " Lists all operations in a project in a specific zone or all zones.", - "canonical": true, - "file": "cluster_manager.list_operations.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListOperations", - "fullName": "google.container.v1.ClusterManager.ListOperations", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.ListOperationsResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "ListOperations", - "fullName": "google.container.v1.ClusterManager.ListOperations", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_GetOperation_async", - "title": "ClusterManager getOperation Sample", - "origin": "API_DEFINITION", - "description": " Gets the specified operation.", - "canonical": true, - "file": "cluster_manager.get_operation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetOperation", - "fullName": "google.container.v1.ClusterManager.GetOperation", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "operation_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "GetOperation", - "fullName": "google.container.v1.ClusterManager.GetOperation", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_CancelOperation_async", - "title": "ClusterManager cancelOperation Sample", - "origin": "API_DEFINITION", - "description": " Cancels the specified operation.", - "canonical": true, - "file": "cluster_manager.cancel_operation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CancelOperation", - "fullName": "google.container.v1.ClusterManager.CancelOperation", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "operation_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "CancelOperation", - "fullName": "google.container.v1.ClusterManager.CancelOperation", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_GetServerConfig_async", - "title": "ClusterManager getServerConfig Sample", - "origin": "API_DEFINITION", - "description": " Returns configuration info about the Google Kubernetes Engine service.", - "canonical": true, - "file": "cluster_manager.get_server_config.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetServerConfig", - "fullName": "google.container.v1.ClusterManager.GetServerConfig", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.ServerConfig", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "GetServerConfig", - "fullName": "google.container.v1.ClusterManager.GetServerConfig", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_GetJSONWebKeys_async", - "title": "ClusterManager getJSONWebKeys Sample", - "origin": "API_DEFINITION", - "description": " Gets the public component of the cluster signing keys in JSON Web Key format. This API is not yet intended for general use, and is not available for all clusters.", - "canonical": true, - "file": "cluster_manager.get_j_s_o_n_web_keys.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetJSONWebKeys", - "fullName": "google.container.v1.ClusterManager.GetJSONWebKeys", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.GetJSONWebKeysResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "GetJSONWebKeys", - "fullName": "google.container.v1.ClusterManager.GetJSONWebKeys", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_ListNodePools_async", - "title": "ClusterManager listNodePools Sample", - "origin": "API_DEFINITION", - "description": " Lists the node pools for a cluster.", - "canonical": true, - "file": "cluster_manager.list_node_pools.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListNodePools", - "fullName": "google.container.v1.ClusterManager.ListNodePools", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.ListNodePoolsResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "ListNodePools", - "fullName": "google.container.v1.ClusterManager.ListNodePools", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_GetNodePool_async", - "title": "ClusterManager getNodePool Sample", - "origin": "API_DEFINITION", - "description": " Retrieves the requested node pool.", - "canonical": true, - "file": "cluster_manager.get_node_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetNodePool", - "fullName": "google.container.v1.ClusterManager.GetNodePool", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.NodePool", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "GetNodePool", - "fullName": "google.container.v1.ClusterManager.GetNodePool", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_CreateNodePool_async", - "title": "ClusterManager createNodePool Sample", - "origin": "API_DEFINITION", - "description": " Creates a node pool for a cluster.", - "canonical": true, - "file": "cluster_manager.create_node_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateNodePool", - "fullName": "google.container.v1.ClusterManager.CreateNodePool", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool", - "type": ".google.container.v1.NodePool" - }, - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "CreateNodePool", - "fullName": "google.container.v1.ClusterManager.CreateNodePool", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_DeleteNodePool_async", - "title": "ClusterManager deleteNodePool Sample", - "origin": "API_DEFINITION", - "description": " Deletes a node pool from a cluster.", - "canonical": true, - "file": "cluster_manager.delete_node_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteNodePool", - "fullName": "google.container.v1.ClusterManager.DeleteNodePool", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "DeleteNodePool", - "fullName": "google.container.v1.ClusterManager.DeleteNodePool", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_CompleteNodePoolUpgrade_async", - "title": "ClusterManager completeNodePoolUpgrade Sample", - "origin": "API_DEFINITION", - "description": " CompleteNodePoolUpgrade will signal an on-going node pool upgrade to complete.", - "canonical": true, - "file": "cluster_manager.complete_node_pool_upgrade.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CompleteNodePoolUpgrade", - "fullName": "google.container.v1.ClusterManager.CompleteNodePoolUpgrade", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "CompleteNodePoolUpgrade", - "fullName": "google.container.v1.ClusterManager.CompleteNodePoolUpgrade", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_RollbackNodePoolUpgrade_async", - "title": "ClusterManager rollbackNodePoolUpgrade Sample", - "origin": "API_DEFINITION", - "description": " Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last upgrade successfully completed.", - "canonical": true, - "file": "cluster_manager.rollback_node_pool_upgrade.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RollbackNodePoolUpgrade", - "fullName": "google.container.v1.ClusterManager.RollbackNodePoolUpgrade", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "respect_pdb", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "RollbackNodePoolUpgrade", - "fullName": "google.container.v1.ClusterManager.RollbackNodePoolUpgrade", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_SetNodePoolManagement_async", - "title": "ClusterManager setNodePoolManagement Sample", - "origin": "API_DEFINITION", - "description": " Sets the NodeManagement options for a node pool.", - "canonical": true, - "file": "cluster_manager.set_node_pool_management.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetNodePoolManagement", - "fullName": "google.container.v1.ClusterManager.SetNodePoolManagement", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "management", - "type": ".google.container.v1.NodeManagement" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "SetNodePoolManagement", - "fullName": "google.container.v1.ClusterManager.SetNodePoolManagement", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_SetLabels_async", - "title": "ClusterManager setLabels Sample", - "origin": "API_DEFINITION", - "description": " Sets labels on a cluster.", - "canonical": true, - "file": "cluster_manager.set_labels.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetLabels", - "fullName": "google.container.v1.ClusterManager.SetLabels", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "resource_labels", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "label_fingerprint", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "SetLabels", - "fullName": "google.container.v1.ClusterManager.SetLabels", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_SetLegacyAbac_async", - "title": "ClusterManager setLegacyAbac Sample", - "origin": "API_DEFINITION", - "description": " Enables or disables the ABAC authorization mechanism on a cluster.", - "canonical": true, - "file": "cluster_manager.set_legacy_abac.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetLegacyAbac", - "fullName": "google.container.v1.ClusterManager.SetLegacyAbac", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "enabled", - "type": "TYPE_BOOL" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "SetLegacyAbac", - "fullName": "google.container.v1.ClusterManager.SetLegacyAbac", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_StartIPRotation_async", - "title": "ClusterManager startIPRotation Sample", - "origin": "API_DEFINITION", - "description": " Starts master IP rotation.", - "canonical": true, - "file": "cluster_manager.start_i_p_rotation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "StartIPRotation", - "fullName": "google.container.v1.ClusterManager.StartIPRotation", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "rotate_credentials", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "StartIPRotation", - "fullName": "google.container.v1.ClusterManager.StartIPRotation", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_CompleteIPRotation_async", - "title": "ClusterManager completeIPRotation Sample", - "origin": "API_DEFINITION", - "description": " Completes master IP rotation.", - "canonical": true, - "file": "cluster_manager.complete_i_p_rotation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CompleteIPRotation", - "fullName": "google.container.v1.ClusterManager.CompleteIPRotation", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "CompleteIPRotation", - "fullName": "google.container.v1.ClusterManager.CompleteIPRotation", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_SetNodePoolSize_async", - "title": "ClusterManager setNodePoolSize Sample", - "origin": "API_DEFINITION", - "description": " Sets the size for a specific node pool. The new size will be used for all replicas, including future replicas created by modifying [NodePool.locations][google.container.v1.NodePool.locations].", - "canonical": true, - "file": "cluster_manager.set_node_pool_size.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetNodePoolSize", - "fullName": "google.container.v1.ClusterManager.SetNodePoolSize", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "node_count", - "type": "TYPE_INT32" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "SetNodePoolSize", - "fullName": "google.container.v1.ClusterManager.SetNodePoolSize", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_SetNetworkPolicy_async", - "title": "ClusterManager setNetworkPolicy Sample", - "origin": "API_DEFINITION", - "description": " Enables or disables Network Policy for a cluster.", - "canonical": true, - "file": "cluster_manager.set_network_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetNetworkPolicy", - "fullName": "google.container.v1.ClusterManager.SetNetworkPolicy", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "network_policy", - "type": ".google.container.v1.NetworkPolicy" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "SetNetworkPolicy", - "fullName": "google.container.v1.ClusterManager.SetNetworkPolicy", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_SetMaintenancePolicy_async", - "title": "ClusterManager setMaintenancePolicy Sample", - "origin": "API_DEFINITION", - "description": " Sets the maintenance policy for a cluster.", - "canonical": true, - "file": "cluster_manager.set_maintenance_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 78, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetMaintenancePolicy", - "fullName": "google.container.v1.ClusterManager.SetMaintenancePolicy", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "maintenance_policy", - "type": ".google.container.v1.MaintenancePolicy" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "SetMaintenancePolicy", - "fullName": "google.container.v1.ClusterManager.SetMaintenancePolicy", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_ListUsableSubnetworks_async", - "title": "ClusterManager listUsableSubnetworks Sample", - "origin": "API_DEFINITION", - "description": " Lists subnetworks that are usable for creating clusters in a project.", - "canonical": true, - "file": "cluster_manager.list_usable_subnetworks.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 74, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListUsableSubnetworks", - "fullName": "google.container.v1.ClusterManager.ListUsableSubnetworks", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.ListUsableSubnetworksResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "ListUsableSubnetworks", - "fullName": "google.container.v1.ClusterManager.ListUsableSubnetworks", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1_generated_ClusterManager_CheckAutopilotCompatibility_async", - "title": "ClusterManager checkAutopilotCompatibility Sample", - "origin": "API_DEFINITION", - "description": " Checks the cluster compatibility with Autopilot mode, and returns a list of compatibility issues.", - "canonical": true, - "file": "cluster_manager.check_autopilot_compatibility.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CheckAutopilotCompatibility", - "fullName": "google.container.v1.ClusterManager.CheckAutopilotCompatibility", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1.CheckAutopilotCompatibilityResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1.ClusterManagerClient" - }, - "method": { - "shortName": "CheckAutopilotCompatibility", - "fullName": "google.container.v1.ClusterManager.CheckAutopilotCompatibility", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1.ClusterManager" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-container/v1/src/index.ts b/owl-bot-staging/google-container/v1/src/index.ts deleted file mode 100644 index 7f3539e2b2d..00000000000 --- a/owl-bot-staging/google-container/v1/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1 from './v1'; -const ClusterManagerClient = v1.ClusterManagerClient; -type ClusterManagerClient = v1.ClusterManagerClient; -export {v1, ClusterManagerClient}; -export default {v1, ClusterManagerClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/google-container/v1/src/v1/cluster_manager_client.ts b/owl-bot-staging/google-container/v1/src/v1/cluster_manager_client.ts deleted file mode 100644 index 6805bf5ddf2..00000000000 --- a/owl-bot-staging/google-container/v1/src/v1/cluster_manager_client.ts +++ /dev/null @@ -1,3551 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/cluster_manager_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './cluster_manager_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Google Kubernetes Engine Cluster Manager v1 - * @class - * @memberof v1 - */ -export class ClusterManagerClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - clusterManagerStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of ClusterManagerClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ClusterManagerClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof ClusterManagerClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listUsableSubnetworks: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'subnetworks') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.container.v1.ClusterManager', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.clusterManagerStub) { - return this.clusterManagerStub; - } - - // Put together the "service stub" for - // google.container.v1.ClusterManager. - this.clusterManagerStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.container.v1.ClusterManager') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.container.v1.ClusterManager, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const clusterManagerStubMethods = - ['listClusters', 'getCluster', 'createCluster', 'updateCluster', 'updateNodePool', 'setNodePoolAutoscaling', 'setLoggingService', 'setMonitoringService', 'setAddonsConfig', 'setLocations', 'updateMaster', 'setMasterAuth', 'deleteCluster', 'listOperations', 'getOperation', 'cancelOperation', 'getServerConfig', 'getJsonWebKeys', 'listNodePools', 'getNodePool', 'createNodePool', 'deleteNodePool', 'completeNodePoolUpgrade', 'rollbackNodePoolUpgrade', 'setNodePoolManagement', 'setLabels', 'setLegacyAbac', 'startIpRotation', 'completeIpRotation', 'setNodePoolSize', 'setNetworkPolicy', 'setMaintenancePolicy', 'listUsableSubnetworks', 'checkAutopilotCompatibility']; - for (const methodName of clusterManagerStubMethods) { - const callPromise = this.clusterManagerStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.clusterManagerStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'container.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'container.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Lists all clusters owned by a project in either the specified zone or all - * zones. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the parent field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides, or "-" for all zones. This field has been deprecated and - * replaced by the parent field. - * @param {string} request.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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.ListClustersResponse | ListClustersResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.list_clusters.js - * region_tag:container_v1_generated_ClusterManager_ListClusters_async - */ - listClusters( - request?: protos.google.container.v1.IListClustersRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IListClustersResponse, - protos.google.container.v1.IListClustersRequest|undefined, {}|undefined - ]>; - listClusters( - request: protos.google.container.v1.IListClustersRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IListClustersResponse, - protos.google.container.v1.IListClustersRequest|null|undefined, - {}|null|undefined>): void; - listClusters( - request: protos.google.container.v1.IListClustersRequest, - callback: Callback< - protos.google.container.v1.IListClustersResponse, - protos.google.container.v1.IListClustersRequest|null|undefined, - {}|null|undefined>): void; - listClusters( - request?: protos.google.container.v1.IListClustersRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IListClustersResponse, - protos.google.container.v1.IListClustersRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IListClustersResponse, - protos.google.container.v1.IListClustersRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IListClustersResponse, - protos.google.container.v1.IListClustersRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - }); - this.initialize(); - return this.innerApiCalls.listClusters(request, options, callback); - } -/** - * Gets the details of a specific cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to retrieve. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to retrieve. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Cluster | Cluster}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.get_cluster.js - * region_tag:container_v1_generated_ClusterManager_GetCluster_async - */ - getCluster( - request?: protos.google.container.v1.IGetClusterRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.ICluster, - protos.google.container.v1.IGetClusterRequest|undefined, {}|undefined - ]>; - getCluster( - request: protos.google.container.v1.IGetClusterRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.ICluster, - protos.google.container.v1.IGetClusterRequest|null|undefined, - {}|null|undefined>): void; - getCluster( - request: protos.google.container.v1.IGetClusterRequest, - callback: Callback< - protos.google.container.v1.ICluster, - protos.google.container.v1.IGetClusterRequest|null|undefined, - {}|null|undefined>): void; - getCluster( - request?: protos.google.container.v1.IGetClusterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.ICluster, - protos.google.container.v1.IGetClusterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.ICluster, - protos.google.container.v1.IGetClusterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.ICluster, - protos.google.container.v1.IGetClusterRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.getCluster(request, options, callback); - } -/** - * 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](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). - * - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the parent field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the parent - * field. - * @param {google.container.v1.Cluster} request.cluster - * Required. A [cluster - * resource](https://cloud.google.com/container-engine/reference/rest/v1/projects.locations.clusters) - * @param {string} request.parent - * The parent (project and location) where the cluster will be created. - * Specified in the format `projects/* /locations/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.create_cluster.js - * region_tag:container_v1_generated_ClusterManager_CreateCluster_async - */ - createCluster( - request?: protos.google.container.v1.ICreateClusterRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ICreateClusterRequest|undefined, {}|undefined - ]>; - createCluster( - request: protos.google.container.v1.ICreateClusterRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ICreateClusterRequest|null|undefined, - {}|null|undefined>): void; - createCluster( - request: protos.google.container.v1.ICreateClusterRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ICreateClusterRequest|null|undefined, - {}|null|undefined>): void; - createCluster( - request?: protos.google.container.v1.ICreateClusterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ICreateClusterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ICreateClusterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ICreateClusterRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - }); - this.initialize(); - return this.innerApiCalls.createCluster(request, options, callback); - } -/** - * Updates the settings of a specific cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {google.container.v1.ClusterUpdate} request.update - * Required. A description of the update. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to update. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.update_cluster.js - * region_tag:container_v1_generated_ClusterManager_UpdateCluster_async - */ - updateCluster( - request?: protos.google.container.v1.IUpdateClusterRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateClusterRequest|undefined, {}|undefined - ]>; - updateCluster( - request: protos.google.container.v1.IUpdateClusterRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateClusterRequest|null|undefined, - {}|null|undefined>): void; - updateCluster( - request: protos.google.container.v1.IUpdateClusterRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateClusterRequest|null|undefined, - {}|null|undefined>): void; - updateCluster( - request?: protos.google.container.v1.IUpdateClusterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateClusterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateClusterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateClusterRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateCluster(request, options, callback); - } -/** - * Updates the version and/or image type for the specified node pool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Deprecated. The name of the node pool to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodeVersion - * 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 - * @param {string} request.imageType - * Required. The desired image type for the node pool. Please see - * https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for - * available image types. - * @param {string} request.name - * The name (project, location, cluster, node pool) of the node pool to - * update. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {string[]} request.locations - * The desired list of Google Compute Engine - * [zones](https://cloud.google.com/compute/docs/zones#available) in which the - * node pool's nodes should be located. Changing the locations for a node pool - * will result in nodes being either created or removed from the node pool, - * depending on whether locations are being added or removed. - * @param {google.container.v1.WorkloadMetadataConfig} request.workloadMetadataConfig - * The desired workload metadata config for the node pool. - * @param {google.container.v1.NodePool.UpgradeSettings} request.upgradeSettings - * Upgrade settings control disruption and speed of the upgrade. - * @param {google.container.v1.NetworkTags} request.tags - * The desired network tags to be applied to all nodes in the node pool. - * If this field is not present, the tags will not be changed. Otherwise, - * the existing network tags will be *replaced* with the provided tags. - * @param {google.container.v1.NodeTaints} request.taints - * The desired node taints to be applied to all nodes in the node pool. - * If this field is not present, the taints will not be changed. Otherwise, - * the existing node taints will be *replaced* with the provided taints. - * @param {google.container.v1.NodeLabels} request.labels - * The desired node labels to be applied to all nodes in the node pool. - * If this field is not present, the labels will not be changed. Otherwise, - * the existing node labels will be *replaced* with the provided labels. - * @param {google.container.v1.LinuxNodeConfig} request.linuxNodeConfig - * Parameters that can be configured on Linux nodes. - * @param {google.container.v1.NodeKubeletConfig} request.kubeletConfig - * Node kubelet configs. - * @param {google.container.v1.NodeNetworkConfig} request.nodeNetworkConfig - * Node network config. - * @param {google.container.v1.GcfsConfig} request.gcfsConfig - * GCFS config. - * @param {google.container.v1.ConfidentialNodes} request.confidentialNodes - * Confidential nodes config. - * All the nodes in the node pool will be Confidential VM once enabled. - * @param {google.container.v1.VirtualNIC} request.gvnic - * Enable or disable gvnic on the node pool. - * @param {string} request.etag - * The current etag of the node pool. - * If an etag is provided and does not match the current etag of the node - * pool, update will be blocked and an ABORTED error will be returned. - * @param {google.container.v1.FastSocket} request.fastSocket - * Enable or disable NCCL fast socket for the node pool. - * @param {google.container.v1.NodePoolLoggingConfig} request.loggingConfig - * Logging configuration. - * @param {google.container.v1.ResourceLabels} request.resourceLabels - * The resource labels for the node pool to use to annotate any related - * Google Compute Engine resources. - * @param {google.container.v1.WindowsNodeConfig} request.windowsNodeConfig - * Parameters that can be configured on Windows nodes. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.update_node_pool.js - * region_tag:container_v1_generated_ClusterManager_UpdateNodePool_async - */ - updateNodePool( - request?: protos.google.container.v1.IUpdateNodePoolRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateNodePoolRequest|undefined, {}|undefined - ]>; - updateNodePool( - request: protos.google.container.v1.IUpdateNodePoolRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateNodePoolRequest|null|undefined, - {}|null|undefined>): void; - updateNodePool( - request: protos.google.container.v1.IUpdateNodePoolRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateNodePoolRequest|null|undefined, - {}|null|undefined>): void; - updateNodePool( - request?: protos.google.container.v1.IUpdateNodePoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateNodePoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateNodePoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateNodePoolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateNodePool(request, options, callback); - } -/** - * Sets the autoscaling settings for the specified node pool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Deprecated. The name of the node pool to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {google.container.v1.NodePoolAutoscaling} request.autoscaling - * Required. Autoscaling configuration for the node pool. - * @param {string} request.name - * The name (project, location, cluster, node pool) of the node pool to set - * autoscaler settings. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.set_node_pool_autoscaling.js - * region_tag:container_v1_generated_ClusterManager_SetNodePoolAutoscaling_async - */ - setNodePoolAutoscaling( - request?: protos.google.container.v1.ISetNodePoolAutoscalingRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolAutoscalingRequest|undefined, {}|undefined - ]>; - setNodePoolAutoscaling( - request: protos.google.container.v1.ISetNodePoolAutoscalingRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolAutoscalingRequest|null|undefined, - {}|null|undefined>): void; - setNodePoolAutoscaling( - request: protos.google.container.v1.ISetNodePoolAutoscalingRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolAutoscalingRequest|null|undefined, - {}|null|undefined>): void; - setNodePoolAutoscaling( - request?: protos.google.container.v1.ISetNodePoolAutoscalingRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolAutoscalingRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolAutoscalingRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolAutoscalingRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setNodePoolAutoscaling(request, options, callback); - } -/** - * Sets the logging service for a specific cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string} request.loggingService - * Required. The logging service the cluster should use to write logs. - * Currently available options: - * - * * `logging.googleapis.com/kubernetes` - The Cloud Logging - * service with a Kubernetes-native resource model - * * `logging.googleapis.com` - The legacy Cloud Logging service (no longer - * available as of GKE 1.15). - * * `none` - no logs will be exported from the cluster. - * - * If left as an empty string,`logging.googleapis.com/kubernetes` will be - * used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to set logging. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.set_logging_service.js - * region_tag:container_v1_generated_ClusterManager_SetLoggingService_async - */ - setLoggingService( - request?: protos.google.container.v1.ISetLoggingServiceRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLoggingServiceRequest|undefined, {}|undefined - ]>; - setLoggingService( - request: protos.google.container.v1.ISetLoggingServiceRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLoggingServiceRequest|null|undefined, - {}|null|undefined>): void; - setLoggingService( - request: protos.google.container.v1.ISetLoggingServiceRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLoggingServiceRequest|null|undefined, - {}|null|undefined>): void; - setLoggingService( - request?: protos.google.container.v1.ISetLoggingServiceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLoggingServiceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLoggingServiceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLoggingServiceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setLoggingService(request, options, callback); - } -/** - * Sets the monitoring service for a specific cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string} request.monitoringService - * Required. The monitoring service the cluster should use to write metrics. - * Currently available options: - * - * * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring - * service with a Kubernetes-native resource model - * * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no - * longer available as of GKE 1.15). - * * `none` - No metrics will be exported from the cluster. - * - * If left as an empty string,`monitoring.googleapis.com/kubernetes` will be - * used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to set monitoring. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.set_monitoring_service.js - * region_tag:container_v1_generated_ClusterManager_SetMonitoringService_async - */ - setMonitoringService( - request?: protos.google.container.v1.ISetMonitoringServiceRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMonitoringServiceRequest|undefined, {}|undefined - ]>; - setMonitoringService( - request: protos.google.container.v1.ISetMonitoringServiceRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMonitoringServiceRequest|null|undefined, - {}|null|undefined>): void; - setMonitoringService( - request: protos.google.container.v1.ISetMonitoringServiceRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMonitoringServiceRequest|null|undefined, - {}|null|undefined>): void; - setMonitoringService( - request?: protos.google.container.v1.ISetMonitoringServiceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMonitoringServiceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMonitoringServiceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMonitoringServiceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setMonitoringService(request, options, callback); - } -/** - * Sets the addons for a specific cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {google.container.v1.AddonsConfig} request.addonsConfig - * Required. The desired configurations for the various addons available to - * run in the cluster. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to set addons. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.set_addons_config.js - * region_tag:container_v1_generated_ClusterManager_SetAddonsConfig_async - */ - setAddonsConfig( - request?: protos.google.container.v1.ISetAddonsConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetAddonsConfigRequest|undefined, {}|undefined - ]>; - setAddonsConfig( - request: protos.google.container.v1.ISetAddonsConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetAddonsConfigRequest|null|undefined, - {}|null|undefined>): void; - setAddonsConfig( - request: protos.google.container.v1.ISetAddonsConfigRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetAddonsConfigRequest|null|undefined, - {}|null|undefined>): void; - setAddonsConfig( - request?: protos.google.container.v1.ISetAddonsConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetAddonsConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetAddonsConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetAddonsConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setAddonsConfig(request, options, callback); - } -/** - * Sets the locations for a specific cluster. - * Deprecated. Use - * [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update) - * instead. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string[]} request.locations - * Required. The desired list of Google Compute Engine - * [zones](https://cloud.google.com/compute/docs/zones#available) 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. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to set locations. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.set_locations.js - * region_tag:container_v1_generated_ClusterManager_SetLocations_async - * @deprecated SetLocations is deprecated and may be removed in a future version. - */ - setLocations( - request?: protos.google.container.v1.ISetLocationsRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLocationsRequest|undefined, {}|undefined - ]>; - setLocations( - request: protos.google.container.v1.ISetLocationsRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLocationsRequest|null|undefined, - {}|null|undefined>): void; - setLocations( - request: protos.google.container.v1.ISetLocationsRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLocationsRequest|null|undefined, - {}|null|undefined>): void; - setLocations( - request?: protos.google.container.v1.ISetLocationsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLocationsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLocationsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLocationsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - this.warn('DEP$ClusterManager-$SetLocations','SetLocations is deprecated and may be removed in a future version.', 'DeprecationWarning'); - return this.innerApiCalls.setLocations(request, options, callback); - } -/** - * Updates the master for a specific cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string} request.masterVersion - * 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 - * @param {string} request.name - * The name (project, location, cluster) of the cluster to update. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.update_master.js - * region_tag:container_v1_generated_ClusterManager_UpdateMaster_async - */ - updateMaster( - request?: protos.google.container.v1.IUpdateMasterRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateMasterRequest|undefined, {}|undefined - ]>; - updateMaster( - request: protos.google.container.v1.IUpdateMasterRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateMasterRequest|null|undefined, - {}|null|undefined>): void; - updateMaster( - request: protos.google.container.v1.IUpdateMasterRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateMasterRequest|null|undefined, - {}|null|undefined>): void; - updateMaster( - request?: protos.google.container.v1.IUpdateMasterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateMasterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateMasterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IUpdateMasterRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateMaster(request, options, callback); - } -/** - * Sets master auth materials. Currently supports changing the admin password - * or a specific cluster, either via password generation or explicitly setting - * the password. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {google.container.v1.SetMasterAuthRequest.Action} request.action - * Required. The exact form of action to be taken on the master auth. - * @param {google.container.v1.MasterAuth} request.update - * Required. A description of the update. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to set auth. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.set_master_auth.js - * region_tag:container_v1_generated_ClusterManager_SetMasterAuth_async - */ - setMasterAuth( - request?: protos.google.container.v1.ISetMasterAuthRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMasterAuthRequest|undefined, {}|undefined - ]>; - setMasterAuth( - request: protos.google.container.v1.ISetMasterAuthRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMasterAuthRequest|null|undefined, - {}|null|undefined>): void; - setMasterAuth( - request: protos.google.container.v1.ISetMasterAuthRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMasterAuthRequest|null|undefined, - {}|null|undefined>): void; - setMasterAuth( - request?: protos.google.container.v1.ISetMasterAuthRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMasterAuthRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMasterAuthRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMasterAuthRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setMasterAuth(request, options, callback); - } -/** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to delete. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to delete. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.delete_cluster.js - * region_tag:container_v1_generated_ClusterManager_DeleteCluster_async - */ - deleteCluster( - request?: protos.google.container.v1.IDeleteClusterRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IDeleteClusterRequest|undefined, {}|undefined - ]>; - deleteCluster( - request: protos.google.container.v1.IDeleteClusterRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IDeleteClusterRequest|null|undefined, - {}|null|undefined>): void; - deleteCluster( - request: protos.google.container.v1.IDeleteClusterRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IDeleteClusterRequest|null|undefined, - {}|null|undefined>): void; - deleteCluster( - request?: protos.google.container.v1.IDeleteClusterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IDeleteClusterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IDeleteClusterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IDeleteClusterRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteCluster(request, options, callback); - } -/** - * Lists all operations in a project in a specific zone or all zones. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the parent field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) to return - * operations for, or `-` for all zones. This field has been deprecated and - * replaced by the parent field. - * @param {string} request.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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.ListOperationsResponse | ListOperationsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.list_operations.js - * region_tag:container_v1_generated_ClusterManager_ListOperations_async - */ - listOperations( - request?: protos.google.container.v1.IListOperationsRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IListOperationsResponse, - protos.google.container.v1.IListOperationsRequest|undefined, {}|undefined - ]>; - listOperations( - request: protos.google.container.v1.IListOperationsRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IListOperationsResponse, - protos.google.container.v1.IListOperationsRequest|null|undefined, - {}|null|undefined>): void; - listOperations( - request: protos.google.container.v1.IListOperationsRequest, - callback: Callback< - protos.google.container.v1.IListOperationsResponse, - protos.google.container.v1.IListOperationsRequest|null|undefined, - {}|null|undefined>): void; - listOperations( - request?: protos.google.container.v1.IListOperationsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IListOperationsResponse, - protos.google.container.v1.IListOperationsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IListOperationsResponse, - protos.google.container.v1.IListOperationsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IListOperationsResponse, - protos.google.container.v1.IListOperationsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - }); - this.initialize(); - return this.innerApiCalls.listOperations(request, options, callback); - } -/** - * Gets the specified operation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.operationId - * Deprecated. The server-assigned `name` of the operation. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, operation id) of the operation to get. - * Specified in the format `projects/* /locations/* /operations/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.get_operation.js - * region_tag:container_v1_generated_ClusterManager_GetOperation_async - */ - getOperation( - request?: protos.google.container.v1.IGetOperationRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IGetOperationRequest|undefined, {}|undefined - ]>; - getOperation( - request: protos.google.container.v1.IGetOperationRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IGetOperationRequest|null|undefined, - {}|null|undefined>): void; - getOperation( - request: protos.google.container.v1.IGetOperationRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IGetOperationRequest|null|undefined, - {}|null|undefined>): void; - getOperation( - request?: protos.google.container.v1.IGetOperationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IGetOperationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IGetOperationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IGetOperationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'operation_id': request.operationId ?? '', - }); - this.initialize(); - return this.innerApiCalls.getOperation(request, options, callback); - } -/** - * Cancels the specified operation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * operation resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.operationId - * Deprecated. The server-assigned `name` of the operation. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, operation id) of the operation to cancel. - * Specified in the format `projects/* /locations/* /operations/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.cancel_operation.js - * region_tag:container_v1_generated_ClusterManager_CancelOperation_async - */ - cancelOperation( - request?: protos.google.container.v1.ICancelOperationRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.container.v1.ICancelOperationRequest|undefined, {}|undefined - ]>; - cancelOperation( - request: protos.google.container.v1.ICancelOperationRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1.ICancelOperationRequest|null|undefined, - {}|null|undefined>): void; - cancelOperation( - request: protos.google.container.v1.ICancelOperationRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1.ICancelOperationRequest|null|undefined, - {}|null|undefined>): void; - cancelOperation( - request?: protos.google.container.v1.ICancelOperationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1.ICancelOperationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1.ICancelOperationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.container.v1.ICancelOperationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'operation_id': request.operationId ?? '', - }); - this.initialize(); - return this.innerApiCalls.cancelOperation(request, options, callback); - } -/** - * Returns configuration info about the Google Kubernetes Engine service. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) to return - * operations for. This field has been deprecated and replaced by the name - * field. - * @param {string} request.name - * The name (project and location) of the server config to get, - * specified in the format `projects/* /locations/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.ServerConfig | ServerConfig}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.get_server_config.js - * region_tag:container_v1_generated_ClusterManager_GetServerConfig_async - */ - getServerConfig( - request?: protos.google.container.v1.IGetServerConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IServerConfig, - protos.google.container.v1.IGetServerConfigRequest|undefined, {}|undefined - ]>; - getServerConfig( - request: protos.google.container.v1.IGetServerConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IServerConfig, - protos.google.container.v1.IGetServerConfigRequest|null|undefined, - {}|null|undefined>): void; - getServerConfig( - request: protos.google.container.v1.IGetServerConfigRequest, - callback: Callback< - protos.google.container.v1.IServerConfig, - protos.google.container.v1.IGetServerConfigRequest|null|undefined, - {}|null|undefined>): void; - getServerConfig( - request?: protos.google.container.v1.IGetServerConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IServerConfig, - protos.google.container.v1.IGetServerConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IServerConfig, - protos.google.container.v1.IGetServerConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IServerConfig, - protos.google.container.v1.IGetServerConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - }); - this.initialize(); - return this.innerApiCalls.getServerConfig(request, options, callback); - } -/** - * Gets the public component of the cluster signing keys in - * JSON Web Key format. - * This API is not yet intended for general use, and is not available for all - * clusters. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The cluster (project, location, cluster name) to get keys for. Specified in - * the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.GetJSONWebKeysResponse | GetJSONWebKeysResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.get_j_s_o_n_web_keys.js - * region_tag:container_v1_generated_ClusterManager_GetJSONWebKeys_async - */ - getJSONWebKeys( - request?: protos.google.container.v1.IGetJSONWebKeysRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IGetJSONWebKeysResponse, - protos.google.container.v1.IGetJSONWebKeysRequest|undefined, {}|undefined - ]>; - getJSONWebKeys( - request: protos.google.container.v1.IGetJSONWebKeysRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IGetJSONWebKeysResponse, - protos.google.container.v1.IGetJSONWebKeysRequest|null|undefined, - {}|null|undefined>): void; - getJSONWebKeys( - request: protos.google.container.v1.IGetJSONWebKeysRequest, - callback: Callback< - protos.google.container.v1.IGetJSONWebKeysResponse, - protos.google.container.v1.IGetJSONWebKeysRequest|null|undefined, - {}|null|undefined>): void; - getJSONWebKeys( - request?: protos.google.container.v1.IGetJSONWebKeysRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IGetJSONWebKeysResponse, - protos.google.container.v1.IGetJSONWebKeysRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IGetJSONWebKeysResponse, - protos.google.container.v1.IGetJSONWebKeysRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IGetJSONWebKeysResponse, - protos.google.container.v1.IGetJSONWebKeysRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.getJsonWebKeys(request, options, callback); - } -/** - * Lists the node pools for a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the parent field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the parent - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the parent field. - * @param {string} request.parent - * The parent (project, location, cluster name) where the node pools will be - * listed. Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.ListNodePoolsResponse | ListNodePoolsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.list_node_pools.js - * region_tag:container_v1_generated_ClusterManager_ListNodePools_async - */ - listNodePools( - request?: protos.google.container.v1.IListNodePoolsRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IListNodePoolsResponse, - protos.google.container.v1.IListNodePoolsRequest|undefined, {}|undefined - ]>; - listNodePools( - request: protos.google.container.v1.IListNodePoolsRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IListNodePoolsResponse, - protos.google.container.v1.IListNodePoolsRequest|null|undefined, - {}|null|undefined>): void; - listNodePools( - request: protos.google.container.v1.IListNodePoolsRequest, - callback: Callback< - protos.google.container.v1.IListNodePoolsResponse, - protos.google.container.v1.IListNodePoolsRequest|null|undefined, - {}|null|undefined>): void; - listNodePools( - request?: protos.google.container.v1.IListNodePoolsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IListNodePoolsResponse, - protos.google.container.v1.IListNodePoolsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IListNodePoolsResponse, - protos.google.container.v1.IListNodePoolsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IListNodePoolsResponse, - protos.google.container.v1.IListNodePoolsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.listNodePools(request, options, callback); - } -/** - * Retrieves the requested node pool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Deprecated. The name of the node pool. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster, node pool id) of the node pool to - * get. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.NodePool | NodePool}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.get_node_pool.js - * region_tag:container_v1_generated_ClusterManager_GetNodePool_async - */ - getNodePool( - request?: protos.google.container.v1.IGetNodePoolRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.INodePool, - protos.google.container.v1.IGetNodePoolRequest|undefined, {}|undefined - ]>; - getNodePool( - request: protos.google.container.v1.IGetNodePoolRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.INodePool, - protos.google.container.v1.IGetNodePoolRequest|null|undefined, - {}|null|undefined>): void; - getNodePool( - request: protos.google.container.v1.IGetNodePoolRequest, - callback: Callback< - protos.google.container.v1.INodePool, - protos.google.container.v1.IGetNodePoolRequest|null|undefined, - {}|null|undefined>): void; - getNodePool( - request?: protos.google.container.v1.IGetNodePoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.INodePool, - protos.google.container.v1.IGetNodePoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.INodePool, - protos.google.container.v1.IGetNodePoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.INodePool, - protos.google.container.v1.IGetNodePoolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.getNodePool(request, options, callback); - } -/** - * Creates a node pool for a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the parent field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the parent - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the parent field. - * @param {google.container.v1.NodePool} request.nodePool - * Required. The node pool to create. - * @param {string} request.parent - * The parent (project, location, cluster name) where the node pool will be - * created. Specified in the format - * `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.create_node_pool.js - * region_tag:container_v1_generated_ClusterManager_CreateNodePool_async - */ - createNodePool( - request?: protos.google.container.v1.ICreateNodePoolRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ICreateNodePoolRequest|undefined, {}|undefined - ]>; - createNodePool( - request: protos.google.container.v1.ICreateNodePoolRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ICreateNodePoolRequest|null|undefined, - {}|null|undefined>): void; - createNodePool( - request: protos.google.container.v1.ICreateNodePoolRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ICreateNodePoolRequest|null|undefined, - {}|null|undefined>): void; - createNodePool( - request?: protos.google.container.v1.ICreateNodePoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ICreateNodePoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ICreateNodePoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ICreateNodePoolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.createNodePool(request, options, callback); - } -/** - * Deletes a node pool from a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Deprecated. The name of the node pool to delete. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster, node pool id) of the node pool to - * delete. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.delete_node_pool.js - * region_tag:container_v1_generated_ClusterManager_DeleteNodePool_async - */ - deleteNodePool( - request?: protos.google.container.v1.IDeleteNodePoolRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IDeleteNodePoolRequest|undefined, {}|undefined - ]>; - deleteNodePool( - request: protos.google.container.v1.IDeleteNodePoolRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IDeleteNodePoolRequest|null|undefined, - {}|null|undefined>): void; - deleteNodePool( - request: protos.google.container.v1.IDeleteNodePoolRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IDeleteNodePoolRequest|null|undefined, - {}|null|undefined>): void; - deleteNodePool( - request?: protos.google.container.v1.IDeleteNodePoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IDeleteNodePoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IDeleteNodePoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IDeleteNodePoolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteNodePool(request, options, callback); - } -/** - * CompleteNodePoolUpgrade will signal an on-going node pool upgrade to - * complete. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The name (project, location, cluster, node pool id) of the node pool to - * complete upgrade. - * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js - * region_tag:container_v1_generated_ClusterManager_CompleteNodePoolUpgrade_async - */ - completeNodePoolUpgrade( - request?: protos.google.container.v1.ICompleteNodePoolUpgradeRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.container.v1.ICompleteNodePoolUpgradeRequest|undefined, {}|undefined - ]>; - completeNodePoolUpgrade( - request: protos.google.container.v1.ICompleteNodePoolUpgradeRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1.ICompleteNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>): void; - completeNodePoolUpgrade( - request: protos.google.container.v1.ICompleteNodePoolUpgradeRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1.ICompleteNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>): void; - completeNodePoolUpgrade( - request?: protos.google.container.v1.ICompleteNodePoolUpgradeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1.ICompleteNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1.ICompleteNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.container.v1.ICompleteNodePoolUpgradeRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.completeNodePoolUpgrade(request, options, callback); - } -/** - * Rolls back a previously Aborted or Failed NodePool upgrade. - * This makes no changes if the last upgrade successfully completed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to rollback. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Deprecated. The name of the node pool to rollback. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster, node pool id) of the node poll to - * rollback upgrade. - * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {boolean} request.respectPdb - * Option for rollback to ignore the PodDisruptionBudget. - * Default value is false. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.rollback_node_pool_upgrade.js - * region_tag:container_v1_generated_ClusterManager_RollbackNodePoolUpgrade_async - */ - rollbackNodePoolUpgrade( - request?: protos.google.container.v1.IRollbackNodePoolUpgradeRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IRollbackNodePoolUpgradeRequest|undefined, {}|undefined - ]>; - rollbackNodePoolUpgrade( - request: protos.google.container.v1.IRollbackNodePoolUpgradeRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IRollbackNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>): void; - rollbackNodePoolUpgrade( - request: protos.google.container.v1.IRollbackNodePoolUpgradeRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IRollbackNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>): void; - rollbackNodePoolUpgrade( - request?: protos.google.container.v1.IRollbackNodePoolUpgradeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IRollbackNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IRollbackNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IRollbackNodePoolUpgradeRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.rollbackNodePoolUpgrade(request, options, callback); - } -/** - * Sets the NodeManagement options for a node pool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to update. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Deprecated. The name of the node pool to update. - * This field has been deprecated and replaced by the name field. - * @param {google.container.v1.NodeManagement} request.management - * Required. NodeManagement configuration for the node pool. - * @param {string} request.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/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.set_node_pool_management.js - * region_tag:container_v1_generated_ClusterManager_SetNodePoolManagement_async - */ - setNodePoolManagement( - request?: protos.google.container.v1.ISetNodePoolManagementRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolManagementRequest|undefined, {}|undefined - ]>; - setNodePoolManagement( - request: protos.google.container.v1.ISetNodePoolManagementRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolManagementRequest|null|undefined, - {}|null|undefined>): void; - setNodePoolManagement( - request: protos.google.container.v1.ISetNodePoolManagementRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolManagementRequest|null|undefined, - {}|null|undefined>): void; - setNodePoolManagement( - request?: protos.google.container.v1.ISetNodePoolManagementRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolManagementRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolManagementRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolManagementRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setNodePoolManagement(request, options, callback); - } -/** - * Sets labels on a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the name field. - * @param {number[]} request.resourceLabels - * Required. The labels to set for that cluster. - * @param {string} request.labelFingerprint - * 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. - * @param {string} request.name - * The name (project, location, cluster name) of the cluster to set labels. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.set_labels.js - * region_tag:container_v1_generated_ClusterManager_SetLabels_async - */ - setLabels( - request?: protos.google.container.v1.ISetLabelsRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLabelsRequest|undefined, {}|undefined - ]>; - setLabels( - request: protos.google.container.v1.ISetLabelsRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLabelsRequest|null|undefined, - {}|null|undefined>): void; - setLabels( - request: protos.google.container.v1.ISetLabelsRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLabelsRequest|null|undefined, - {}|null|undefined>): void; - setLabels( - request?: protos.google.container.v1.ISetLabelsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLabelsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLabelsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLabelsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setLabels(request, options, callback); - } -/** - * Enables or disables the ABAC authorization mechanism on a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to update. - * This field has been deprecated and replaced by the name field. - * @param {boolean} request.enabled - * Required. Whether ABAC authorization will be enabled in the cluster. - * @param {string} request.name - * The name (project, location, cluster name) of the cluster to set legacy - * abac. Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.set_legacy_abac.js - * region_tag:container_v1_generated_ClusterManager_SetLegacyAbac_async - */ - setLegacyAbac( - request?: protos.google.container.v1.ISetLegacyAbacRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLegacyAbacRequest|undefined, {}|undefined - ]>; - setLegacyAbac( - request: protos.google.container.v1.ISetLegacyAbacRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLegacyAbacRequest|null|undefined, - {}|null|undefined>): void; - setLegacyAbac( - request: protos.google.container.v1.ISetLegacyAbacRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLegacyAbacRequest|null|undefined, - {}|null|undefined>): void; - setLegacyAbac( - request?: protos.google.container.v1.ISetLegacyAbacRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLegacyAbacRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLegacyAbacRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetLegacyAbacRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setLegacyAbac(request, options, callback); - } -/** - * Starts master IP rotation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster name) of the cluster to start IP - * rotation. Specified in the format `projects/* /locations/* /clusters/*`. - * @param {boolean} request.rotateCredentials - * Whether to rotate credentials during IP rotation. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.start_i_p_rotation.js - * region_tag:container_v1_generated_ClusterManager_StartIPRotation_async - */ - startIPRotation( - request?: protos.google.container.v1.IStartIPRotationRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IStartIPRotationRequest|undefined, {}|undefined - ]>; - startIPRotation( - request: protos.google.container.v1.IStartIPRotationRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IStartIPRotationRequest|null|undefined, - {}|null|undefined>): void; - startIPRotation( - request: protos.google.container.v1.IStartIPRotationRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IStartIPRotationRequest|null|undefined, - {}|null|undefined>): void; - startIPRotation( - request?: protos.google.container.v1.IStartIPRotationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IStartIPRotationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.IStartIPRotationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.IStartIPRotationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.startIpRotation(request, options, callback); - } -/** - * Completes master IP rotation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster name) of the cluster to complete IP - * rotation. Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.complete_i_p_rotation.js - * region_tag:container_v1_generated_ClusterManager_CompleteIPRotation_async - */ - completeIPRotation( - request?: protos.google.container.v1.ICompleteIPRotationRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ICompleteIPRotationRequest|undefined, {}|undefined - ]>; - completeIPRotation( - request: protos.google.container.v1.ICompleteIPRotationRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ICompleteIPRotationRequest|null|undefined, - {}|null|undefined>): void; - completeIPRotation( - request: protos.google.container.v1.ICompleteIPRotationRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ICompleteIPRotationRequest|null|undefined, - {}|null|undefined>): void; - completeIPRotation( - request?: protos.google.container.v1.ICompleteIPRotationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ICompleteIPRotationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ICompleteIPRotationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ICompleteIPRotationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.completeIpRotation(request, options, callback); - } -/** - * Sets the size for a specific node pool. The new size will be used for all - * replicas, including future replicas created by modifying - * {@link google.container.v1.NodePool.locations|NodePool.locations}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster to update. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Deprecated. The name of the node pool to update. - * This field has been deprecated and replaced by the name field. - * @param {number} request.nodeCount - * Required. The desired node count for the pool. - * @param {string} request.name - * The name (project, location, cluster, node pool id) of the node pool to set - * size. - * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.set_node_pool_size.js - * region_tag:container_v1_generated_ClusterManager_SetNodePoolSize_async - */ - setNodePoolSize( - request?: protos.google.container.v1.ISetNodePoolSizeRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolSizeRequest|undefined, {}|undefined - ]>; - setNodePoolSize( - request: protos.google.container.v1.ISetNodePoolSizeRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolSizeRequest|null|undefined, - {}|null|undefined>): void; - setNodePoolSize( - request: protos.google.container.v1.ISetNodePoolSizeRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolSizeRequest|null|undefined, - {}|null|undefined>): void; - setNodePoolSize( - request?: protos.google.container.v1.ISetNodePoolSizeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolSizeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolSizeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNodePoolSizeRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setNodePoolSize(request, options, callback); - } -/** - * Enables or disables Network Policy for a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the name field. - * @param {google.container.v1.NetworkPolicy} request.networkPolicy - * Required. Configuration options for the NetworkPolicy feature. - * @param {string} request.name - * The name (project, location, cluster name) of the cluster to set networking - * policy. Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.set_network_policy.js - * region_tag:container_v1_generated_ClusterManager_SetNetworkPolicy_async - */ - setNetworkPolicy( - request?: protos.google.container.v1.ISetNetworkPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNetworkPolicyRequest|undefined, {}|undefined - ]>; - setNetworkPolicy( - request: protos.google.container.v1.ISetNetworkPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNetworkPolicyRequest|null|undefined, - {}|null|undefined>): void; - setNetworkPolicy( - request: protos.google.container.v1.ISetNetworkPolicyRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNetworkPolicyRequest|null|undefined, - {}|null|undefined>): void; - setNetworkPolicy( - request?: protos.google.container.v1.ISetNetworkPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNetworkPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNetworkPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetNetworkPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setNetworkPolicy(request, options, callback); - } -/** - * Sets the maintenance policy for a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * @param {string} request.zone - * Required. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. - * @param {string} request.clusterId - * Required. The name of the cluster to update. - * @param {google.container.v1.MaintenancePolicy} request.maintenancePolicy - * Required. The maintenance policy to be set for the cluster. An empty field - * clears the existing maintenance policy. - * @param {string} request.name - * The name (project, location, cluster name) of the cluster to set - * maintenance policy. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.set_maintenance_policy.js - * region_tag:container_v1_generated_ClusterManager_SetMaintenancePolicy_async - */ - setMaintenancePolicy( - request?: protos.google.container.v1.ISetMaintenancePolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMaintenancePolicyRequest|undefined, {}|undefined - ]>; - setMaintenancePolicy( - request: protos.google.container.v1.ISetMaintenancePolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMaintenancePolicyRequest|null|undefined, - {}|null|undefined>): void; - setMaintenancePolicy( - request: protos.google.container.v1.ISetMaintenancePolicyRequest, - callback: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMaintenancePolicyRequest|null|undefined, - {}|null|undefined>): void; - setMaintenancePolicy( - request?: protos.google.container.v1.ISetMaintenancePolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMaintenancePolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMaintenancePolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.IOperation, - protos.google.container.v1.ISetMaintenancePolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setMaintenancePolicy(request, options, callback); - } -/** - * Checks the cluster compatibility with Autopilot mode, and returns a list of - * compatibility issues. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to retrieve. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1.CheckAutopilotCompatibilityResponse | CheckAutopilotCompatibilityResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.check_autopilot_compatibility.js - * region_tag:container_v1_generated_ClusterManager_CheckAutopilotCompatibility_async - */ - checkAutopilotCompatibility( - request?: protos.google.container.v1.ICheckAutopilotCompatibilityRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.ICheckAutopilotCompatibilityResponse, - protos.google.container.v1.ICheckAutopilotCompatibilityRequest|undefined, {}|undefined - ]>; - checkAutopilotCompatibility( - request: protos.google.container.v1.ICheckAutopilotCompatibilityRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1.ICheckAutopilotCompatibilityResponse, - protos.google.container.v1.ICheckAutopilotCompatibilityRequest|null|undefined, - {}|null|undefined>): void; - checkAutopilotCompatibility( - request: protos.google.container.v1.ICheckAutopilotCompatibilityRequest, - callback: Callback< - protos.google.container.v1.ICheckAutopilotCompatibilityResponse, - protos.google.container.v1.ICheckAutopilotCompatibilityRequest|null|undefined, - {}|null|undefined>): void; - checkAutopilotCompatibility( - request?: protos.google.container.v1.ICheckAutopilotCompatibilityRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1.ICheckAutopilotCompatibilityResponse, - protos.google.container.v1.ICheckAutopilotCompatibilityRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1.ICheckAutopilotCompatibilityResponse, - protos.google.container.v1.ICheckAutopilotCompatibilityRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1.ICheckAutopilotCompatibilityResponse, - protos.google.container.v1.ICheckAutopilotCompatibilityRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.checkAutopilotCompatibility(request, options, callback); - } - - /** - * Lists subnetworks that are usable for creating clusters in a project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The parent project where subnetworks are usable. - * Specified in the format `projects/*`. - * @param {string} request.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. - * @param {number} request.pageSize - * 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) - * @param {string} request.pageToken - * Specifies a page token to use. Set this to the nextPageToken returned by - * previous list requests to get the next page of results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link google.container.v1.UsableSubnetwork | UsableSubnetwork}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listUsableSubnetworksAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listUsableSubnetworks( - request?: protos.google.container.v1.IListUsableSubnetworksRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1.IUsableSubnetwork[], - protos.google.container.v1.IListUsableSubnetworksRequest|null, - protos.google.container.v1.IListUsableSubnetworksResponse - ]>; - listUsableSubnetworks( - request: protos.google.container.v1.IListUsableSubnetworksRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.container.v1.IListUsableSubnetworksRequest, - protos.google.container.v1.IListUsableSubnetworksResponse|null|undefined, - protos.google.container.v1.IUsableSubnetwork>): void; - listUsableSubnetworks( - request: protos.google.container.v1.IListUsableSubnetworksRequest, - callback: PaginationCallback< - protos.google.container.v1.IListUsableSubnetworksRequest, - protos.google.container.v1.IListUsableSubnetworksResponse|null|undefined, - protos.google.container.v1.IUsableSubnetwork>): void; - listUsableSubnetworks( - request?: protos.google.container.v1.IListUsableSubnetworksRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.container.v1.IListUsableSubnetworksRequest, - protos.google.container.v1.IListUsableSubnetworksResponse|null|undefined, - protos.google.container.v1.IUsableSubnetwork>, - callback?: PaginationCallback< - protos.google.container.v1.IListUsableSubnetworksRequest, - protos.google.container.v1.IListUsableSubnetworksResponse|null|undefined, - protos.google.container.v1.IUsableSubnetwork>): - Promise<[ - protos.google.container.v1.IUsableSubnetwork[], - protos.google.container.v1.IListUsableSubnetworksRequest|null, - protos.google.container.v1.IListUsableSubnetworksResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listUsableSubnetworks(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The parent project where subnetworks are usable. - * Specified in the format `projects/*`. - * @param {string} request.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. - * @param {number} request.pageSize - * 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) - * @param {string} request.pageToken - * Specifies a page token to use. Set this to the nextPageToken returned by - * previous list requests to get the next page of results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link google.container.v1.UsableSubnetwork | UsableSubnetwork} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listUsableSubnetworksAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listUsableSubnetworksStream( - request?: protos.google.container.v1.IListUsableSubnetworksRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listUsableSubnetworks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listUsableSubnetworks.createStream( - this.innerApiCalls.listUsableSubnetworks as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listUsableSubnetworks`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The parent project where subnetworks are usable. - * Specified in the format `projects/*`. - * @param {string} request.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. - * @param {number} request.pageSize - * 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) - * @param {string} request.pageToken - * Specifies a page token to use. Set this to the nextPageToken returned by - * previous list requests to get the next page of results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * {@link google.container.v1.UsableSubnetwork | UsableSubnetwork}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1/cluster_manager.list_usable_subnetworks.js - * region_tag:container_v1_generated_ClusterManager_ListUsableSubnetworks_async - */ - listUsableSubnetworksAsync( - request?: protos.google.container.v1.IListUsableSubnetworksRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listUsableSubnetworks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listUsableSubnetworks.asyncIterate( - this.innerApiCalls['listUsableSubnetworks'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.clusterManagerStub && !this._terminated) { - return this.clusterManagerStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-container/v1/src/v1/cluster_manager_client_config.json b/owl-bot-staging/google-container/v1/src/v1/cluster_manager_client_config.json deleted file mode 100644 index 33fb266b6bd..00000000000 --- a/owl-bot-staging/google-container/v1/src/v1/cluster_manager_client_config.json +++ /dev/null @@ -1,192 +0,0 @@ -{ - "interfaces": { - "google.container.v1.ClusterManager": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListClusters": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetCluster": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateCluster": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateCluster": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateNodePool": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetNodePoolAutoscaling": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetLoggingService": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetMonitoringService": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetAddonsConfig": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetLocations": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateMaster": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetMasterAuth": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteCluster": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListOperations": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetOperation": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CancelOperation": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetServerConfig": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetJSONWebKeys": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListNodePools": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetNodePool": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateNodePool": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteNodePool": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CompleteNodePoolUpgrade": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RollbackNodePoolUpgrade": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetNodePoolManagement": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetLabels": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetLegacyAbac": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "StartIPRotation": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CompleteIPRotation": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetNodePoolSize": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetNetworkPolicy": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetMaintenancePolicy": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListUsableSubnetworks": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CheckAutopilotCompatibility": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-container/v1/src/v1/cluster_manager_proto_list.json b/owl-bot-staging/google-container/v1/src/v1/cluster_manager_proto_list.json deleted file mode 100644 index aa69748e51b..00000000000 --- a/owl-bot-staging/google-container/v1/src/v1/cluster_manager_proto_list.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - "../../protos/google/container/v1/cluster_service.proto" -] diff --git a/owl-bot-staging/google-container/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-container/v1/src/v1/gapic_metadata.json deleted file mode 100644 index c08b06ded09..00000000000 --- a/owl-bot-staging/google-container/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,367 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.container.v1", - "libraryPackage": "@google-cloud/container", - "services": { - "ClusterManager": { - "clients": { - "grpc": { - "libraryClient": "ClusterManagerClient", - "rpcs": { - "ListClusters": { - "methods": [ - "listClusters" - ] - }, - "GetCluster": { - "methods": [ - "getCluster" - ] - }, - "CreateCluster": { - "methods": [ - "createCluster" - ] - }, - "UpdateCluster": { - "methods": [ - "updateCluster" - ] - }, - "UpdateNodePool": { - "methods": [ - "updateNodePool" - ] - }, - "SetNodePoolAutoscaling": { - "methods": [ - "setNodePoolAutoscaling" - ] - }, - "SetLoggingService": { - "methods": [ - "setLoggingService" - ] - }, - "SetMonitoringService": { - "methods": [ - "setMonitoringService" - ] - }, - "SetAddonsConfig": { - "methods": [ - "setAddonsConfig" - ] - }, - "SetLocations": { - "methods": [ - "setLocations" - ] - }, - "UpdateMaster": { - "methods": [ - "updateMaster" - ] - }, - "SetMasterAuth": { - "methods": [ - "setMasterAuth" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "ListOperations": { - "methods": [ - "listOperations" - ] - }, - "GetOperation": { - "methods": [ - "getOperation" - ] - }, - "CancelOperation": { - "methods": [ - "cancelOperation" - ] - }, - "GetServerConfig": { - "methods": [ - "getServerConfig" - ] - }, - "GetJSONWebKeys": { - "methods": [ - "getJSONWebKeys" - ] - }, - "ListNodePools": { - "methods": [ - "listNodePools" - ] - }, - "GetNodePool": { - "methods": [ - "getNodePool" - ] - }, - "CreateNodePool": { - "methods": [ - "createNodePool" - ] - }, - "DeleteNodePool": { - "methods": [ - "deleteNodePool" - ] - }, - "CompleteNodePoolUpgrade": { - "methods": [ - "completeNodePoolUpgrade" - ] - }, - "RollbackNodePoolUpgrade": { - "methods": [ - "rollbackNodePoolUpgrade" - ] - }, - "SetNodePoolManagement": { - "methods": [ - "setNodePoolManagement" - ] - }, - "SetLabels": { - "methods": [ - "setLabels" - ] - }, - "SetLegacyAbac": { - "methods": [ - "setLegacyAbac" - ] - }, - "StartIPRotation": { - "methods": [ - "startIPRotation" - ] - }, - "CompleteIPRotation": { - "methods": [ - "completeIPRotation" - ] - }, - "SetNodePoolSize": { - "methods": [ - "setNodePoolSize" - ] - }, - "SetNetworkPolicy": { - "methods": [ - "setNetworkPolicy" - ] - }, - "SetMaintenancePolicy": { - "methods": [ - "setMaintenancePolicy" - ] - }, - "CheckAutopilotCompatibility": { - "methods": [ - "checkAutopilotCompatibility" - ] - }, - "ListUsableSubnetworks": { - "methods": [ - "listUsableSubnetworks", - "listUsableSubnetworksStream", - "listUsableSubnetworksAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "ClusterManagerClient", - "rpcs": { - "ListClusters": { - "methods": [ - "listClusters" - ] - }, - "GetCluster": { - "methods": [ - "getCluster" - ] - }, - "CreateCluster": { - "methods": [ - "createCluster" - ] - }, - "UpdateCluster": { - "methods": [ - "updateCluster" - ] - }, - "UpdateNodePool": { - "methods": [ - "updateNodePool" - ] - }, - "SetNodePoolAutoscaling": { - "methods": [ - "setNodePoolAutoscaling" - ] - }, - "SetLoggingService": { - "methods": [ - "setLoggingService" - ] - }, - "SetMonitoringService": { - "methods": [ - "setMonitoringService" - ] - }, - "SetAddonsConfig": { - "methods": [ - "setAddonsConfig" - ] - }, - "SetLocations": { - "methods": [ - "setLocations" - ] - }, - "UpdateMaster": { - "methods": [ - "updateMaster" - ] - }, - "SetMasterAuth": { - "methods": [ - "setMasterAuth" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "ListOperations": { - "methods": [ - "listOperations" - ] - }, - "GetOperation": { - "methods": [ - "getOperation" - ] - }, - "CancelOperation": { - "methods": [ - "cancelOperation" - ] - }, - "GetServerConfig": { - "methods": [ - "getServerConfig" - ] - }, - "GetJSONWebKeys": { - "methods": [ - "getJSONWebKeys" - ] - }, - "ListNodePools": { - "methods": [ - "listNodePools" - ] - }, - "GetNodePool": { - "methods": [ - "getNodePool" - ] - }, - "CreateNodePool": { - "methods": [ - "createNodePool" - ] - }, - "DeleteNodePool": { - "methods": [ - "deleteNodePool" - ] - }, - "CompleteNodePoolUpgrade": { - "methods": [ - "completeNodePoolUpgrade" - ] - }, - "RollbackNodePoolUpgrade": { - "methods": [ - "rollbackNodePoolUpgrade" - ] - }, - "SetNodePoolManagement": { - "methods": [ - "setNodePoolManagement" - ] - }, - "SetLabels": { - "methods": [ - "setLabels" - ] - }, - "SetLegacyAbac": { - "methods": [ - "setLegacyAbac" - ] - }, - "StartIPRotation": { - "methods": [ - "startIPRotation" - ] - }, - "CompleteIPRotation": { - "methods": [ - "completeIPRotation" - ] - }, - "SetNodePoolSize": { - "methods": [ - "setNodePoolSize" - ] - }, - "SetNetworkPolicy": { - "methods": [ - "setNetworkPolicy" - ] - }, - "SetMaintenancePolicy": { - "methods": [ - "setMaintenancePolicy" - ] - }, - "CheckAutopilotCompatibility": { - "methods": [ - "checkAutopilotCompatibility" - ] - }, - "ListUsableSubnetworks": { - "methods": [ - "listUsableSubnetworks", - "listUsableSubnetworksStream", - "listUsableSubnetworksAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-container/v1/src/v1/index.ts b/owl-bot-staging/google-container/v1/src/v1/index.ts deleted file mode 100644 index b1b39233034..00000000000 --- a/owl-bot-staging/google-container/v1/src/v1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {ClusterManagerClient} from './cluster_manager_client'; diff --git a/owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 1101d781caa..00000000000 --- a/owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const container = require('@google-cloud/container'); - -function main() { - const clusterManagerClient = new container.ClusterManagerClient(); -} - -main(); diff --git a/owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 6685b8649e6..00000000000 --- a/owl-bot-staging/google-container/v1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {ClusterManagerClient} from '@google-cloud/container'; - -// check that the client class type name can be used -function doStuffWithClusterManagerClient(client: ClusterManagerClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const clusterManagerClient = new ClusterManagerClient(); - doStuffWithClusterManagerClient(clusterManagerClient); -} - -main(); diff --git a/owl-bot-staging/google-container/v1/system-test/install.ts b/owl-bot-staging/google-container/v1/system-test/install.ts deleted file mode 100644 index c8f81b25a86..00000000000 --- a/owl-bot-staging/google-container/v1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/google-container/v1/test/gapic_cluster_manager_v1.ts b/owl-bot-staging/google-container/v1/test/gapic_cluster_manager_v1.ts deleted file mode 100644 index 9632e377d3a..00000000000 --- a/owl-bot-staging/google-container/v1/test/gapic_cluster_manager_v1.ts +++ /dev/null @@ -1,5130 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as clustermanagerModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.ClusterManagerClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = clustermanagerModule.v1.ClusterManagerClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = clustermanagerModule.v1.ClusterManagerClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = clustermanagerModule.v1.ClusterManagerClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new clustermanagerModule.v1.ClusterManagerClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.clusterManagerStub, undefined); - await client.initialize(); - assert(client.clusterManagerStub); - }); - - it('has close method for the initialized client', done => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.clusterManagerStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.clusterManagerStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - }); - - describe('listClusters', () => { - it('invokes listClusters without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.ListClustersResponse() - ); - client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); - const [response] = await client.listClusters(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClusters without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.ListClustersResponse() - ); - client.innerApiCalls.listClusters = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listClusters( - request, - (err?: Error|null, result?: protos.google.container.v1.IListClustersResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClusters with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listClusters = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listClusters(request), expectedError); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClusters with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.ListClustersRequest', ['zone']); - request.zone = defaultValue3; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.listClusters(request), expectedError); - }); - }); - - describe('getCluster', () => { - it('invokes getCluster without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Cluster() - ); - client.innerApiCalls.getCluster = stubSimpleCall(expectedResponse); - const [response] = await client.getCluster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Cluster() - ); - client.innerApiCalls.getCluster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCluster( - request, - (err?: Error|null, result?: protos.google.container.v1.ICluster|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCluster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.GetClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getCluster(request), expectedError); - }); - }); - - describe('createCluster', () => { - it('invokes createCluster without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.createCluster = stubSimpleCall(expectedResponse); - const [response] = await client.createCluster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.createCluster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCluster( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCluster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CreateClusterRequest', ['zone']); - request.zone = defaultValue3; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createCluster(request), expectedError); - }); - }); - - describe('updateCluster', () => { - it('invokes updateCluster without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.UpdateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.updateCluster = stubSimpleCall(expectedResponse); - const [response] = await client.updateCluster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.UpdateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.updateCluster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateCluster( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.UpdateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCluster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.UpdateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.UpdateClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateCluster(request), expectedError); - }); - }); - - describe('updateNodePool', () => { - it('invokes updateNodePool without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.UpdateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.updateNodePool = stubSimpleCall(expectedResponse); - const [response] = await client.updateNodePool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateNodePool without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.UpdateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.updateNodePool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateNodePool( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateNodePool with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.UpdateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateNodePool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateNodePool(request), expectedError); - const actualRequest = (client.innerApiCalls.updateNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateNodePool with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.UpdateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.UpdateNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateNodePool(request), expectedError); - }); - }); - - describe('setNodePoolAutoscaling', () => { - it('invokes setNodePoolAutoscaling without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNodePoolAutoscalingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCall(expectedResponse); - const [response] = await client.setNodePoolAutoscaling(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolAutoscaling without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNodePoolAutoscalingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setNodePoolAutoscaling( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolAutoscaling with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNodePoolAutoscalingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setNodePoolAutoscaling(request), expectedError); - const actualRequest = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolAutoscaling with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNodePoolAutoscalingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.SetNodePoolAutoscalingRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setNodePoolAutoscaling(request), expectedError); - }); - }); - - describe('setLoggingService', () => { - it('invokes setLoggingService without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLoggingServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setLoggingService = stubSimpleCall(expectedResponse); - const [response] = await client.setLoggingService(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLoggingService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLoggingService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLoggingService without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLoggingServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setLoggingService = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setLoggingService( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLoggingService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLoggingService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLoggingService with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLoggingServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setLoggingService = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setLoggingService(request), expectedError); - const actualRequest = (client.innerApiCalls.setLoggingService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLoggingService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLoggingService with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLoggingServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLoggingServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setLoggingService(request), expectedError); - }); - }); - - describe('setMonitoringService', () => { - it('invokes setMonitoringService without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetMonitoringServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setMonitoringService = stubSimpleCall(expectedResponse); - const [response] = await client.setMonitoringService(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setMonitoringService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMonitoringService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMonitoringService without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetMonitoringServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setMonitoringService = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setMonitoringService( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setMonitoringService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMonitoringService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMonitoringService with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetMonitoringServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setMonitoringService = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setMonitoringService(request), expectedError); - const actualRequest = (client.innerApiCalls.setMonitoringService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMonitoringService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMonitoringService with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetMonitoringServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetMonitoringServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setMonitoringService(request), expectedError); - }); - }); - - describe('setAddonsConfig', () => { - it('invokes setAddonsConfig without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetAddonsConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setAddonsConfig = stubSimpleCall(expectedResponse); - const [response] = await client.setAddonsConfig(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setAddonsConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setAddonsConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setAddonsConfig without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetAddonsConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setAddonsConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setAddonsConfig( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setAddonsConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setAddonsConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setAddonsConfig with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetAddonsConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setAddonsConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setAddonsConfig(request), expectedError); - const actualRequest = (client.innerApiCalls.setAddonsConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setAddonsConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setAddonsConfig with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetAddonsConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetAddonsConfigRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setAddonsConfig(request), expectedError); - }); - }); - - describe('setLocations', () => { - it('invokes setLocations without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLocationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setLocations = stubSimpleCall(expectedResponse); - const [response] = await client.setLocations(request); - assert(stub.calledOnce); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLocations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLocations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLocations without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLocationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setLocations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setLocations( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert(stub.calledOnce); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLocations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLocations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLocations with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLocationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setLocations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setLocations(request), expectedError); - assert(stub.calledOnce); - const actualRequest = (client.innerApiCalls.setLocations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLocations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLocations with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLocationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLocationsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setLocations(request), expectedError); - assert(stub.calledOnce); - }); - }); - - describe('updateMaster', () => { - it('invokes updateMaster without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.UpdateMasterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.updateMaster = stubSimpleCall(expectedResponse); - const [response] = await client.updateMaster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateMaster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateMaster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateMaster without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.UpdateMasterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.updateMaster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateMaster( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateMaster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateMaster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateMaster with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.UpdateMasterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateMaster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateMaster(request), expectedError); - const actualRequest = (client.innerApiCalls.updateMaster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateMaster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateMaster with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.UpdateMasterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.UpdateMasterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateMaster(request), expectedError); - }); - }); - - describe('setMasterAuth', () => { - it('invokes setMasterAuth without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetMasterAuthRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setMasterAuth = stubSimpleCall(expectedResponse); - const [response] = await client.setMasterAuth(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setMasterAuth as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMasterAuth as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMasterAuth without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetMasterAuthRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setMasterAuth = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setMasterAuth( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setMasterAuth as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMasterAuth as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMasterAuth with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetMasterAuthRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setMasterAuth = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setMasterAuth(request), expectedError); - const actualRequest = (client.innerApiCalls.setMasterAuth as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMasterAuth as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMasterAuth with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetMasterAuthRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetMasterAuthRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setMasterAuth(request), expectedError); - }); - }); - - describe('deleteCluster', () => { - it('invokes deleteCluster without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.deleteCluster = stubSimpleCall(expectedResponse); - const [response] = await client.deleteCluster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.deleteCluster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteCluster( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCluster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.DeleteClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteCluster(request), expectedError); - }); - }); - - describe('listOperations', () => { - it('invokes listOperations without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.ListOperationsResponse() - ); - client.innerApiCalls.listOperations = stubSimpleCall(expectedResponse); - const [response] = await client.listOperations(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listOperations without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.ListOperationsResponse() - ); - client.innerApiCalls.listOperations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listOperations( - request, - (err?: Error|null, result?: protos.google.container.v1.IListOperationsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listOperations with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listOperations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listOperations(request), expectedError); - const actualRequest = (client.innerApiCalls.listOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listOperations with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.ListOperationsRequest', ['zone']); - request.zone = defaultValue3; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.listOperations(request), expectedError); - }); - }); - - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.getOperation = stubSimpleCall(expectedResponse); - const [response] = await client.getOperation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getOperation without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.getOperation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getOperation( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getOperation with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getOperation(request), expectedError); - const actualRequest = (client.innerApiCalls.getOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getOperation with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.GetOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getOperation(request), expectedError); - }); - }); - - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CancelOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.cancelOperation = stubSimpleCall(expectedResponse); - const [response] = await client.cancelOperation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelOperation without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CancelOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.cancelOperation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelOperation( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelOperation with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CancelOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelOperation(request), expectedError); - const actualRequest = (client.innerApiCalls.cancelOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelOperation with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CancelOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.CancelOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.cancelOperation(request), expectedError); - }); - }); - - describe('getServerConfig', () => { - it('invokes getServerConfig without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetServerConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.ServerConfig() - ); - client.innerApiCalls.getServerConfig = stubSimpleCall(expectedResponse); - const [response] = await client.getServerConfig(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getServerConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getServerConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getServerConfig without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetServerConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.ServerConfig() - ); - client.innerApiCalls.getServerConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getServerConfig( - request, - (err?: Error|null, result?: protos.google.container.v1.IServerConfig|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getServerConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getServerConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getServerConfig with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetServerConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getServerConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getServerConfig(request), expectedError); - const actualRequest = (client.innerApiCalls.getServerConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getServerConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getServerConfig with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetServerConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetServerConfigRequest', ['zone']); - request.zone = defaultValue3; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getServerConfig(request), expectedError); - }); - }); - - describe('getJSONWebKeys', () => { - it('invokes getJSONWebKeys without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetJSONWebKeysRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetJSONWebKeysRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.GetJSONWebKeysResponse() - ); - client.innerApiCalls.getJsonWebKeys = stubSimpleCall(expectedResponse); - const [response] = await client.getJSONWebKeys(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getJsonWebKeys as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJsonWebKeys as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJSONWebKeys without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetJSONWebKeysRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetJSONWebKeysRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.GetJSONWebKeysResponse() - ); - client.innerApiCalls.getJsonWebKeys = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getJSONWebKeys( - request, - (err?: Error|null, result?: protos.google.container.v1.IGetJSONWebKeysResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getJsonWebKeys as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJsonWebKeys as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJSONWebKeys with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetJSONWebKeysRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetJSONWebKeysRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getJsonWebKeys = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getJSONWebKeys(request), expectedError); - const actualRequest = (client.innerApiCalls.getJsonWebKeys as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJsonWebKeys as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJSONWebKeys with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetJSONWebKeysRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetJSONWebKeysRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getJSONWebKeys(request), expectedError); - }); - }); - - describe('listNodePools', () => { - it('invokes listNodePools without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListNodePoolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.ListNodePoolsResponse() - ); - client.innerApiCalls.listNodePools = stubSimpleCall(expectedResponse); - const [response] = await client.listNodePools(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listNodePools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNodePools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNodePools without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListNodePoolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.ListNodePoolsResponse() - ); - client.innerApiCalls.listNodePools = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listNodePools( - request, - (err?: Error|null, result?: protos.google.container.v1.IListNodePoolsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listNodePools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNodePools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNodePools with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListNodePoolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listNodePools = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listNodePools(request), expectedError); - const actualRequest = (client.innerApiCalls.listNodePools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNodePools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNodePools with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListNodePoolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.ListNodePoolsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.listNodePools(request), expectedError); - }); - }); - - describe('getNodePool', () => { - it('invokes getNodePool without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.NodePool() - ); - client.innerApiCalls.getNodePool = stubSimpleCall(expectedResponse); - const [response] = await client.getNodePool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNodePool without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.NodePool() - ); - client.innerApiCalls.getNodePool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getNodePool( - request, - (err?: Error|null, result?: protos.google.container.v1.INodePool|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNodePool with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getNodePool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getNodePool(request), expectedError); - const actualRequest = (client.innerApiCalls.getNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNodePool with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.GetNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.GetNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getNodePool(request), expectedError); - }); - }); - - describe('createNodePool', () => { - it('invokes createNodePool without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CreateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.createNodePool = stubSimpleCall(expectedResponse); - const [response] = await client.createNodePool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createNodePool without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CreateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.createNodePool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createNodePool( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createNodePool with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CreateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createNodePool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createNodePool(request), expectedError); - const actualRequest = (client.innerApiCalls.createNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createNodePool with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CreateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.CreateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createNodePool(request), expectedError); - }); - }); - - describe('deleteNodePool', () => { - it('invokes deleteNodePool without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.DeleteNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.deleteNodePool = stubSimpleCall(expectedResponse); - const [response] = await client.deleteNodePool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteNodePool without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.DeleteNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.deleteNodePool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteNodePool( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteNodePool with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.DeleteNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteNodePool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteNodePool(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteNodePool with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.DeleteNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.DeleteNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteNodePool(request), expectedError); - }); - }); - - describe('completeNodePoolUpgrade', () => { - it('invokes completeNodePoolUpgrade without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CompleteNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CompleteNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.completeNodePoolUpgrade = stubSimpleCall(expectedResponse); - const [response] = await client.completeNodePoolUpgrade(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes completeNodePoolUpgrade without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CompleteNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CompleteNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.completeNodePoolUpgrade = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.completeNodePoolUpgrade( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes completeNodePoolUpgrade with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CompleteNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CompleteNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.completeNodePoolUpgrade = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.completeNodePoolUpgrade(request), expectedError); - const actualRequest = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes completeNodePoolUpgrade with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CompleteNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CompleteNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.completeNodePoolUpgrade(request), expectedError); - }); - }); - - describe('rollbackNodePoolUpgrade', () => { - it('invokes rollbackNodePoolUpgrade without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.RollbackNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCall(expectedResponse); - const [response] = await client.rollbackNodePoolUpgrade(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollbackNodePoolUpgrade without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.RollbackNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.rollbackNodePoolUpgrade( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollbackNodePoolUpgrade with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.RollbackNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.rollbackNodePoolUpgrade(request), expectedError); - const actualRequest = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollbackNodePoolUpgrade with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.RollbackNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.rollbackNodePoolUpgrade(request), expectedError); - }); - }); - - describe('setNodePoolManagement', () => { - it('invokes setNodePoolManagement without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNodePoolManagementRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setNodePoolManagement = stubSimpleCall(expectedResponse); - const [response] = await client.setNodePoolManagement(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNodePoolManagement as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolManagement as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolManagement without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNodePoolManagementRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setNodePoolManagement = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setNodePoolManagement( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNodePoolManagement as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolManagement as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolManagement with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNodePoolManagementRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setNodePoolManagement = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setNodePoolManagement(request), expectedError); - const actualRequest = (client.innerApiCalls.setNodePoolManagement as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolManagement as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolManagement with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNodePoolManagementRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.SetNodePoolManagementRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setNodePoolManagement(request), expectedError); - }); - }); - - describe('setLabels', () => { - it('invokes setLabels without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLabelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); - const [response] = await client.setLabels(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLabels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLabels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLabels without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLabelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setLabels = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setLabels( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLabels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLabels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLabels with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLabelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setLabels = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setLabels(request), expectedError); - const actualRequest = (client.innerApiCalls.setLabels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLabels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLabels with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLabelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLabelsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setLabels(request), expectedError); - }); - }); - - describe('setLegacyAbac', () => { - it('invokes setLegacyAbac without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLegacyAbacRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setLegacyAbac = stubSimpleCall(expectedResponse); - const [response] = await client.setLegacyAbac(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLegacyAbac as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLegacyAbac as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLegacyAbac without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLegacyAbacRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setLegacyAbac = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setLegacyAbac( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLegacyAbac as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLegacyAbac as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLegacyAbac with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLegacyAbacRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setLegacyAbac = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setLegacyAbac(request), expectedError); - const actualRequest = (client.innerApiCalls.setLegacyAbac as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLegacyAbac as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLegacyAbac with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetLegacyAbacRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetLegacyAbacRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setLegacyAbac(request), expectedError); - }); - }); - - describe('startIPRotation', () => { - it('invokes startIPRotation without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.StartIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.startIpRotation = stubSimpleCall(expectedResponse); - const [response] = await client.startIPRotation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.startIpRotation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.startIpRotation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes startIPRotation without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.StartIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.startIpRotation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.startIPRotation( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.startIpRotation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.startIpRotation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes startIPRotation with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.StartIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.startIpRotation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.startIPRotation(request), expectedError); - const actualRequest = (client.innerApiCalls.startIpRotation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.startIpRotation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes startIPRotation with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.StartIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.StartIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.startIPRotation(request), expectedError); - }); - }); - - describe('completeIPRotation', () => { - it('invokes completeIPRotation without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CompleteIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.completeIpRotation = stubSimpleCall(expectedResponse); - const [response] = await client.completeIPRotation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.completeIpRotation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeIpRotation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes completeIPRotation without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CompleteIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.completeIpRotation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.completeIPRotation( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.completeIpRotation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeIpRotation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes completeIPRotation with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CompleteIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.completeIpRotation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.completeIPRotation(request), expectedError); - const actualRequest = (client.innerApiCalls.completeIpRotation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeIpRotation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes completeIPRotation with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CompleteIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.CompleteIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.completeIPRotation(request), expectedError); - }); - }); - - describe('setNodePoolSize', () => { - it('invokes setNodePoolSize without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNodePoolSizeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setNodePoolSize = stubSimpleCall(expectedResponse); - const [response] = await client.setNodePoolSize(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNodePoolSize as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolSize as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolSize without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNodePoolSizeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setNodePoolSize = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setNodePoolSize( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNodePoolSize as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolSize as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolSize with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNodePoolSizeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setNodePoolSize = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setNodePoolSize(request), expectedError); - const actualRequest = (client.innerApiCalls.setNodePoolSize as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolSize as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolSize with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNodePoolSizeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1.SetNodePoolSizeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setNodePoolSize(request), expectedError); - }); - }); - - describe('setNetworkPolicy', () => { - it('invokes setNetworkPolicy without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNetworkPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setNetworkPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.setNetworkPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNetworkPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNetworkPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNetworkPolicy without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNetworkPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setNetworkPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setNetworkPolicy( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNetworkPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNetworkPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNetworkPolicy with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNetworkPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setNetworkPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setNetworkPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.setNetworkPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNetworkPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNetworkPolicy with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetNetworkPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetNetworkPolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setNetworkPolicy(request), expectedError); - }); - }); - - describe('setMaintenancePolicy', () => { - it('invokes setMaintenancePolicy without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetMaintenancePolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setMaintenancePolicy = stubSimpleCall(expectedResponse); - const [response] = await client.setMaintenancePolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setMaintenancePolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMaintenancePolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMaintenancePolicy without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetMaintenancePolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.Operation() - ); - client.innerApiCalls.setMaintenancePolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setMaintenancePolicy( - request, - (err?: Error|null, result?: protos.google.container.v1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setMaintenancePolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMaintenancePolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMaintenancePolicy with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetMaintenancePolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setMaintenancePolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setMaintenancePolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.setMaintenancePolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMaintenancePolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMaintenancePolicy with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.SetMaintenancePolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1.SetMaintenancePolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setMaintenancePolicy(request), expectedError); - }); - }); - - describe('checkAutopilotCompatibility', () => { - it('invokes checkAutopilotCompatibility without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CheckAutopilotCompatibilityRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CheckAutopilotCompatibilityRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.CheckAutopilotCompatibilityResponse() - ); - client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCall(expectedResponse); - const [response] = await client.checkAutopilotCompatibility(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkAutopilotCompatibility without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CheckAutopilotCompatibilityRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CheckAutopilotCompatibilityRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1.CheckAutopilotCompatibilityResponse() - ); - client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.checkAutopilotCompatibility( - request, - (err?: Error|null, result?: protos.google.container.v1.ICheckAutopilotCompatibilityResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkAutopilotCompatibility with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CheckAutopilotCompatibilityRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CheckAutopilotCompatibilityRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkAutopilotCompatibility(request), expectedError); - const actualRequest = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkAutopilotCompatibility with closed client', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.CheckAutopilotCompatibilityRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.CheckAutopilotCompatibilityRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.checkAutopilotCompatibility(request), expectedError); - }); - }); - - describe('listUsableSubnetworks', () => { - it('invokes listUsableSubnetworks without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), - ]; - client.innerApiCalls.listUsableSubnetworks = stubSimpleCall(expectedResponse); - const [response] = await client.listUsableSubnetworks(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listUsableSubnetworks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUsableSubnetworks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listUsableSubnetworks without error using callback', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), - ]; - client.innerApiCalls.listUsableSubnetworks = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listUsableSubnetworks( - request, - (err?: Error|null, result?: protos.google.container.v1.IUsableSubnetwork[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listUsableSubnetworks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUsableSubnetworks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listUsableSubnetworks with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listUsableSubnetworks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listUsableSubnetworks(request), expectedError); - const actualRequest = (client.innerApiCalls.listUsableSubnetworks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUsableSubnetworks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listUsableSubnetworksStream without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), - ]; - client.descriptors.page.listUsableSubnetworks.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listUsableSubnetworksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.container.v1.UsableSubnetwork[] = []; - stream.on('data', (response: protos.google.container.v1.UsableSubnetwork) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listUsableSubnetworks, request)); - assert( - (client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listUsableSubnetworksStream with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listUsableSubnetworks.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listUsableSubnetworksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.container.v1.UsableSubnetwork[] = []; - stream.on('data', (response: protos.google.container.v1.UsableSubnetwork) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listUsableSubnetworks, request)); - assert( - (client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listUsableSubnetworks without error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1.UsableSubnetwork()), - ]; - client.descriptors.page.listUsableSubnetworks.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.container.v1.IUsableSubnetwork[] = []; - const iterable = client.listUsableSubnetworksAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listUsableSubnetworks with error', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listUsableSubnetworks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listUsableSubnetworksAsync(request); - await assert.rejects(async () => { - const responses: protos.google.container.v1.IUsableSubnetwork[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); -}); diff --git a/owl-bot-staging/google-container/v1/tsconfig.json b/owl-bot-staging/google-container/v1/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-container/v1/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/google-container/v1/webpack.config.js b/owl-bot-staging/google-container/v1/webpack.config.js deleted file mode 100644 index 9032271af9d..00000000000 --- a/owl-bot-staging/google-container/v1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 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. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'ClusterManager', - filename: './cluster-manager.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/owl-bot-staging/google-container/v1beta1/.eslintignore b/owl-bot-staging/google-container/v1beta1/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-container/v1beta1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-container/v1beta1/.eslintrc.json b/owl-bot-staging/google-container/v1beta1/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-container/v1beta1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-container/v1beta1/.gitignore b/owl-bot-staging/google-container/v1beta1/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-container/v1beta1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -/.coverage -/coverage -/.nyc_output -/docs/ -/out/ -/build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/google-container/v1beta1/.jsdoc.js b/owl-bot-staging/google-container/v1beta1/.jsdoc.js deleted file mode 100644 index 6dc18e81193..00000000000 --- a/owl-bot-staging/google-container/v1beta1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2023 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/container', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-container/v1beta1/.mocharc.js b/owl-bot-staging/google-container/v1beta1/.mocharc.js deleted file mode 100644 index 1a38f257db7..00000000000 --- a/owl-bot-staging/google-container/v1beta1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/google-container/v1beta1/.prettierrc.js b/owl-bot-staging/google-container/v1beta1/.prettierrc.js deleted file mode 100644 index 55639e70f9e..00000000000 --- a/owl-bot-staging/google-container/v1beta1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-container/v1beta1/README.md b/owl-bot-staging/google-container/v1beta1/README.md deleted file mode 100644 index f32441d7e6b..00000000000 --- a/owl-bot-staging/google-container/v1beta1/README.md +++ /dev/null @@ -1 +0,0 @@ -Container: Nodejs Client diff --git a/owl-bot-staging/google-container/v1beta1/linkinator.config.json b/owl-bot-staging/google-container/v1beta1/linkinator.config.json deleted file mode 100644 index befd23c8633..00000000000 --- a/owl-bot-staging/google-container/v1beta1/linkinator.config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "recurse": true, - "skip": [ - "https://codecov.io/gh/googleapis/", - "www.googleapis.com", - "img.shields.io", - "https://console.cloud.google.com/cloudshell", - "https://support.google.com" - ], - "silent": true, - "concurrency": 5, - "retry": true, - "retryErrors": true, - "retryErrorsCount": 5, - "retryErrorsJitter": 3000 -} diff --git a/owl-bot-staging/google-container/v1beta1/package.json b/owl-bot-staging/google-container/v1beta1/package.json deleted file mode 100644 index 9795068794e..00000000000 --- a/owl-bot-staging/google-container/v1beta1/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@google-cloud/container", - "version": "0.1.0", - "description": "Container client for Node.js", - "repository": "googleapis/nodejs-container", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google container", - "container", - "cluster manager" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "predocs-test": "npm run docs", - "docs-test": "linkinator docs", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^3.5.7" - }, - "devDependencies": { - "@types/mocha": "^10.0.1", - "@types/node": "^18.11.18", - "@types/sinon": "^10.0.13", - "c8": "^7.12.0", - "gts": "^3.1.1", - "jsdoc": "^4.0.0", - "jsdoc-fresh": "^2.0.1", - "jsdoc-region-tag": "^2.0.1", - "linkinator": "^4.1.2", - "mocha": "^10.2.0", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^15.0.1", - "ts-loader": "^8.4.0", - "typescript": "^4.8.4", - "webpack": "^4.46.0", - "webpack-cli": "^4.10.0" - }, - "engines": { - "node": ">=v12" - } -} diff --git a/owl-bot-staging/google-container/v1beta1/protos/google/container/v1beta1/cluster_service.proto b/owl-bot-staging/google-container/v1beta1/protos/google/container/v1beta1/cluster_service.proto deleted file mode 100644 index d35034ce072..00000000000 --- a/owl-bot-staging/google-container/v1beta1/protos/google/container/v1beta1/cluster_service.proto +++ /dev/null @@ -1,5617 +0,0 @@ -// Copyright 2023 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. - -syntax = "proto3"; - -package google.container.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; -import "google/rpc/code.proto"; -import "google/rpc/status.proto"; -import "google/type/date.proto"; - -option csharp_namespace = "Google.Cloud.Container.V1Beta1"; -option go_package = "cloud.google.com/go/container/apiv1beta1/containerpb;containerpb"; -option java_multiple_files = true; -option java_outer_classname = "ClusterServiceProto"; -option java_package = "com.google.container.v1beta1"; -option php_namespace = "Google\\Cloud\\Container\\V1beta1"; -option ruby_package = "Google::Cloud::Container::V1beta1"; -option (google.api.resource_definition) = { - type: "pubsub.googleapis.com/Topic" - pattern: "projects/{project}/topics/{topic}" -}; - -// Google Kubernetes Engine Cluster Manager v1beta1 -service ClusterManager { - option (google.api.default_host) = "container.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Lists all clusters owned by a project in either the specified zone or all - // zones. - rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/clusters" - additional_bindings { - get: "/v1beta1/projects/{project_id}/zones/{zone}/clusters" - } - }; - option (google.api.method_signature) = "project_id,zone"; - } - - // Gets the details for a specific cluster. - rpc GetCluster(GetClusterRequest) returns (Cluster) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/clusters/*}" - additional_bindings { - get: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - } - - // 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](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). - // - // 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. - rpc CreateCluster(CreateClusterRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/clusters" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster"; - } - - // Updates the settings for a specific cluster. - rpc UpdateCluster(UpdateClusterRequest) returns (Operation) { - option (google.api.http) = { - put: "/v1beta1/{name=projects/*/locations/*/clusters/*}" - body: "*" - additional_bindings { - put: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id,update"; - } - - // Updates the version and/or image type of a specific node pool. - rpc UpdateNodePool(UpdateNodePoolRequest) returns (Operation) { - option (google.api.http) = { - put: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/update" - body: "*" - } - }; - } - - // Sets the autoscaling settings of a specific node pool. - rpc SetNodePoolAutoscaling(SetNodePoolAutoscalingRequest) - returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setAutoscaling" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/autoscaling" - body: "*" - } - }; - } - - // Sets the logging service for a specific cluster. - rpc SetLoggingService(SetLoggingServiceRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setLogging" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/logging" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,logging_service"; - } - - // Sets the monitoring service for a specific cluster. - rpc SetMonitoringService(SetMonitoringServiceRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setMonitoring" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/monitoring" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,monitoring_service"; - } - - // Sets the addons for a specific cluster. - rpc SetAddonsConfig(SetAddonsConfigRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setAddons" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/addons" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,addons_config"; - } - - // Sets the locations for a specific cluster. - // Deprecated. Use - // [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters/update) - // instead. - rpc SetLocations(SetLocationsRequest) returns (Operation) { - option deprecated = true; - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setLocations" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/locations" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,locations"; - } - - // Updates the master for a specific cluster. - rpc UpdateMaster(UpdateMasterRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:updateMaster" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/master" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,master_version"; - } - - // Sets master auth materials. Currently supports changing the admin password - // or a specific cluster, either via password generation or explicitly setting - // the password. - rpc SetMasterAuth(SetMasterAuthRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setMasterAuth" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setMasterAuth" - body: "*" - } - }; - } - - // 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. - rpc DeleteCluster(DeleteClusterRequest) returns (Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/clusters/*}" - additional_bindings { - delete: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - } - - // Lists all operations in a project in the specified zone or all zones. - rpc ListOperations(ListOperationsRequest) returns (ListOperationsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/operations" - additional_bindings { - get: "/v1beta1/projects/{project_id}/zones/{zone}/operations" - } - }; - option (google.api.method_signature) = "project_id,zone"; - } - - // Gets the specified operation. - rpc GetOperation(GetOperationRequest) returns (Operation) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/operations/*}" - additional_bindings { - get: "/v1beta1/projects/{project_id}/zones/{zone}/operations/{operation_id}" - } - }; - option (google.api.method_signature) = "project_id,zone,operation_id"; - } - - // Cancels the specified operation. - rpc CancelOperation(CancelOperationRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/operations/*}:cancel" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/operations/{operation_id}:cancel" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,operation_id"; - } - - // Returns configuration info about the Google Kubernetes Engine service. - rpc GetServerConfig(GetServerConfigRequest) returns (ServerConfig) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*}/serverConfig" - additional_bindings { - get: "/v1beta1/projects/{project_id}/zones/{zone}/serverconfig" - } - }; - option (google.api.method_signature) = "project_id,zone"; - } - - // Gets the public component of the cluster signing keys in - // JSON Web Key format. - // This API is not yet intended for general use, and is not available for all - // clusters. - rpc GetJSONWebKeys(GetJSONWebKeysRequest) returns (GetJSONWebKeysResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/clusters/*}/jwks" - }; - } - - // Lists the node pools for a cluster. - rpc ListNodePools(ListNodePoolsRequest) returns (ListNodePoolsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/clusters/*}/nodePools" - additional_bindings { - get: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - } - - // Retrieves the requested node pool. - rpc GetNodePool(GetNodePoolRequest) returns (NodePool) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}" - additional_bindings { - get: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,node_pool_id"; - } - - // Creates a node pool for a cluster. - rpc CreateNodePool(CreateNodePoolRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/clusters/*}/nodePools" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,node_pool"; - } - - // Deletes a node pool from a cluster. - rpc DeleteNodePool(DeleteNodePoolRequest) returns (Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}" - additional_bindings { - delete: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,node_pool_id"; - } - - // CompleteNodePoolUpgrade will signal an on-going node pool upgrade to - // complete. - rpc CompleteNodePoolUpgrade(CompleteNodePoolUpgradeRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:completeUpgrade" - body: "*" - }; - } - - // Rolls back a previously Aborted or Failed NodePool upgrade. - // This makes no changes if the last upgrade successfully completed. - rpc RollbackNodePoolUpgrade(RollbackNodePoolUpgradeRequest) - returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:rollback" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}:rollback" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,node_pool_id"; - } - - // Sets the NodeManagement options for a node pool. - rpc SetNodePoolManagement(SetNodePoolManagementRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setManagement" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/setManagement" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,node_pool_id,management"; - } - - // Sets labels on a cluster. - rpc SetLabels(SetLabelsRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setResourceLabels" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/resourceLabels" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,resource_labels,label_fingerprint"; - } - - // Enables or disables the ABAC authorization mechanism on a cluster. - rpc SetLegacyAbac(SetLegacyAbacRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setLegacyAbac" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/legacyAbac" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id,enabled"; - } - - // Starts master IP rotation. - rpc StartIPRotation(StartIPRotationRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:startIpRotation" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:startIpRotation" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - } - - // Completes master IP rotation. - rpc CompleteIPRotation(CompleteIPRotationRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:completeIpRotation" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:completeIpRotation" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - } - - // SetNodePoolSizeRequest sets the size of a node pool. The new size will be - // used for all replicas, including future replicas created by modifying - // [NodePool.locations][google.container.v1beta1.NodePool.locations]. - rpc SetNodePoolSize(SetNodePoolSizeRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setSize" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/setSize" - body: "*" - } - }; - } - - // Enables or disables Network Policy for a cluster. - rpc SetNetworkPolicy(SetNetworkPolicyRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setNetworkPolicy" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setNetworkPolicy" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,network_policy"; - } - - // Sets the maintenance policy for a cluster. - rpc SetMaintenancePolicy(SetMaintenancePolicyRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setMaintenancePolicy" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setMaintenancePolicy" - body: "*" - } - }; - option (google.api.method_signature) = - "project_id,zone,cluster_id,maintenance_policy"; - } - - // Lists subnetworks that can be used for creating clusters in a project. - rpc ListUsableSubnetworks(ListUsableSubnetworksRequest) - returns (ListUsableSubnetworksResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*}/aggregated/usableSubnetworks" - }; - option (google.api.method_signature) = "parent"; - } - - // Checks the cluster compatibility with Autopilot mode, and returns a list of - // compatibility issues. - rpc CheckAutopilotCompatibility(CheckAutopilotCompatibilityRequest) - returns (CheckAutopilotCompatibilityResponse) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/clusters/*}:checkAutopilotCompatibility" - }; - } - - // Fetches locations that offer Google Kubernetes Engine. - rpc ListLocations(ListLocationsRequest) returns (ListLocationsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*}/locations" - }; - option (google.api.method_signature) = "parent"; - } -} - -// Parameters that can be configured on Linux nodes. -message LinuxNodeConfig { - // Possible cgroup modes that can be used. - enum CgroupMode { - // CGROUP_MODE_UNSPECIFIED is when unspecified cgroup configuration is used. - // The default for the GKE node OS image will be used. - CGROUP_MODE_UNSPECIFIED = 0; - - // CGROUP_MODE_V1 specifies to use cgroupv1 for the cgroup configuration on - // the node image. - CGROUP_MODE_V1 = 1; - - // CGROUP_MODE_V2 specifies to use cgroupv2 for the cgroup configuration on - // the node image. - CGROUP_MODE_V2 = 2; - } - - // The Linux kernel parameters to be applied to the nodes and all pods running - // on the nodes. - // - // The following parameters are supported. - // - // net.core.busy_poll - // net.core.busy_read - // net.core.netdev_max_backlog - // net.core.rmem_max - // net.core.wmem_default - // net.core.wmem_max - // net.core.optmem_max - // net.core.somaxconn - // net.ipv4.tcp_rmem - // net.ipv4.tcp_wmem - // net.ipv4.tcp_tw_reuse - map sysctls = 1; - - // cgroup_mode specifies the cgroup mode to be used on the node. - CgroupMode cgroup_mode = 2; -} - -// Parameters that can be configured on Windows nodes. -// Windows Node Config that define the parameters that will be used to -// configure the Windows node pool settings -message WindowsNodeConfig { - // Possible OS version that can be used. - enum OSVersion { - // When OSVersion is not specified - OS_VERSION_UNSPECIFIED = 0; - - // LTSC2019 specifies to use LTSC2019 as the Windows Servercore Base Image - OS_VERSION_LTSC2019 = 1; - - // LTSC2022 specifies to use LTSC2022 as the Windows Servercore Base Image - OS_VERSION_LTSC2022 = 2; - } - - // OSVersion specifies the Windows node config to be used on the node - OSVersion os_version = 1; -} - -// Node kubelet configs. -message NodeKubeletConfig { - // Control the CPU management policy on the node. - // See - // https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/ - // - // The following values are allowed. - // * "none": the default, which represents the existing scheduling behavior. - // * "static": allows pods with certain resource characteristics to be granted - // increased CPU affinity and exclusivity on the node. - // The default value is 'none' if unspecified. - string cpu_manager_policy = 1; - - // Enable CPU CFS quota enforcement for containers that specify CPU limits. - // - // This option is enabled by default which makes kubelet use CFS quota - // (https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt) to - // enforce container CPU limits. Otherwise, CPU limits will not be enforced at - // all. - // - // Disable this option to mitigate CPU throttling problems while still having - // your pods to be in Guaranteed QoS class by specifying the CPU limits. - // - // The default value is 'true' if unspecified. - google.protobuf.BoolValue cpu_cfs_quota = 2; - - // Set the CPU CFS quota period value 'cpu.cfs_period_us'. - // - // The string must be a sequence of decimal numbers, each with optional - // fraction and a unit suffix, such as "300ms". - // Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". - // The value must be a positive duration. - string cpu_cfs_quota_period = 3; - - // Set the Pod PID limits. See - // https://kubernetes.io/docs/concepts/policy/pid-limiting/#pod-pid-limits - // - // Controls the maximum number of processes allowed to run in a pod. The value - // must be greater than or equal to 1024 and less than 4194304. - int64 pod_pids_limit = 4; - - // Enable or disable Kubelet read only port. - optional bool insecure_kubelet_readonly_port_enabled = 7; -} - -// Parameters that describe the nodes in a cluster. -// -// GKE Autopilot clusters do not -// recognize parameters in `NodeConfig`. Use -// [AutoprovisioningNodePoolDefaults][google.container.v1beta1.AutoprovisioningNodePoolDefaults] -// instead. -message NodeConfig { - // The name of a Google Compute Engine [machine - // type](https://cloud.google.com/compute/docs/machine-types). - // - // If unspecified, the default machine type is - // `e2-medium`. - string machine_type = 1; - - // 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. - int32 disk_size_gb = 2; - - // 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](https://cloud.google.com/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. - repeated string oauth_scopes = 3; - - // The Google Cloud Platform Service Account to be used by the node VMs. - // Specify the email address of the Service Account; otherwise, if no Service - // Account is specified, the "default" service account is used. - string service_account = 9; - - // 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-oslogin" - // - "gci-ensure-gke-docker" - // - "gci-metrics-enabled" - // - "gci-update-strategy" - // - "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" - // - // 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. - map metadata = 4; - - // The image type to use for this node. Note that for a given image type, - // the latest version of it will be used. Please see - // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for - // available image types. - string image_type = 5; - - // 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/ - map labels = 6; - - // 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. - int32 local_ssd_count = 7; - - // 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. - repeated string tags = 8; - - // 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. - bool preemptible = 10; - - // 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. - repeated AcceleratorConfig accelerators = 11; - - // Sandbox configuration for this node. - SandboxConfig sandbox_config = 17; - - // Setting this field will assign instances of this - // pool to run on the specified node group. This is useful for running - // workloads on [sole tenant - // nodes](https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes). - string node_group = 18; - - // The optional reservation affinity. Setting this field will apply - // the specified [Zonal Compute - // Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources) - // to this node pool. - ReservationAffinity reservation_affinity = 19; - - // Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or - // 'pd-balanced') - // - // If unspecified, the default disk type is 'pd-standard' - string disk_type = 12; - - // 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](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform). - string min_cpu_platform = 13; - - // The workload metadata configuration for this node. - WorkloadMetadataConfig workload_metadata_config = 14; - - // 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/ - repeated NodeTaint taints = 15; - - // - // The Customer Managed Encryption Key used to encrypt the boot disk attached - // to each node in the node pool. This should be of the form - // projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. - // For more information about protecting resources with Cloud KMS Keys please - // see: - // https://cloud.google.com/compute/docs/disks/customer-managed-encryption - string boot_disk_kms_key = 23; - - // Shielded Instance options. - ShieldedInstanceConfig shielded_instance_config = 20; - - // Parameters that can be configured on Linux nodes. - LinuxNodeConfig linux_node_config = 21; - - // Node kubelet configs. - NodeKubeletConfig kubelet_config = 22; - - // Parameters for the ephemeral storage filesystem. - // If unspecified, ephemeral storage is backed by the boot disk. - EphemeralStorageConfig ephemeral_storage_config = 24; - - // GCFS (Google Container File System) configs. - GcfsConfig gcfs_config = 25; - - // Advanced features for the Compute Engine VM. - AdvancedMachineFeatures advanced_machine_features = 26; - - // Enable or disable gvnic on the node pool. - VirtualNIC gvnic = 29; - - // Spot flag for enabling Spot VM, which is a rebrand of - // the existing preemptible flag. - bool spot = 32; - - // Confidential nodes config. - // All the nodes in the node pool will be Confidential VM once enabled. - ConfidentialNodes confidential_nodes = 35; - - // Enable or disable NCCL fast socket for the node pool. - optional FastSocket fast_socket = 36; - - // The resource labels for the node pool to use to annotate any related - // Google Compute Engine resources. - map resource_labels = 37; - - // Logging configuration. - NodePoolLoggingConfig logging_config = 38; - - // Parameters that can be configured on Windows nodes. - WindowsNodeConfig windows_node_config = 39; - - // Parameters for using raw-block Local NVMe SSDs. - LocalNvmeSsdBlockConfig local_nvme_ssd_block_config = 40; - - // Parameters for the node ephemeral storage using Local SSDs. - // If unspecified, ephemeral storage is backed by the boot disk. - // This field is functionally equivalent to the ephemeral_storage_config - EphemeralStorageLocalSsdConfig ephemeral_storage_local_ssd_config = 41; - - // Parameters for node pools to be backed by shared sole tenant node groups. - SoleTenantConfig sole_tenant_config = 42; -} - -// Specifies options for controlling advanced machine features. -message AdvancedMachineFeatures { - // The number of threads per physical core. To disable simultaneous - // multithreading (SMT) set this to 1. If unset, the maximum number of threads - // supported per core by the underlying processor is assumed. - optional int64 threads_per_core = 1; -} - -// Parameters for node pool-level network config. -message NodeNetworkConfig { - // Configuration of all network bandwidth tiers - message NetworkPerformanceConfig { - // Node network tier - enum Tier { - // Default value - TIER_UNSPECIFIED = 0; - - // Higher bandwidth, actual values based on VM size. - TIER_1 = 1; - } - - // Specifies the total network bandwidth tier for the NodePool. - optional Tier total_egress_bandwidth_tier = 1; - - // Specifies the network bandwidth tier for the NodePool for traffic to - // external/public IP addresses. - optional Tier external_ip_egress_bandwidth_tier = 2; - } - - // Input only. Whether to create a new range for pod IPs in this node pool. - // Defaults are provided for `pod_range` and `pod_ipv4_cidr_block` if they - // are not specified. - // - // If neither `create_pod_range` or `pod_range` are specified, the - // cluster-level default (`ip_allocation_policy.cluster_ipv4_cidr_block`) is - // used. - // - // Only applicable if `ip_allocation_policy.use_ip_aliases` is true. - // - // This field cannot be changed after the node pool has been created. - bool create_pod_range = 4 [(google.api.field_behavior) = INPUT_ONLY]; - - // The ID of the secondary range for pod IPs. - // If `create_pod_range` is true, this ID is used for the new range. - // If `create_pod_range` is false, uses an existing secondary range with this - // ID. - // - // Only applicable if `ip_allocation_policy.use_ip_aliases` is true. - // - // This field cannot be changed after the node pool has been created. - string pod_range = 5; - - // The IP address range for pod IPs in this node pool. - // - // Only applicable if `create_pod_range` 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](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `10.96.0.0/14`) to pick a specific range to use. - // - // Only applicable if `ip_allocation_policy.use_ip_aliases` is true. - // - // This field cannot be changed after the node pool has been created. - string pod_ipv4_cidr_block = 6; - - // Whether nodes have internal IP addresses only. - // If enable_private_nodes is not specified, then the value is derived from - // [cluster.privateClusterConfig.enablePrivateNodes][google.container.v1beta1.PrivateClusterConfig.enablePrivateNodes] - optional bool enable_private_nodes = 9; - - // Network bandwidth tier configuration. - optional NetworkPerformanceConfig network_performance_config = 11; - - // [PRIVATE FIELD] - // Pod CIDR size overprovisioning config for the nodepool. - // - // Pod CIDR size per node depends on max_pods_per_node. By default, the value - // of max_pods_per_node is rounded off to next power of 2 and we then double - // that to get the size of pod CIDR block per node. - // Example: max_pods_per_node of 30 would result in 64 IPs (/26). - // - // This config can disable the doubling of IPs (we still round off to next - // power of 2) - // Example: max_pods_per_node of 30 will result in 32 IPs (/27) when - // overprovisioning is disabled. - PodCIDROverprovisionConfig pod_cidr_overprovision_config = 13; - - // Output only. [Output only] The utilization of the IPv4 range for the pod. - // The ratio is Usage/[Total number of IPs in the secondary range], - // Usage=numNodes*numZones*podIPsPerNode. - double pod_ipv4_range_utilization = 16 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A set of Shielded Instance options. -message ShieldedInstanceConfig { - // 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. - bool enable_secure_boot = 1; - - // 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. - bool enable_integrity_monitoring = 2; -} - -// SandboxConfig contains configurations of the sandbox to use for the node. -message SandboxConfig { - // Possible types of sandboxes. - enum Type { - // Default value. This should not be used. - UNSPECIFIED = 0; - - // Run sandbox using gvisor. - GVISOR = 1; - } - - // Type of the sandbox to use for the node (e.g. 'gvisor') - string sandbox_type = 1 [deprecated = true]; - - // Type of the sandbox to use for the node. - Type type = 2; -} - -// EphemeralStorageConfig contains configuration for the ephemeral storage -// filesystem. -message EphemeralStorageConfig { - // Number of local SSDs to use to back ephemeral storage. Uses NVMe - // interfaces. Each local SSD is 375 GB in size. - // If zero, it means to disable using local SSDs as ephemeral storage. - int32 local_ssd_count = 1; -} - -// LocalNvmeSsdBlockConfig contains configuration for using raw-block local -// NVMe SSDs -message LocalNvmeSsdBlockConfig { - // The number of raw-block local NVMe SSD disks to be attached to the node. - // Each local SSD is 375 GB in size. If zero, it means no raw-block local NVMe - // 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. - int32 local_ssd_count = 1; -} - -// EphemeralStorageLocalSsdConfig contains configuration for the node ephemeral -// storage using Local SSDs. -message EphemeralStorageLocalSsdConfig { - // Number of local SSDs to use to back ephemeral storage. Uses NVMe - // interfaces. Each local SSD is 375 GB in size. - // If zero, it means to disable using local SSDs as ephemeral storage. - // 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. - int32 local_ssd_count = 1; -} - -// GcfsConfig contains configurations of Google Container File System. -message GcfsConfig { - // Whether to use GCFS. - bool enabled = 1; -} - -// [ReservationAffinity](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources) -// is the configuration of desired reservation which instances could take -// capacity from. -message ReservationAffinity { - // Indicates whether to consume capacity from a reservation or not. - enum Type { - // Default value. This should not be used. - UNSPECIFIED = 0; - - // Do not consume from any reserved capacity. - NO_RESERVATION = 1; - - // Consume any reservation available. - ANY_RESERVATION = 2; - - // Must consume from a specific reservation. Must specify key value fields - // for specifying the reservations. - SPECIFIC_RESERVATION = 3; - } - - // Corresponds to the type of reservation consumption. - Type consume_reservation_type = 1; - - // Corresponds to the label key of a reservation resource. To target a - // SPECIFIC_RESERVATION by name, specify - // "compute.googleapis.com/reservation-name" as the key and specify the name - // of your reservation as its value. - string key = 2; - - // Corresponds to the label value(s) of reservation resource(s). - repeated string values = 3; -} - -// SoleTenantConfig contains the NodeAffinities to specify what shared sole -// tenant node groups should back the node pool. -message SoleTenantConfig { - // Specifies the NodeAffinity key, values, and affinity operator according to - // [shared sole tenant node group - // affinities](https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes#node_affinity_and_anti-affinity). - message NodeAffinity { - // Operator allows user to specify affinity or anti-affinity for the - // given key values. - enum Operator { - // Invalid or unspecified affinity operator. - OPERATOR_UNSPECIFIED = 0; - - // Affinity operator. - IN = 1; - - // Anti-affinity operator. - NOT_IN = 2; - } - - // Key for NodeAffinity. - string key = 1; - - // Operator for NodeAffinity. - Operator operator = 2; - - // Values for NodeAffinity. - repeated string values = 3; - } - - // NodeAffinities used to match to a shared sole tenant node group. - repeated NodeAffinity node_affinities = 1; -} - -// Kubernetes taint is composed of three fields: key, value, and effect. Effect -// can only be one of three types: NoSchedule, PreferNoSchedule or NoExecute. -// -// See -// [here](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration) -// for more information, including usage and the valid values. -message NodeTaint { - // Possible values for Effect in taint. - enum Effect { - // Not set - EFFECT_UNSPECIFIED = 0; - - // NoSchedule - NO_SCHEDULE = 1; - - // PreferNoSchedule - PREFER_NO_SCHEDULE = 2; - - // NoExecute - NO_EXECUTE = 3; - } - - // Key for taint. - string key = 1; - - // Value for taint. - string value = 2; - - // Effect for taint. - Effect effect = 3; -} - -// Collection of Kubernetes [node -// taints](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration). -message NodeTaints { - // List of node taints. - repeated NodeTaint taints = 1; -} - -// Collection of node-level [Kubernetes -// labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels). -message NodeLabels { - // Map of node label keys and node label values. - map labels = 1; -} - -// Collection of [GCP -// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). -message ResourceLabels { - // Map of node label keys and node label values. - map labels = 1; -} - -// Collection of Compute Engine network tags that can be applied to a node's -// underlying VM instance. (See `tags` field in -// [`NodeConfig`](/kubernetes-engine/docs/reference/rest/v1/NodeConfig)). -message NetworkTags { - // List of network tags. - repeated string tags = 1; -} - -// The authentication information for accessing the master endpoint. -// Authentication can be done using HTTP basic auth or using client -// certificates. -message MasterAuth { - // 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). - // - // Warning: basic authentication is deprecated, and will be removed in GKE - // control plane versions 1.19 and newer. For a list of recommended - // authentication methods, see: - // https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication - string username = 1 [deprecated = true]; - - // 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. - // - // Warning: basic authentication is deprecated, and will be removed in GKE - // control plane versions 1.19 and newer. For a list of recommended - // authentication methods, see: - // https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication - string password = 2 [deprecated = true]; - - // Configuration for client certificate authentication on the cluster. For - // clusters before v1.12, if no configuration is specified, a client - // certificate is issued. - ClientCertificateConfig client_certificate_config = 3; - - string cluster_ca_certificate = 100; - - // [Output only] Base64-encoded public certificate used by clients to - // authenticate to the cluster endpoint. - string client_certificate = 101; - - // [Output only] Base64-encoded private key used by clients to authenticate - // to the cluster endpoint. - string client_key = 102; -} - -// Configuration for client certificates on the cluster. -message ClientCertificateConfig { - // Issue a client certificate. - bool issue_client_certificate = 1; -} - -// Configuration for the addons that can be automatically spun up in the -// cluster, enabling additional functionality. -message AddonsConfig { - // Configuration for the HTTP (L7) load balancing controller addon, which - // makes it easy to set up HTTP load balancers for services in a cluster. - HttpLoadBalancing http_load_balancing = 1; - - // 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. - HorizontalPodAutoscaling horizontal_pod_autoscaling = 2; - - // 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 - KubernetesDashboard kubernetes_dashboard = 3 [deprecated = true]; - - // 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. - NetworkPolicyConfig network_policy_config = 4; - - // Configuration for Istio, an open platform to connect, manage, and secure - // microservices. - IstioConfig istio_config = 5 [deprecated = true]; - - // Configuration for the Cloud Run addon. The `IstioConfig` addon must be - // enabled in order to enable Cloud Run addon. This option can only be enabled - // at cluster creation time. - CloudRunConfig cloud_run_config = 7; - - // Configuration for NodeLocalDNS, a dns cache running on cluster nodes - DnsCacheConfig dns_cache_config = 8; - - // Configuration for the ConfigConnector add-on, a Kubernetes - // extension to manage hosted GCP services through the Kubernetes API - ConfigConnectorConfig config_connector_config = 10; - - // Configuration for the Compute Engine Persistent Disk CSI driver. - GcePersistentDiskCsiDriverConfig gce_persistent_disk_csi_driver_config = 11; - - // Configuration for the KALM addon, which manages the lifecycle of k8s - // applications. - KalmConfig kalm_config = 12 [deprecated = true]; - - // Configuration for the GCP Filestore CSI driver. - GcpFilestoreCsiDriverConfig gcp_filestore_csi_driver_config = 14; - - // Configuration for the Backup for GKE agent addon. - GkeBackupAgentConfig gke_backup_agent_config = 16; - - // Configuration for the Cloud Storage Fuse CSI driver. - GcsFuseCsiDriverConfig gcs_fuse_csi_driver_config = 17; -} - -// 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. -message HttpLoadBalancing { - // 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. - bool disabled = 1; -} - -// 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. -message HorizontalPodAutoscaling { - // Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. - // When enabled, it ensures that metrics are collected into Stackdriver - // Monitoring. - bool disabled = 1; -} - -// Configuration for the Kubernetes Dashboard. -message KubernetesDashboard { - // Whether the Kubernetes Dashboard is enabled for this cluster. - bool disabled = 1; -} - -// 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. -message NetworkPolicyConfig { - // Whether NetworkPolicy is enabled for this cluster. - bool disabled = 1; -} - -// Configuration for NodeLocal DNSCache -message DnsCacheConfig { - // Whether NodeLocal DNSCache is enabled for this cluster. - bool enabled = 1; -} - -// Configuration options for the KALM addon. -message KalmConfig { - // Whether KALM is enabled for this cluster. - bool enabled = 1 [deprecated = true]; -} - -// Configuration for the Backup for GKE Agent. -message GkeBackupAgentConfig { - // Whether the Backup for GKE agent is enabled for this cluster. - bool enabled = 1; -} - -// Configuration options for the Config Connector add-on. -message ConfigConnectorConfig { - // Whether Cloud Connector is enabled for this cluster. - bool enabled = 1; -} - -// Configuration for the Compute Engine PD CSI driver. -message GcePersistentDiskCsiDriverConfig { - // Whether the Compute Engine PD CSI driver is enabled for this cluster. - bool enabled = 1; -} - -// Configuration for the GCP Filestore CSI driver. -message GcpFilestoreCsiDriverConfig { - // Whether the GCP Filestore CSI driver is enabled for this cluster. - bool enabled = 1; -} - -// Configuration for the Cloud Storage Fuse CSI driver. -message GcsFuseCsiDriverConfig { - // Whether the Cloud Storage Fuse CSI driver is enabled for this cluster. - bool enabled = 1; -} - -// Configuration for controlling master global access settings. -message PrivateClusterMasterGlobalAccessConfig { - // Whenever master is accessible globally or not. - bool enabled = 1; -} - -// Configuration options for private clusters. -message PrivateClusterConfig { - // 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. - bool enable_private_nodes = 1; - - // Whether the master's internal IP address is used as the cluster endpoint. - bool enable_private_endpoint = 2; - - // 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. - string master_ipv4_cidr_block = 3; - - // Output only. The internal IP address of this cluster's master endpoint. - string private_endpoint = 4; - - // Output only. The external IP address of this cluster's master endpoint. - string public_endpoint = 5; - - // Output only. The peering name in the customer VPC used by this cluster. - string peering_name = 7; - - // Controls master global access settings. - PrivateClusterMasterGlobalAccessConfig master_global_access_config = 8; - - // Subnet to provision the master's private endpoint during cluster creation. - // Specified in projects/*/regions/*/subnetworks/* format. - string private_endpoint_subnetwork = 10; -} - -// Configuration options for Istio addon. -message IstioConfig { - // Istio auth mode, https://istio.io/docs/concepts/security/mutual-tls.html - enum IstioAuthMode { - // auth not enabled - AUTH_NONE = 0; - - // auth mutual TLS enabled - AUTH_MUTUAL_TLS = 1; - } - - // Whether Istio is enabled for this cluster. - bool disabled = 1 [deprecated = true]; - - // The specified Istio auth mode, either none, or mutual TLS. - IstioAuthMode auth = 2 [deprecated = true]; -} - -// Configuration options for the Cloud Run feature. -message CloudRunConfig { - // Load balancer type of ingress service of Cloud Run. - enum LoadBalancerType { - // Load balancer type for Cloud Run is unspecified. - LOAD_BALANCER_TYPE_UNSPECIFIED = 0; - - // Install external load balancer for Cloud Run. - LOAD_BALANCER_TYPE_EXTERNAL = 1; - - // Install internal load balancer for Cloud Run. - LOAD_BALANCER_TYPE_INTERNAL = 2; - } - - // Whether Cloud Run addon is enabled for this cluster. - bool disabled = 1; - - // Which load balancer type is installed for Cloud Run. - LoadBalancerType load_balancer_type = 3; -} - -// 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. -message MasterAuthorizedNetworksConfig { - // CidrBlock contains an optional name and one CIDR block. - message CidrBlock { - // display_name is an optional field for users to identify CIDR blocks. - string display_name = 1; - - // cidr_block must be specified in CIDR notation. - string cidr_block = 2; - } - - // Whether or not master authorized networks is enabled. - bool enabled = 1; - - // cidr_blocks define up to 10 external networks that could access - // Kubernetes master through HTTPS. - repeated CidrBlock cidr_blocks = 2; - - // Whether master is accessbile via Google Compute Engine Public IP addresses. - optional bool gcp_public_cidrs_access_enabled = 3; -} - -// Configuration for the legacy Attribute Based Access Control authorization -// mode. -message LegacyAbac { - // 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. - bool enabled = 1; -} - -// Configuration options for the NetworkPolicy feature. -// https://kubernetes.io/docs/concepts/services-networking/networkpolicies/ -message NetworkPolicy { - // Allowed Network Policy providers. - enum Provider { - // Not set - PROVIDER_UNSPECIFIED = 0; - - // Tigera (Calico Felix). - CALICO = 1; - } - - // The selected network policy provider. - Provider provider = 1; - - // Whether network policy is enabled on the cluster. - bool enabled = 2; -} - -// [PRIVATE FIELD] -// Config for pod CIDR size overprovisioning. -message PodCIDROverprovisionConfig { - // Whether Pod CIDR overprovisioning is disabled. - // Note: Pod CIDR overprovisioning is enabled by default. - bool disable = 1; -} - -// Configuration for controlling how IPs are allocated in the cluster. -message IPAllocationPolicy { - // Possible values for IP stack type - enum StackType { - // By default, the clusters will be IPV4 only - STACK_TYPE_UNSPECIFIED = 0; - - // The value used if the cluster is a IPV4 only - IPV4 = 1; - - // The value used if the cluster is a dual stack cluster - IPV4_IPV6 = 2; - } - - // IPv6 access type - enum IPv6AccessType { - // Default value, will be defaulted as type external. - IPV6_ACCESS_TYPE_UNSPECIFIED = 0; - - // Access type internal (all v6 addresses are internal IPs) - INTERNAL = 1; - - // Access type external (all v6 addresses are external IPs) - EXTERNAL = 2; - } - - // Whether alias IPs will be used for pod IPs in the cluster. - // This is used in conjunction with use_routes. It cannot - // be true if use_routes is true. If both use_ip_aliases and use_routes are - // false, then the server picks the default IP allocation mode - bool use_ip_aliases = 1; - - // Whether a new subnetwork will be created automatically for the cluster. - // - // This field is only applicable when `use_ip_aliases` is true. - bool create_subnetwork = 2; - - // 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. - string subnetwork_name = 3; - - // This field is deprecated, use cluster_ipv4_cidr_block. - string cluster_ipv4_cidr = 4 [deprecated = true]; - - // This field is deprecated, use node_ipv4_cidr_block. - string node_ipv4_cidr = 5 [deprecated = true]; - - // This field is deprecated, use services_ipv4_cidr_block. - string services_ipv4_cidr = 6 [deprecated = true]; - - // 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 and - // create_subnetwork is false. - string cluster_secondary_range_name = 7; - - // 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 and - // create_subnetwork is false. - string services_secondary_range_name = 8; - - // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // 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. - string cluster_ipv4_cidr_block = 9; - - // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // 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. - string node_ipv4_cidr_block = 10; - - // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // 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. - string services_ipv4_cidr_block = 11; - - // If true, allow allocation of cluster CIDR ranges that overlap with certain - // kinds of network routes. By default we do not allow cluster CIDR ranges to - // intersect with any user declared routes. With allow_route_overlap == true, - // we allow overlapping with CIDR ranges that are larger than the cluster CIDR - // range. - // - // If this field is set to true, then cluster and services CIDRs must be - // fully-specified (e.g. `10.96.0.0/14`, but not `/14`), which means: - // 1) When `use_ip_aliases` is true, `cluster_ipv4_cidr_block` and - // `services_ipv4_cidr_block` must be fully-specified. - // 2) When `use_ip_aliases` is false, `cluster.cluster_ipv4_cidr` muse be - // fully-specified. - bool allow_route_overlap = 12; - - // 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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // 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. - // This field is deprecated, use cluster.tpu_config.ipv4_cidr_block instead. - string tpu_ipv4_cidr_block = 13; - - // Whether routes will be used for pod IPs in the cluster. - // This is used in conjunction with use_ip_aliases. It cannot be true if - // use_ip_aliases is true. If both use_ip_aliases and use_routes are false, - // then the server picks the default IP allocation mode - bool use_routes = 15; - - // IP stack type - StackType stack_type = 16; - - // The ipv6 access type (internal or external) when create_subnetwork is true - IPv6AccessType ipv6_access_type = 17; - - // [PRIVATE FIELD] - // Pod CIDR size overprovisioning config for the cluster. - // - // Pod CIDR size per node depends on max_pods_per_node. By default, the value - // of max_pods_per_node is doubled and then rounded off to next power of 2 to - // get the size of pod CIDR block per node. - // Example: max_pods_per_node of 30 would result in 64 IPs (/26). - // - // This config can disable the doubling of IPs (we still round off to next - // power of 2) - // Example: max_pods_per_node of 30 will result in 32 IPs (/27) when - // overprovisioning is disabled. - PodCIDROverprovisionConfig pod_cidr_overprovision_config = 21; - - // Output only. [Output only] The subnet's IPv6 CIDR block used by nodes and - // pods. - string subnet_ipv6_cidr_block = 22 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. [Output only] The services IPv6 CIDR block for the cluster. - string services_ipv6_cidr_block = 23 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. [Output only] The additional pod ranges that are added to the - // cluster. These pod ranges can be used by new node pools to allocate pod IPs - // automatically. Once the range is removed it will not show up in - // IPAllocationPolicy. - AdditionalPodRangesConfig additional_pod_ranges_config = 24 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. [Output only] The utilization of the cluster default IPv4 - // range for the pod. The ratio is Usage/[Total number of IPs in the secondary - // range], Usage=numNodes*numZones*podIPsPerNode. - double default_pod_ipv4_range_utilization = 25 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Configuration for Binary Authorization. -message BinaryAuthorization { - // Binary Authorization mode of operation. - enum EvaluationMode { - // Default value - EVALUATION_MODE_UNSPECIFIED = 0; - - // Disable BinaryAuthorization - DISABLED = 1; - - // Enforce Kubernetes admission requests with BinaryAuthorization using the - // project's singleton policy. This is equivalent to setting the - // enabled boolean to true. - PROJECT_SINGLETON_POLICY_ENFORCE = 2; - } - - // This field is deprecated. Leave this unset and instead configure - // BinaryAuthorization using evaluation_mode. If evaluation_mode is set to - // anything other than EVALUATION_MODE_UNSPECIFIED, this field is ignored. - bool enabled = 1 [deprecated = true]; - - // Mode of operation for binauthz policy evaluation. If unspecified, defaults - // to DISABLED. - EvaluationMode evaluation_mode = 2; -} - -// Configuration for the PodSecurityPolicy feature. -message PodSecurityPolicyConfig { - // Enable the PodSecurityPolicy controller for this cluster. If enabled, pods - // must be valid under a PodSecurityPolicy to be created. - bool enabled = 1; -} - -// Configuration for returning group information from authenticators. -message AuthenticatorGroupsConfig { - // Whether this cluster should return group membership lookups - // during authentication using a group of security groups. - bool enabled = 1; - - // The name of the security group-of-groups to be used. Only relevant - // if enabled = true. - string security_group = 2; -} - -// Telemetry integration for the cluster. -message ClusterTelemetry { - // Type of the integration. - enum Type { - // Not set. - UNSPECIFIED = 0; - - // Monitoring integration is disabled. - DISABLED = 1; - - // Monitoring integration is enabled. - ENABLED = 2; - - // Only system components are monitored and logged. - SYSTEM_ONLY = 3; - } - - // Type of the integration. - Type type = 1; -} - -// A Google Kubernetes Engine cluster. -message Cluster { - // The current status of the cluster. - enum Status { - // Not set. - STATUS_UNSPECIFIED = 0; - - // The PROVISIONING state indicates the cluster is being created. - PROVISIONING = 1; - - // The RUNNING state indicates the cluster has been created and is fully - // usable. - RUNNING = 2; - - // 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. - RECONCILING = 3; - - // The STOPPING state indicates the cluster is being deleted. - STOPPING = 4; - - // The ERROR state indicates the cluster may be unusable. Details - // can be found in the `statusMessage` field. - ERROR = 5; - - // The DEGRADED state indicates the cluster requires user action to restore - // full functionality. Details can be found in the `statusMessage` field. - DEGRADED = 6; - } - - // 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. - string name = 1; - - // An optional description of this cluster. - string description = 2; - - // The number of nodes to create in this cluster. You must ensure that your - // 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 - // "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. - int32 initial_node_count = 3 [deprecated = true]; - - // 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. - NodeConfig node_config = 4 [deprecated = true]; - - // 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. - MasterAuth master_auth = 5; - - // The logging service the cluster should use to write logs. - // Currently available options: - // - // * `logging.googleapis.com/kubernetes` - The Cloud Logging - // service with a Kubernetes-native resource model - // * `logging.googleapis.com` - The legacy Cloud Logging service (no longer - // available as of GKE 1.15). - // * `none` - no logs will be exported from the cluster. - // - // If left as an empty string,`logging.googleapis.com/kubernetes` will be - // used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. - string logging_service = 6; - - // The monitoring service the cluster should use to write metrics. - // Currently available options: - // - // * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring - // service with a Kubernetes-native resource model - // * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no - // longer available as of GKE 1.15). - // * `none` - No metrics will be exported from the cluster. - // - // If left as an empty string,`monitoring.googleapis.com/kubernetes` will be - // used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. - string monitoring_service = 7; - - // The name of the Google Compute Engine - // [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) - // to which the cluster is connected. If left unspecified, the `default` - // network will be used. On output this shows the network ID instead of the - // name. - string network = 8; - - // The IP address range of the container pods in this cluster, in - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // 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`. - string cluster_ipv4_cidr = 9; - - // Configurations for the various addons available to run in the cluster. - AddonsConfig addons_config = 10; - - // The name of the Google Compute Engine - // [subnetwork](https://cloud.google.com/compute/docs/subnetworks) to which - // the cluster is connected. On output this shows the subnetwork ID instead of - // the name. - string subnetwork = 11; - - // The node pools associated with this cluster. - // This field should not be set if "node_config" or "initial_node_count" are - // specified. - repeated NodePool node_pools = 12; - - // The list of Google Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster's nodes should be located. - // - // This field provides a default value if - // [NodePool.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools#NodePool.FIELDS.locations) - // are not specified during node pool creation. - // - // Warning: changing cluster locations will update the - // [NodePool.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools#NodePool.FIELDS.locations) - // of all node pools and will result in nodes being added and/or removed. - repeated string locations = 13; - - // Kubernetes alpha features are enabled on this cluster. This includes alpha - // API groups (e.g. v1beta1) 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. - bool enable_kubernetes_alpha = 14; - - // Kubernetes open source beta apis enabled on the cluster. Only beta apis. - K8sBetaAPIConfig enable_k8s_beta_apis = 143; - - // The resource labels for the cluster to use to annotate any related - // Google Compute Engine resources. - map resource_labels = 15; - - // The fingerprint of the set of labels for this cluster. - string label_fingerprint = 16; - - // Configuration for the legacy ABAC authorization mode. - LegacyAbac legacy_abac = 18; - - // Configuration options for the NetworkPolicy feature. - NetworkPolicy network_policy = 19; - - // Configuration for cluster IP allocation. - IPAllocationPolicy ip_allocation_policy = 20; - - // The configuration options for master authorized networks feature. - MasterAuthorizedNetworksConfig master_authorized_networks_config = 22; - - // Configure the maintenance policy for this cluster. - MaintenancePolicy maintenance_policy = 23; - - // Configuration for Binary Authorization. - BinaryAuthorization binary_authorization = 24; - - // Configuration for the PodSecurityPolicy feature. - PodSecurityPolicyConfig pod_security_policy_config = 25; - - // Cluster-level autoscaling configuration. - ClusterAutoscaling autoscaling = 26; - - // Configuration for cluster networking. - NetworkConfig network_config = 27; - - // If this is a private cluster setup. Private clusters are clusters that, by - // default have no external IP addresses on the nodes and where nodes and the - // master communicate over private IP addresses. - // This field is deprecated, use private_cluster_config.enable_private_nodes - // instead. - bool private_cluster = 28 [deprecated = true]; - - // The IP prefix in CIDR notation to use for the hosted master network. - // This prefix will be used for assigning private IP addresses to the - // master or set of masters, as well as the ILB VIP. - // This field is deprecated, use - // private_cluster_config.master_ipv4_cidr_block instead. - string master_ipv4_cidr_block = 29 [deprecated = true]; - - // 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. - MaxPodsConstraint default_max_pods_constraint = 30; - - // Configuration for exporting resource usages. Resource usage export is - // disabled when this config unspecified. - ResourceUsageExportConfig resource_usage_export_config = 33; - - // Configuration controlling RBAC group membership information. - AuthenticatorGroupsConfig authenticator_groups_config = 34; - - // Configuration for private cluster. - PrivateClusterConfig private_cluster_config = 37; - - // Cluster-level Vertical Pod Autoscaling configuration. - VerticalPodAutoscaling vertical_pod_autoscaling = 39; - - // Shielded Nodes configuration. - ShieldedNodes shielded_nodes = 40; - - // Release channel configuration. If left unspecified on cluster creation and - // a version is specified, the cluster is enrolled in the most mature release - // channel where the version is available (first checking STABLE, then - // REGULAR, and finally RAPID). Otherwise, if no release channel - // configuration and no version is specified, the cluster is enrolled in the - // REGULAR channel with its default version. - ReleaseChannel release_channel = 41; - - // Configuration for the use of Kubernetes Service Accounts in GCP IAM - // policies. - WorkloadIdentityConfig workload_identity_config = 43; - - // Configuration for issuance of mTLS keys and certificates to Kubernetes - // pods. - WorkloadCertificates workload_certificates = 52; - - // Configuration for issuance of mTLS keys and certificates to Kubernetes - // pods. - MeshCertificates mesh_certificates = 67; - - // Configuration for direct-path (via ALTS) with workload identity. - WorkloadALTSConfig workload_alts_config = 53; - - // Configuration for the fine-grained cost management feature. - CostManagementConfig cost_management_config = 45; - - // Telemetry integration for the cluster. - ClusterTelemetry cluster_telemetry = 46; - - // Configuration for Cloud TPU support; - TpuConfig tpu_config = 47; - - // Notification configuration of the cluster. - NotificationConfig notification_config = 49; - - // Configuration of Confidential Nodes. - // All the nodes in the cluster will be Confidential VM once enabled. - ConfidentialNodes confidential_nodes = 50; - - // Configuration for Identity Service component. - IdentityServiceConfig identity_service_config = 54; - - // [Output only] Server-defined URL for the resource. - string self_link = 100; - - // [Output only] The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field is deprecated, use location instead. - string zone = 101 [deprecated = true]; - - // [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. - string endpoint = 102; - - // 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 - string initial_cluster_version = 103; - - // [Output only] The current software version of the master endpoint. - string current_master_version = 104; - - // [Output only] Deprecated, use - // [NodePool.version](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters.nodePools) - // 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. - string current_node_version = 105 [deprecated = true]; - - // [Output only] The time the cluster was created, in - // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string create_time = 106; - - // [Output only] The current status of this cluster. - Status status = 107; - - // [Output only] Deprecated. Use conditions instead. - // Additional information about the current status of this - // cluster, if available. - string status_message = 108 [deprecated = true]; - - // [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. - int32 node_ipv4_cidr_size = 109; - - // [Output only] The IP address range of the Kubernetes services in - // this cluster, in - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `1.2.3.4/29`). Service addresses are - // typically put in the last `/16` from the container CIDR. - string services_ipv4_cidr = 110; - - // Deprecated. Use node_pools.instance_group_urls. - repeated string instance_group_urls = 111 [deprecated = true]; - - // [Output only] The number of nodes currently in the cluster. Deprecated. - // Call Kubernetes API directly to retrieve node information. - int32 current_node_count = 112 [deprecated = true]; - - // [Output only] The time the cluster will be automatically - // deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string expire_time = 113; - - // [Output only] The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) - // or - // [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) - // in which the cluster resides. - string location = 114; - - // Enable the ability to use Cloud TPUs in this cluster. - // This field is deprecated, use tpu_config.enabled instead. - bool enable_tpu = 115; - - // [Output only] The IP address range of the Cloud TPUs in this cluster, in - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `1.2.3.4/29`). - string tpu_ipv4_cidr_block = 116; - - // Configuration of etcd encryption. - DatabaseEncryption database_encryption = 38; - - // Which conditions caused the current cluster state. - repeated StatusCondition conditions = 118; - - // Configuration for master components. - Master master = 124; - - // Autopilot configuration for the cluster. - Autopilot autopilot = 128; - - // Output only. Unique id for the cluster. - string id = 129 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Default NodePool settings for the entire cluster. These settings are - // overridden if specified on the specific NodePool object. - optional NodePoolDefaults node_pool_defaults = 131; - - // Logging configuration for the cluster. - LoggingConfig logging_config = 132; - - // Monitoring configuration for the cluster. - MonitoringConfig monitoring_config = 133; - - // Node pool configs that apply to all auto-provisioned node pools - // in autopilot clusters and node auto-provisioning enabled clusters. - NodePoolAutoConfig node_pool_auto_config = 136; - - // Enable/Disable Protect API features for the cluster. - optional ProtectConfig protect_config = 137; - - // This checksum is computed by the server based on the value of cluster - // fields, and may be sent on update requests to ensure the client has an - // up-to-date value before proceeding. - string etag = 139; - - // Fleet information for the cluster. - Fleet fleet = 140; - - // Enable/Disable Security Posture API features for the cluster. - SecurityPostureConfig security_posture_config = 145; -} - -// Kubernetes open source beta apis enabled on the cluster. -message K8sBetaAPIConfig { - // api name, e.g. storage.k8s.io/v1beta1/csistoragecapacities. - repeated string enabled_apis = 1; -} - -// WorkloadConfig defines the flags to enable or disable the -// workload configurations for the cluster. -message WorkloadConfig { - // Mode defines how to audit the workload configs. - enum Mode { - // Default value meaning that no mode has been specified. - MODE_UNSPECIFIED = 0; - - // This disables Workload Configuration auditing on the cluster, - // meaning that nothing is surfaced. - DISABLED = 1; - - // Applies the default set of policy auditing to a cluster's workloads. - BASIC = 4; - - // Surfaces configurations that are not in line with the - // Pod Security Standard Baseline policy. - BASELINE = 2 [deprecated = true]; - - // Surfaces configurations that are not in line with the - // Pod Security Standard Restricted policy. - RESTRICTED = 3 [deprecated = true]; - } - - // Sets which mode of auditing should be used for the cluster's workloads. - optional Mode audit_mode = 1; -} - -// ProtectConfig defines the flags needed to enable/disable features for the -// Protect API. -message ProtectConfig { - // WorkloadVulnerabilityMode defines mode to perform vulnerability scanning. - enum WorkloadVulnerabilityMode { - // Default value not specified. - WORKLOAD_VULNERABILITY_MODE_UNSPECIFIED = 0; - - // Disables Workload Vulnerability Scanning feature on the cluster. - DISABLED = 1; - - // Applies basic vulnerability scanning settings for cluster workloads. - BASIC = 2; - } - - // WorkloadConfig defines which actions are enabled for a cluster's workload - // configurations. - optional WorkloadConfig workload_config = 1; - - // Sets which mode to use for Protect workload vulnerability scanning feature. - optional WorkloadVulnerabilityMode workload_vulnerability_mode = 2; -} - -// SecurityPostureConfig defines the flags needed to enable/disable features for -// the Security Posture API. -message SecurityPostureConfig { - // Mode defines enablement mode for GKE Security posture features. - enum Mode { - // Default value not specified. - MODE_UNSPECIFIED = 0; - - // Disables Security Posture features on the cluster. - DISABLED = 1; - - // Applies Security Posture features on the cluster. - BASIC = 2; - } - - // VulnerabilityMode defines enablement mode for vulnerability scanning. - enum VulnerabilityMode { - // Default value not specified. - VULNERABILITY_MODE_UNSPECIFIED = 0; - - // Disables vulnerability scanning on the cluster. - VULNERABILITY_DISABLED = 1; - - // Applies basic vulnerability scanning on the cluster. - VULNERABILITY_BASIC = 2; - } - - // Sets which mode to use for Security Posture features. - optional Mode mode = 1; - - // Sets which mode to use for vulnerability scanning. - optional VulnerabilityMode vulnerability_mode = 2; -} - -// Subset of Nodepool message that has defaults. -message NodePoolDefaults { - // Subset of NodeConfig message that has defaults. - NodeConfigDefaults node_config_defaults = 1; -} - -// Subset of NodeConfig message that has defaults. -message NodeConfigDefaults { - // GCFS (Google Container File System, also known as Riptide) options. - GcfsConfig gcfs_config = 1; - - // Logging configuration for node pools. - NodePoolLoggingConfig logging_config = 3; -} - -// node pool configs that apply to all auto-provisioned node pools -// in autopilot clusters and node auto-provisioning enabled clusters -message NodePoolAutoConfig { - // 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 creation. Each tag within the list - // must comply with RFC1035. - NetworkTags network_tags = 1; -} - -// 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. -message ClusterUpdate { - // 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 - string desired_node_version = 4; - - // The monitoring service the cluster should use to write metrics. - // Currently available options: - // - // * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring - // service with a Kubernetes-native resource model - // * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no - // longer available as of GKE 1.15). - // * `none` - No metrics will be exported from the cluster. - // - // If left as an empty string,`monitoring.googleapis.com/kubernetes` will be - // used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. - string desired_monitoring_service = 5; - - // Configurations for the various addons available to run in the cluster. - AddonsConfig desired_addons_config = 6; - - // The node pool to be upgraded. This field is mandatory if - // "desired_node_version", "desired_image_family", - // "desired_node_pool_autoscaling", or "desired_workload_metadata_config" - // is specified and there is more than one node pool on the cluster. - string desired_node_pool_id = 7; - - // The desired image type for the node pool. - // NOTE: Set the "desired_node_pool" field as well. - string desired_image_type = 8; - - // 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. - NodePoolAutoscaling desired_node_pool_autoscaling = 9; - - // The desired list of Google Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster's nodes should be located. - // - // This list must always include the cluster's primary zone. - // - // Warning: changing cluster locations will update the locations of all node - // pools and will result in nodes being added and/or removed. - repeated string desired_locations = 10; - - // The desired configuration options for master authorized networks feature. - MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12; - - // The desired configuration options for the PodSecurityPolicy feature. - PodSecurityPolicyConfig desired_pod_security_policy_config = 14; - - // Cluster-level autoscaling configuration. - ClusterAutoscaling desired_cluster_autoscaling = 15; - - // The desired configuration options for the Binary Authorization feature. - BinaryAuthorization desired_binary_authorization = 16; - - // The logging service the cluster should use to write logs. - // Currently available options: - // - // * `logging.googleapis.com/kubernetes` - The Cloud Logging - // service with a Kubernetes-native resource model - // * `logging.googleapis.com` - The legacy Cloud Logging service (no longer - // available as of GKE 1.15). - // * `none` - no logs will be exported from the cluster. - // - // If left as an empty string,`logging.googleapis.com/kubernetes` will be - // used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. - string desired_logging_service = 19; - - // The desired configuration for exporting resource usage. - ResourceUsageExportConfig desired_resource_usage_export_config = 21; - - // Cluster-level Vertical Pod Autoscaling configuration. - VerticalPodAutoscaling desired_vertical_pod_autoscaling = 22; - - // The desired private cluster configuration. - PrivateClusterConfig desired_private_cluster_config = 25; - - // The desired config of Intra-node visibility. - IntraNodeVisibilityConfig desired_intra_node_visibility_config = 26; - - // The desired status of whether to disable default sNAT for this cluster. - DefaultSnatStatus desired_default_snat_status = 28; - - // The desired telemetry integration for the cluster. - ClusterTelemetry desired_cluster_telemetry = 30; - - // The desired release channel configuration. - ReleaseChannel desired_release_channel = 31; - - // The desired Cloud TPU configuration. - TpuConfig desired_tpu_config = 38; - - // The desired L4 Internal Load Balancer Subsetting configuration. - ILBSubsettingConfig desired_l4ilb_subsetting_config = 39; - - // The desired datapath provider for the cluster. - DatapathProvider desired_datapath_provider = 50; - - // The desired state of IPv6 connectivity to Google Services. - PrivateIPv6GoogleAccess desired_private_ipv6_google_access = 51; - - // The desired notification configuration. - NotificationConfig desired_notification_config = 55; - - // The Kubernetes version to change the master to. The only valid value is the - // latest supported version. - // - // 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 - string desired_master_version = 100; - - // The desired GCFS config for the cluster. - GcfsConfig desired_gcfs_config = 109; - - // Configuration of etcd encryption. - DatabaseEncryption desired_database_encryption = 46; - - // Configuration for Workload Identity. - WorkloadIdentityConfig desired_workload_identity_config = 47; - - // Configuration for issuance of mTLS keys and certificates to Kubernetes - // pods. - WorkloadCertificates desired_workload_certificates = 61; - - // Configuration for issuance of mTLS keys and certificates to Kubernetes - // pods. - MeshCertificates desired_mesh_certificates = 67; - - // Configuration for direct-path (via ALTS) with workload identity. - WorkloadALTSConfig desired_workload_alts_config = 62; - - // Configuration for Shielded Nodes. - ShieldedNodes desired_shielded_nodes = 48; - - // The desired configuration for the fine-grained cost management feature. - CostManagementConfig desired_cost_management_config = 49; - - // Configuration for master components. - Master desired_master = 52; - - // DNSConfig contains clusterDNS config for this cluster. - DNSConfig desired_dns_config = 53; - - // ServiceExternalIPsConfig specifies the config for the use of Services with - // ExternalIPs field. - ServiceExternalIPsConfig desired_service_external_ips_config = 60; - - // AuthenticatorGroupsConfig specifies the config for the cluster security - // groups settings. - AuthenticatorGroupsConfig desired_authenticator_groups_config = 63; - - // The desired logging configuration. - LoggingConfig desired_logging_config = 64; - - // The desired monitoring configuration. - MonitoringConfig desired_monitoring_config = 65; - - // The desired Identity Service component configuration. - IdentityServiceConfig desired_identity_service_config = 66; - - // Enable/Disable private endpoint for the cluster's master. - optional bool desired_enable_private_endpoint = 71; - - // The desired network tags that apply to all auto-provisioned node pools - // in autopilot clusters and node auto-provisioning enabled clusters. - NetworkTags desired_node_pool_auto_config_network_tags = 110; - - // Enable/Disable Protect API features for the cluster. - optional ProtectConfig desired_protect_config = 112; - - // The desired config of Gateway API on this cluster. - GatewayAPIConfig desired_gateway_api_config = 114; - - // The current etag of the cluster. - // If an etag is provided and does not match the current etag of the cluster, - // update will be blocked and an ABORTED error will be returned. - string etag = 115; - - // The desired node pool logging configuration defaults for the cluster. - NodePoolLoggingConfig desired_node_pool_logging_config = 116; - - // The desired fleet configuration for the cluster. - Fleet desired_fleet = 117; - - // The desired stack type of the cluster. - // If a stack type is provided and does not match the current stack type of - // the cluster, update will attempt to change the stack type to the new type. - StackType desired_stack_type = 119; - - // The additional pod ranges to be added to the cluster. These pod ranges - // can be used by node pools to allocate pod IPs. - AdditionalPodRangesConfig additional_pod_ranges_config = 120; - - // The additional pod ranges that are to be removed from the cluster. - // The pod ranges specified here must have been specified earlier in the - // 'additional_pod_ranges_config' argument. - AdditionalPodRangesConfig removed_additional_pod_ranges_config = 121; - - // Kubernetes open source beta apis enabled on the cluster. Only beta apis - K8sBetaAPIConfig enable_k8s_beta_apis = 122; - - // Enable/Disable Security Posture API features for the cluster. - SecurityPostureConfig desired_security_posture_config = 124; - - // The desired network performance config. - NetworkConfig.ClusterNetworkPerformanceConfig - desired_network_performance_config = 125; - - // Enable/Disable FQDN Network Policy for the cluster. - optional bool desired_enable_fqdn_network_policy = 126; - - // The desired workload policy configuration for the autopilot cluster. - WorkloadPolicyConfig desired_autopilot_workload_policy_config = 128; - - // Beta APIs enabled for cluster. - K8sBetaAPIConfig desired_k8s_beta_apis = 131; -} - -// AdditionalPodRangesConfig is the configuration for additional pod secondary -// ranges supporting the ClusterUpdate message. -message AdditionalPodRangesConfig { - // Name for pod secondary ipv4 range which has the actual range defined ahead. - repeated string pod_range_names = 1; - - // Output only. [Output only] Information for additional pod range. - repeated RangeInfo pod_range_info = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// RangeInfo contains the range name and the range utilization by this cluster. -message RangeInfo { - // Output only. [Output only] Name of a range. - string range_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. [Output only] The utilization of the range. - double utilization = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// This operation resource represents operations that may have happened or are -// happening on the cluster. All fields are output only. -message Operation { - // Current status of the operation. - enum Status { - // Not set. - STATUS_UNSPECIFIED = 0; - - // The operation has been created. - PENDING = 1; - - // The operation is currently running. - RUNNING = 2; - - // The operation is done, either cancelled or completed. - DONE = 3; - - // The operation is aborting. - ABORTING = 4; - } - - // Operation type categorizes the operation. - enum Type { - // Not set. - TYPE_UNSPECIFIED = 0; - - // The cluster is being created. The cluster should be assumed to be - // unusable until the operation finishes. - // - // In the event of the operation failing, the cluster will enter the [ERROR - // state][Cluster.Status.ERROR] and eventually be deleted. - CREATE_CLUSTER = 1; - - // The cluster is being deleted. The cluster should be assumed to be - // unusable as soon as this operation starts. - // - // In the event of the operation failing, the cluster will enter the [ERROR - // state][Cluster.Status.ERROR] and the deletion will be automatically - // retried until completed. - DELETE_CLUSTER = 2; - - // The [cluster - // version][google.container.v1beta1.ClusterUpdate.desired_master_version] - // is being updated. Note that this includes "upgrades" to the same version, - // which are simply a recreation. This also includes - // [auto-upgrades](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades#upgrading_automatically). - // For more details, see [documentation on cluster - // upgrades](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades#cluster_upgrades). - UPGRADE_MASTER = 3; - - // A node pool is being updated. Despite calling this an "upgrade", this - // includes most forms of updates to node pools. This also includes - // [auto-upgrades](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-upgrades). - // - // This operation sets the - // [progress][google.container.v1beta1.Operation.progress] field and may be - // [canceled][google.container.v1beta1.ClusterManager.CancelOperation]. - // - // The upgrade strategy depends on [node pool - // configuration](https://cloud.google.com/kubernetes-engine/docs/concepts/node-pool-upgrade-strategies). - // The nodes are generally still usable during this operation. - UPGRADE_NODES = 4; - - // A problem has been detected with the control plane and is being repaired. - // This operation type is initiated by GKE. For more details, see - // [documentation on - // repairs](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#repairs). - REPAIR_CLUSTER = 5; - - // The cluster is being updated. This is a broad category of operations and - // includes operations that only change metadata as well as those that must - // recreate the entire cluster. If the control plane must be recreated, this - // will cause temporary downtime for zonal clusters. - // - // Some features require recreating the nodes as well. Those will be - // recreated as separate operations and the update may not be completely - // functional until the node pools recreations finish. Node recreations will - // generally follow [maintenance - // policies](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions). - // - // Some GKE-initiated operations use this type. This includes certain types - // of auto-upgrades and incident mitigations. - UPDATE_CLUSTER = 6; - - // A node pool is being created. The node pool should be assumed to be - // unusable until this operation finishes. In the event of an error, the - // node pool may be partially created. - // - // If enabled, [node - // autoprovisioning](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-provisioning) - // may have automatically initiated such operations. - CREATE_NODE_POOL = 7; - - // The node pool is being deleted. The node pool should be assumed to be - // unusable as soon as this operation starts. - DELETE_NODE_POOL = 8; - - // The node pool's - // [manamagent][google.container.v1beta1.NodePool.management] field is being - // updated. These operations only update metadata and may be concurrent with - // most other operations. - SET_NODE_POOL_MANAGEMENT = 9; - - // A problem has been detected with nodes and [they are being - // repaired](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-repair). - // This operation type is initiated by GKE, typically automatically. This - // operation may be concurrent with other operations and there may be - // multiple repairs occurring on the same node pool. - AUTO_REPAIR_NODES = 10; - - // Unused. Automatic node upgrade uses - // [UPGRADE_NODES][google.container.v1beta1.Operation.Type.UPGRADE_NODES]. - AUTO_UPGRADE_NODES = 11 [deprecated = true]; - - // Unused. Updating labels uses - // [UPDATE_CLUSTER][google.container.v1beta1.Operation.Type.UPDATE_CLUSTER]. - SET_LABELS = 12 [deprecated = true]; - - // Unused. Updating master auth uses - // [UPDATE_CLUSTER][google.container.v1beta1.Operation.Type.UPDATE_CLUSTER]. - SET_MASTER_AUTH = 13 [deprecated = true]; - - // The node pool is being resized. With the exception of resizing to or from - // size zero, the node pool is generally usable during this operation. - SET_NODE_POOL_SIZE = 14; - - // Unused. Updating network policy uses - // [UPDATE_CLUSTER][google.container.v1beta1.Operation.Type.UPDATE_CLUSTER]. - SET_NETWORK_POLICY = 15 [deprecated = true]; - - // Unused. Updating maintenance policy uses - // [UPDATE_CLUSTER][google.container.v1beta1.Operation.Type.UPDATE_CLUSTER]. - SET_MAINTENANCE_POLICY = 16 [deprecated = true]; - - // The control plane is being resized. This operation type is initiated by - // GKE. These operations are often performed preemptively to ensure that the - // control plane has sufficient resources and is not typically an indication - // of issues. For more details, see - // [documentation on - // resizes](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#repairs). - RESIZE_CLUSTER = 18; - } - - // The server-assigned ID for the operation. - string name = 1; - - // The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // operation is taking place. This field is deprecated, use location instead. - string zone = 2 [deprecated = true]; - - // The operation type. - Type operation_type = 3; - - // The current status of the operation. - Status status = 4; - - // Detailed operation progress, if available. - string detail = 8; - - // Output only. If an error has occurred, a textual description of the error. - // Deprecated. Use field error instead. - string status_message = 5 - [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; - - // Server-defined URI for the operation. Example: - // `https://container.googleapis.com/v1alpha1/projects/123/locations/us-central1/operations/operation-123`. - string self_link = 6; - - // Server-defined URI for the target of the operation. The format of this is a - // URI to the resource being modified (such as a cluster, node pool, or node). - // For node pool repairs, there may be multiple nodes being repaired, but only - // one will be the target. - // - // Examples: - // - // - - // ## - // `https://container.googleapis.com/v1/projects/123/locations/us-central1/clusters/my-cluster` - // - // ## - // `https://container.googleapis.com/v1/projects/123/zones/us-central1-c/clusters/my-cluster/nodePools/my-np` - // - // `https://container.googleapis.com/v1/projects/123/zones/us-central1-c/clusters/my-cluster/nodePools/my-np/node/my-node` - string target_link = 7; - - // [Output only] The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) - // or - // [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) - // in which the cluster resides. - string location = 9; - - // [Output only] The time the operation started, in - // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string start_time = 10; - - // [Output only] The time the operation completed, in - // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string end_time = 11; - - // Output only. [Output only] Progress information for an operation. - OperationProgress progress = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Which conditions caused the current cluster state. - // Deprecated. Use field error instead. - repeated StatusCondition cluster_conditions = 13 [deprecated = true]; - - // Which conditions caused the current node pool state. - // Deprecated. Use field error instead. - repeated StatusCondition nodepool_conditions = 14 [deprecated = true]; - - // The error result of the operation in case of failure. - google.rpc.Status error = 15; -} - -// Information about operation (or operation stage) progress. -message OperationProgress { - // Progress metric is (string, int|float|string) pair. - message Metric { - // Required. Metric name, e.g., "nodes total", "percent done". - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Strictly one of the values is required. - oneof value { - // For metrics with integer value. - int64 int_value = 2; - - // For metrics with floating point value. - double double_value = 3; - - // For metrics with custom values (ratios, visual progress, etc.). - string string_value = 4; - } - } - - // A non-parameterized string describing an operation stage. - // Unset for single-stage operations. - string name = 1; - - // Status of an operation stage. - // Unset for single-stage operations. - Operation.Status status = 2; - - // Progress metric bundle, for example: - // metrics: [{name: "nodes done", int_value: 15}, - // {name: "nodes total", int_value: 32}] - // or - // metrics: [{name: "progress", double_value: 0.56}, - // {name: "progress scale", double_value: 1.0}] - repeated Metric metrics = 3; - - // Substages of an operation or a stage. - repeated OperationProgress stages = 4; -} - -// CreateClusterRequest creates a cluster. -message CreateClusterRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the parent - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. A [cluster - // resource](https://cloud.google.com/container-engine/reference/rest/v1beta1/projects.locations.clusters) - Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; - - // The parent (project and location) where the cluster will be created. - // Specified in the format `projects/*/locations/*`. - string parent = 5; -} - -// GetClusterRequest gets the settings of a cluster. -message GetClusterRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to retrieve. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to retrieve. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 5; -} - -// UpdateClusterRequest updates the settings of a cluster. -message UpdateClusterRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. A description of the update. - ClusterUpdate update = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to update. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 5; -} - -// SetNodePoolVersionRequest updates the version of a node pool. -message UpdateNodePoolRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the node pool to upgrade. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // 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 - string node_version = 5 [(google.api.field_behavior) = REQUIRED]; - - // Required. The desired image type for the node pool. Please see - // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for - // available image types. - string image_type = 6 [(google.api.field_behavior) = REQUIRED]; - - // The desired list of Google Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) in which the - // node pool's nodes should be located. Changing the locations for a node pool - // will result in nodes being either created or removed from the node pool, - // depending on whether locations are being added or removed. - repeated string locations = 13; - - // The desired workload metadata config for the node pool. - WorkloadMetadataConfig workload_metadata_config = 14; - - // The name (project, location, cluster, node pool) of the node pool to - // update. Specified in the format - // `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 8; - - // Upgrade settings control disruption and speed of the upgrade. - NodePool.UpgradeSettings upgrade_settings = 15; - - // The desired network tags to be applied to all nodes in the node pool. - // If this field is not present, the tags will not be changed. Otherwise, - // the existing network tags will be *replaced* with the provided tags. - NetworkTags tags = 16; - - // The desired node taints to be applied to all nodes in the node pool. - // If this field is not present, the taints will not be changed. Otherwise, - // the existing node taints will be *replaced* with the provided taints. - NodeTaints taints = 17; - - // The desired node labels to be applied to all nodes in the node pool. - // If this field is not present, the labels will not be changed. Otherwise, - // the existing node labels will be *replaced* with the provided labels. - NodeLabels labels = 18; - - // Parameters that can be configured on Linux nodes. - LinuxNodeConfig linux_node_config = 19; - - // Node kubelet configs. - NodeKubeletConfig kubelet_config = 20; - - // Node network config. - NodeNetworkConfig node_network_config = 21; - - // GCFS config. - GcfsConfig gcfs_config = 22; - - // Confidential nodes config. - // All the nodes in the node pool will be Confidential VM once enabled. - ConfidentialNodes confidential_nodes = 23; - - // Enable or disable gvnic on the node pool. - VirtualNIC gvnic = 29; - - // The current etag of the node pool. - // If an etag is provided and does not match the current etag of the node - // pool, update will be blocked and an ABORTED error will be returned. - string etag = 30; - - // Enable or disable NCCL fast socket for the node pool. - FastSocket fast_socket = 31; - - // Logging configuration. - NodePoolLoggingConfig logging_config = 32; - - // The resource labels for the node pool to use to annotate any related - // Google Compute Engine resources. - ResourceLabels resource_labels = 33; - - // Parameters that can be configured on Windows nodes. - WindowsNodeConfig windows_node_config = 34; -} - -// SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool. -message SetNodePoolAutoscalingRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the node pool to upgrade. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Autoscaling configuration for the node pool. - NodePoolAutoscaling autoscaling = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster, node pool) of the node pool to set - // autoscaler settings. Specified in the format - // `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 6; -} - -// SetLoggingServiceRequest sets the logging service of a cluster. -message SetLoggingServiceRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. The logging service the cluster should use to write logs. - // Currently available options: - // - // * `logging.googleapis.com/kubernetes` - The Cloud Logging - // service with a Kubernetes-native resource model - // * `logging.googleapis.com` - The legacy Cloud Logging service (no longer - // available as of GKE 1.15). - // * `none` - no logs will be exported from the cluster. - // - // If left as an empty string,`logging.googleapis.com/kubernetes` will be - // used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. - string logging_service = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set logging. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 5; -} - -// SetMonitoringServiceRequest sets the monitoring service of a cluster. -message SetMonitoringServiceRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. The monitoring service the cluster should use to write metrics. - // Currently available options: - // - // * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring - // service with a Kubernetes-native resource model - // * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no - // longer available as of GKE 1.15). - // * `none` - No metrics will be exported from the cluster. - // - // If left as an empty string,`monitoring.googleapis.com/kubernetes` will be - // used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. - string monitoring_service = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set monitoring. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 6; -} - -// SetAddonsRequest sets the addons associated with the cluster. -message SetAddonsConfigRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. The desired configurations for the various addons available to - // run in the cluster. - AddonsConfig addons_config = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set addons. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 6; -} - -// SetLocationsRequest sets the locations of the cluster. -message SetLocationsRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. The desired list of Google Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) 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. - repeated string locations = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set locations. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 6; -} - -// UpdateMasterRequest updates the master of the cluster. -message UpdateMasterRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // 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 - string master_version = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to update. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 7; -} - -// SetMasterAuthRequest updates the admin password of a cluster. -message SetMasterAuthRequest { - // Operation type: what type update to perform. - enum Action { - // Operation is unknown and will error out. - UNKNOWN = 0; - - // Set the password to a user generated value. - SET_PASSWORD = 1; - - // Generate a new password and set it to that. - GENERATE_PASSWORD = 2; - - // 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. - SET_USERNAME = 3; - } - - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. The exact form of action to be taken on the master auth. - Action action = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. A description of the update. - MasterAuth update = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set auth. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 7; -} - -// DeleteClusterRequest deletes a cluster. -message DeleteClusterRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to delete. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to delete. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 4; -} - -// ListClustersRequest lists clusters. -message ListClustersRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides, or "-" for all zones. This field has been deprecated and - // replaced by the parent field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The parent (project and location) where the clusters will be listed. - // Specified in the format `projects/*/locations/*`. - // Location "-" matches all zones and all regions. - string parent = 4; -} - -// ListClustersResponse is the result of ListClustersRequest. -message ListClustersResponse { - // A list of clusters in the project in the specified zone, or - // across all ones. - repeated Cluster clusters = 1; - - // If any zones are listed here, the list of clusters returned - // may be missing those zones. - repeated string missing_zones = 2; -} - -// GetOperationRequest gets a single operation. -message GetOperationRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The server-assigned `name` of the operation. - // This field has been deprecated and replaced by the name field. - string operation_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The name (project, location, operation id) of the operation to get. - // Specified in the format `projects/*/locations/*/operations/*`. - string name = 5; -} - -// ListOperationsRequest lists operations. -message ListOperationsRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) to return - // operations for, or `-` for all zones. This field has been deprecated and - // replaced by the parent field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The parent (project and location) where the operations will be listed. - // Specified in the format `projects/*/locations/*`. - // Location "-" matches all zones and all regions. - string parent = 4; -} - -// CancelOperationRequest cancels a single operation. -message CancelOperationRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // operation resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The server-assigned `name` of the operation. - // This field has been deprecated and replaced by the name field. - string operation_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The name (project, location, operation id) of the operation to cancel. - // Specified in the format `projects/*/locations/*/operations/*`. - string name = 4; -} - -// ListOperationsResponse is the result of ListOperationsRequest. -message ListOperationsResponse { - // A list of operations in the project in the specified zone. - repeated Operation operations = 1; - - // If any zones are listed here, the list of operations returned - // may be missing the operations from those zones. - repeated string missing_zones = 2; -} - -// Gets the current Kubernetes Engine service configuration. -message GetServerConfigRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) to return - // operations for. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The name (project and location) of the server config to get, - // specified in the format `projects/*/locations/*`. - string name = 4; -} - -// Kubernetes Engine service configuration. -message ServerConfig { - // ReleaseChannelConfig exposes configuration for a release channel. - message ReleaseChannelConfig { - // Deprecated. - message AvailableVersion { - option deprecated = true; - - // Kubernetes version. - string version = 1; - - // Reason for availability. - string reason = 2; - } - - // The release channel this configuration applies to. - ReleaseChannel.Channel channel = 1; - - // The default version for newly created clusters on the channel. - string default_version = 2; - - // Deprecated. - // This field has been deprecated and replaced with the valid_versions - // field. - repeated AvailableVersion available_versions = 3 [deprecated = true]; - - // List of valid versions for the channel. - repeated string valid_versions = 4; - } - - // Version of Kubernetes the service deploys by default. - string default_cluster_version = 1; - - // List of valid node upgrade target versions, in descending order. - repeated string valid_node_versions = 3; - - // Default image type. - string default_image_type = 4; - - // List of valid image types. - repeated string valid_image_types = 5; - - // List of valid master versions, in descending order. - repeated string valid_master_versions = 6; - - // List of release channel configurations. - repeated ReleaseChannelConfig channels = 9; - - // Maps of Kubernetes version and supported Windows server versions. - map windows_version_maps = 10; -} - -// Best effort provisioning. -message BestEffortProvisioning { - // When this is enabled, cluster/node pool creations will ignore non-fatal - // errors like stockout to best provision as many nodes as possible right now - // and eventually bring up all target number of nodes - bool enabled = 1; - - // Minimum number of nodes to be provisioned to be considered as succeeded, - // and the rest of nodes will be provisioned gradually and eventually when - // stockout issue has been resolved. - int32 min_provision_nodes = 2; -} - -// Windows server versions. -message WindowsVersions { - // Windows server version. - message WindowsVersion { - // Windows server image type - string image_type = 1; - - // Windows server build number - string os_version = 2; - - // Mainstream support end date - google.type.Date support_end_date = 3; - } - - // List of Windows server versions. - repeated WindowsVersion windows_versions = 1; -} - -// CreateNodePoolRequest creates a node pool for a cluster. -message CreateNodePoolRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the parent - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the parent field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. The node pool to create. - NodePool node_pool = 4 [(google.api.field_behavior) = REQUIRED]; - - // The parent (project, location, cluster name) where the node pool will be - // created. Specified in the format - // `projects/*/locations/*/clusters/*`. - string parent = 6; -} - -// DeleteNodePoolRequest deletes a node pool for a cluster. -message DeleteNodePoolRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the node pool to delete. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster, node pool id) of the node pool to - // delete. Specified in the format - // `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 6; -} - -// ListNodePoolsRequest lists the node pool(s) for a cluster. -message ListNodePoolsRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the parent - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the parent field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The parent (project, location, cluster name) where the node pools will be - // listed. Specified in the format `projects/*/locations/*/clusters/*`. - string parent = 5; -} - -// GetNodePoolRequest retrieves a node pool for a cluster. -message GetNodePoolRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the node pool. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster, node pool id) of the node pool to - // get. Specified in the format - // `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 6; -} - -// Settings for blue-green upgrade. -message BlueGreenSettings { - // Standard rollout policy is the default policy for blue-green. - message StandardRolloutPolicy { - // Blue pool size to drain in a batch. - oneof update_batch_size { - // Percentage of the blue pool nodes to drain in a batch. - // The range of this field should be (0.0, 1.0]. - float batch_percentage = 1; - - // Number of blue nodes to drain in a batch. - int32 batch_node_count = 2; - } - - // Soak time after each batch gets drained. Default to zero. - optional google.protobuf.Duration batch_soak_duration = 3; - } - - // The rollout policy controls the general rollout progress of blue-green. - oneof rollout_policy { - // Standard policy for the blue-green upgrade. - StandardRolloutPolicy standard_rollout_policy = 1; - } - - // Time needed after draining entire blue pool. After this period, blue pool - // will be cleaned up. - optional google.protobuf.Duration node_pool_soak_duration = 2; -} - -// 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. -// These upgrade settings control the level of parallelism and the level of -// disruption caused by an upgrade. -// -// maxUnavailable controls the number of nodes that can be simultaneously -// unavailable. -// -// maxSurge controls the number of additional nodes that can be added to the -// node pool temporarily for the time of the upgrade to increase the number of -// available nodes. -// -// (maxUnavailable + maxSurge) determines the level of parallelism (how many -// nodes are being upgraded at the same time). -// -// Note: upgrades inevitably introduce some disruption since workloads need to -// be moved from old nodes to new, upgraded ones. Even if maxUnavailable=0, -// this holds true. (Disruption stays within the limits of -// PodDisruptionBudget, if it is configured.) -// -// Consider a hypothetical node pool with 5 nodes having maxSurge=2, -// maxUnavailable=1. This means the upgrade process upgrades 3 nodes -// simultaneously. It creates 2 additional (upgraded) nodes, then it brings -// down 3 old (not yet upgraded) nodes at the same time. This ensures that -// there are always at least 4 nodes available. -message NodePool { - // These upgrade settings configure the upgrade strategy for the node pool. - // Use strategy to switch between the strategies applied to the node pool. - // - // If the strategy is SURGE, use max_surge and max_unavailable to control - // the level of parallelism and the level of disruption caused by upgrade. - // 1. maxSurge controls the number of additional nodes that can be added to - // the node pool temporarily for the time of the upgrade to increase the - // number of available nodes. - // 2. maxUnavailable controls the number of nodes that can be simultaneously - // unavailable. - // 3. (maxUnavailable + maxSurge) determines the level of parallelism (how - // many nodes are being upgraded at the same time). - // - // If the strategy is BLUE_GREEN, use blue_green_settings to configure the - // blue-green upgrade related settings. - // 1. standard_rollout_policy is the default policy. The policy is used to - // control the way blue pool gets drained. The draining is executed in the - // batch mode. The batch size could be specified as either percentage of the - // node pool size or the number of nodes. batch_soak_duration is the soak - // time after each batch gets drained. - // 2. node_pool_soak_duration is the soak time after all blue nodes are - // drained. After this period, the blue pool nodes will be deleted. - message UpgradeSettings { - // The maximum number of nodes that can be created beyond the current size - // of the node pool during the upgrade process. - int32 max_surge = 1; - - // The maximum number of nodes that can be simultaneously unavailable during - // the upgrade process. A node is considered available if its status is - // Ready. - int32 max_unavailable = 2; - - // Update strategy of the node pool. - optional NodePoolUpdateStrategy strategy = 3; - - // Settings for blue-green upgrade strategy. - optional BlueGreenSettings blue_green_settings = 4; - } - - // UpdateInfo contains resource (instance groups, etc), status and other - // intermediate information relevant to a node pool upgrade. - message UpdateInfo { - // Information relevant to blue-green upgrade. - message BlueGreenInfo { - // Phase represents the different stages blue-green upgrade is running in. - enum Phase { - // Unspecified phase. - PHASE_UNSPECIFIED = 0; - - // blue-green upgrade has been initiated. - UPDATE_STARTED = 1; - - // Start creating green pool nodes. - CREATING_GREEN_POOL = 2; - - // Start cordoning blue pool nodes. - CORDONING_BLUE_POOL = 3; - - // Start draining blue pool nodes. - DRAINING_BLUE_POOL = 4; - - // Start soaking time after draining entire blue pool. - NODE_POOL_SOAKING = 5; - - // Start deleting blue nodes. - DELETING_BLUE_POOL = 6; - - // Rollback has been initiated. - ROLLBACK_STARTED = 7; - } - - // Current blue-green upgrade phase. - Phase phase = 1; - - // The resource URLs of the [managed instance groups] - // (/compute/docs/instance-groups/creating-groups-of-managed-instances) - // associated with blue pool. - repeated string blue_instance_group_urls = 2; - - // The resource URLs of the [managed instance groups] - // (/compute/docs/instance-groups/creating-groups-of-managed-instances) - // associated with green pool. - repeated string green_instance_group_urls = 3; - - // Time to start deleting blue pool to complete blue-green upgrade, - // in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string blue_pool_deletion_start_time = 4; - - // Version of green pool. - string green_pool_version = 5; - } - - // Information of a blue-green upgrade. - BlueGreenInfo blue_green_info = 1; - } - - // The current status of the node pool instance. - enum Status { - // Not set. - STATUS_UNSPECIFIED = 0; - - // The PROVISIONING state indicates the node pool is being created. - PROVISIONING = 1; - - // The RUNNING state indicates the node pool has been created - // and is fully usable. - RUNNING = 2; - - // 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. - RUNNING_WITH_ERROR = 3; - - // 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. - RECONCILING = 4; - - // The STOPPING state indicates the node pool is being deleted. - STOPPING = 5; - - // The ERROR state indicates the node pool may be unusable. Details - // can be found in the `statusMessage` field. - ERROR = 6; - } - - // PlacementPolicy defines the placement policy used by the node pool. - message PlacementPolicy { - // Type defines the type of placement policy. - enum Type { - // TYPE_UNSPECIFIED specifies no requirements on nodes - // placement. - TYPE_UNSPECIFIED = 0; - - // COMPACT specifies node placement in the same availability domain to - // ensure low communication latency. - COMPACT = 1; - } - - // The type of placement. - Type type = 1; - - // TPU placement topology for pod slice node pool. - // https://cloud.google.com/tpu/docs/types-topologies#tpu_topologies - string tpu_topology = 2; - } - - // The name of the node pool. - string name = 1; - - // The node configuration of the pool. - NodeConfig config = 2; - - // The initial node count for the pool. You must ensure that your - // 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; - - // The list of Google Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) in which the - // NodePool's nodes should be located. - // - // If this value is unspecified during node pool creation, the - // [Cluster.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters#Cluster.FIELDS.locations) - // value will be used, instead. - // - // Warning: changing node pool locations will result in nodes being added - // and/or removed. - repeated string locations = 13; - - // Networking configuration for this NodePool. If specified, it overrides the - // cluster-level defaults. - NodeNetworkConfig network_config = 14; - - // [Output only] Server-defined URL for the resource. - string self_link = 100; - - // The version of Kubernetes running on this NodePool's nodes. If unspecified, - // it defaults as described - // [here](https://cloud.google.com/kubernetes-engine/versioning#specifying_node_version). - string version = 101; - - // [Output only] The resource URLs of the [managed instance - // groups](https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-managed-instances) - // associated with this node pool. - // During the node pool blue-green upgrade operation, the URLs contain both - // blue and green resources. - repeated string instance_group_urls = 102; - - // [Output only] The status of the nodes in this pool instance. - Status status = 103; - - // [Output only] Deprecated. Use conditions instead. - // Additional information about the current status of this - // node pool instance, if available. - string status_message = 104 [deprecated = true]; - - // Autoscaler configuration for this NodePool. Autoscaler is enabled - // only if a valid configuration is present. - NodePoolAutoscaling autoscaling = 4; - - // NodeManagement configuration for this NodePool. - NodeManagement management = 5; - - // The constraint on the maximum number of pods that can be run - // simultaneously on a node in the node pool. - MaxPodsConstraint max_pods_constraint = 6; - - // Which conditions caused the current node pool state. - repeated StatusCondition conditions = 105; - - // [Output only] The pod CIDR block size per node in this node pool. - int32 pod_ipv4_cidr_size = 7; - - // Upgrade settings control disruption and speed of the upgrade. - UpgradeSettings upgrade_settings = 107; - - // Specifies the node placement policy. - PlacementPolicy placement_policy = 108; - - // Output only. [Output only] Update info contains relevant information during - // a node pool update. - UpdateInfo update_info = 109 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // This checksum is computed by the server based on the value of node pool - // fields, and may be sent on update requests to ensure the client has an - // up-to-date value before proceeding. - string etag = 110; - - // Enable best effort provisioning for nodes - BestEffortProvisioning best_effort_provisioning = 113; -} - -// NodeManagement defines the set of node management services turned on for the -// node pool. -message NodeManagement { - // Whether the nodes will be automatically upgraded. - bool auto_upgrade = 1; - - // Whether the nodes will be automatically repaired. - bool auto_repair = 2; - - // Specifies the Auto Upgrade knobs for the node pool. - AutoUpgradeOptions upgrade_options = 10; -} - -// AutoUpgradeOptions defines the set of options for the user to control how -// the Auto Upgrades will proceed. -message AutoUpgradeOptions { - // [Output only] This field is set when upgrades are about to commence - // with the approximate start time for the upgrades, in - // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string auto_upgrade_start_time = 1; - - // [Output only] This field is set when upgrades are about to commence - // with the description of the upgrade. - string description = 2; -} - -// MaintenancePolicy defines the maintenance policy to be used for the cluster. -message MaintenancePolicy { - // Specifies the maintenance window in which maintenance may be performed. - MaintenanceWindow window = 1; - - // 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. - string resource_version = 3; -} - -// MaintenanceWindow defines the maintenance window to be used for the cluster. -message MaintenanceWindow { - // Unimplemented, reserved for future use. - // HourlyMaintenanceWindow hourly_maintenance_window = 1; - oneof policy { - // DailyMaintenanceWindow specifies a daily maintenance operation window. - DailyMaintenanceWindow daily_maintenance_window = 2; - - // 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. - RecurringTimeWindow recurring_window = 3; - } - - // Exceptions to maintenance window. Non-emergency maintenance should not - // occur in these windows. - map maintenance_exclusions = 4; -} - -// Represents an arbitrary window of time. -message TimeWindow { - oneof options { - // MaintenanceExclusionOptions provides maintenance exclusion related - // options. - MaintenanceExclusionOptions maintenance_exclusion_options = 3; - } - - // The time that the window first starts. - google.protobuf.Timestamp start_time = 1; - - // The time that the window ends. The end time should take place after the - // start time. - google.protobuf.Timestamp end_time = 2; -} - -// Represents the Maintenance exclusion option. -message MaintenanceExclusionOptions { - // Scope of exclusion. - enum Scope { - // NO_UPGRADES excludes all upgrades, including patch upgrades and minor - // upgrades across control planes and nodes. This is the default exclusion - // behavior. - NO_UPGRADES = 0; - - // NO_MINOR_UPGRADES excludes all minor upgrades for the cluster, only - // patches are allowed. - NO_MINOR_UPGRADES = 1; - - // NO_MINOR_OR_NODE_UPGRADES excludes all minor upgrades for the cluster, - // and also exclude all node pool upgrades. Only control - // plane patches are allowed. - NO_MINOR_OR_NODE_UPGRADES = 2; - } - - // Scope specifies the upgrade scope which upgrades are blocked by the - // exclusion. - Scope scope = 1; -} - -// Represents an arbitrary window of time that recurs. -message RecurringTimeWindow { - // The window of the first recurrence. - TimeWindow window = 1; - - // 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. - string recurrence = 2; -} - -// Time window specified for daily maintenance operations. -message DailyMaintenanceWindow { - // Time within the maintenance window to start the maintenance operations. - // It must be in format "HH:MM", where HH : [00-23] and MM : [00-59] GMT. - string start_time = 2; - - // [Output only] Duration of the time window, automatically chosen to be - // smallest possible in the given scenario. - string duration = 3; -} - -// SetNodePoolManagementRequest sets the node management properties of a node -// pool. -message SetNodePoolManagementRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to update. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the node pool to update. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. NodeManagement configuration for the node pool. - NodeManagement management = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster, node pool id) of the node pool to set - // management properties. Specified in the format - // `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 7; -} - -// SetNodePoolSizeRequest sets the size of a node pool. -message SetNodePoolSizeRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to update. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the node pool to update. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. The desired node count for the pool. - int32 node_count = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster, node pool id) of the node pool to set - // size. - // Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 7; -} - -// CompleteNodePoolUpgradeRequest sets the name of target node pool to complete -// upgrade. -message CompleteNodePoolUpgradeRequest { - // The name (project, location, cluster, node pool id) of the node pool to - // complete upgrade. - // Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 1; -} - -// RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed -// NodePool upgrade. This will be an no-op if the last upgrade successfully -// completed. -message RollbackNodePoolUpgradeRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to rollback. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the node pool to rollback. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster, node pool id) of the node poll to - // rollback upgrade. - // Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. - string name = 6; - - // Option for rollback to ignore the PodDisruptionBudget. - // Default value is false. - bool respect_pdb = 7; -} - -// ListNodePoolsResponse is the result of ListNodePoolsRequest. -message ListNodePoolsResponse { - // A list of node pools for a cluster. - repeated NodePool node_pools = 1; -} - -// 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. -message ClusterAutoscaling { - // Defines possible options for autoscaling_profile field. - enum AutoscalingProfile { - // No change to autoscaling configuration. - PROFILE_UNSPECIFIED = 0; - - // Prioritize optimizing utilization of resources. - OPTIMIZE_UTILIZATION = 1; - - // Use default (balanced) autoscaling configuration. - BALANCED = 2; - } - - // Enables automatic node pool creation and deletion. - bool enable_node_autoprovisioning = 1; - - // Contains global constraints regarding minimum and maximum - // amount of resources in the cluster. - repeated ResourceLimit resource_limits = 2; - - // Defines autoscaling behaviour. - AutoscalingProfile autoscaling_profile = 3; - - // AutoprovisioningNodePoolDefaults contains defaults for a node pool - // created by NAP. - AutoprovisioningNodePoolDefaults autoprovisioning_node_pool_defaults = 4; - - // The list of Google Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) in which the - // NodePool's nodes can be created by NAP. - repeated string autoprovisioning_locations = 5; -} - -// AutoprovisioningNodePoolDefaults contains defaults for a node pool created -// by NAP. -message AutoprovisioningNodePoolDefaults { - // 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](https://cloud.google.com/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. - repeated string oauth_scopes = 1; - - // The Google Cloud Platform Service Account to be used by the node VMs. - // Specify the email address of the Service Account; otherwise, if no Service - // Account is specified, the "default" service account is used. - string service_account = 2; - - // Upgrade settings control disruption and speed of the upgrade. - NodePool.UpgradeSettings upgrade_settings = 3; - - // NodeManagement configuration for this NodePool. - NodeManagement management = 4; - - // Deprecated. Minimum CPU platform to be used for NAP created node pools. - // 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](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform). - // This field is deprecated, min_cpu_platform should be specified using - // `cloud.google.com/requested-min-cpu-platform` label selector on the pod. - // To unset the min cpu platform field pass "automatic" - // as field value. - string min_cpu_platform = 5 [deprecated = true]; - - // 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. - int32 disk_size_gb = 6; - - // Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or - // 'pd-balanced') - // - // If unspecified, the default disk type is 'pd-standard' - string disk_type = 7; - - // Shielded Instance options. - ShieldedInstanceConfig shielded_instance_config = 8; - - // - // The Customer Managed Encryption Key used to encrypt the boot disk attached - // to each node in the node pool. This should be of the form - // projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. - // For more information about protecting resources with Cloud KMS Keys please - // see: - // https://cloud.google.com/compute/docs/disks/customer-managed-encryption - string boot_disk_kms_key = 9; - - // The image type to use for NAP created node. Please see - // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for - // available image types. - string image_type = 10; - - // Enable or disable Kubelet read only port. - optional bool insecure_kubelet_readonly_port_enabled = 13; -} - -// Contains information about amount of some resource in the cluster. -// For memory, value should be in GB. -message ResourceLimit { - // Resource name "cpu", "memory" or gpu-specific string. - string resource_type = 1; - - // Minimum amount of the resource in the cluster. - int64 minimum = 2; - - // Maximum amount of the resource in the cluster. - int64 maximum = 3; -} - -// NodePoolAutoscaling contains information required by cluster autoscaler to -// adjust the size of the node pool to the current cluster usage. -message NodePoolAutoscaling { - // Location policy specifies how zones are picked when scaling up the - // nodepool. - enum LocationPolicy { - // Not set. - LOCATION_POLICY_UNSPECIFIED = 0; - - // BALANCED is a best effort policy that aims to balance the sizes of - // different zones. - BALANCED = 1; - - // ANY policy picks zones that have the highest capacity available. - ANY = 2; - } - - // Is autoscaling enabled for this node pool. - bool enabled = 1; - - // Minimum number of nodes for one location in the NodePool. Must be >= 1 and - // <= max_node_count. - int32 min_node_count = 2; - - // Maximum number of nodes for one location in the NodePool. Must be >= - // min_node_count. There has to be enough quota to scale up the cluster. - int32 max_node_count = 3; - - // Can this node pool be deleted automatically. - bool autoprovisioned = 4; - - // Location policy used when scaling up a nodepool. - LocationPolicy location_policy = 5; - - // Minimum number of nodes in the node pool. Must be greater than 1 less than - // total_max_node_count. - // The total_*_node_count fields are mutually exclusive with the *_node_count - // fields. - int32 total_min_node_count = 6; - - // Maximum number of nodes in the node pool. Must be greater than - // total_min_node_count. There has to be enough quota to scale up the cluster. - // The total_*_node_count fields are mutually exclusive with the *_node_count - // fields. - int32 total_max_node_count = 7; -} - -// 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 -message SetLabelsRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. The labels to set for that cluster. - map resource_labels = 4 - [(google.api.field_behavior) = REQUIRED]; - - // 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. - string label_fingerprint = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster name) of the cluster to set labels. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 7; -} - -// SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for -// a cluster. -message SetLegacyAbacRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to update. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Whether ABAC authorization will be enabled in the cluster. - bool enabled = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster name) of the cluster to set legacy - // abac. Specified in the format `projects/*/locations/*/clusters/*`. - string name = 6; -} - -// StartIPRotationRequest creates a new IP for the cluster and then performs -// a node upgrade on each node pool to point to the new IP. -message StartIPRotationRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster name) of the cluster to start IP - // rotation. Specified in the format `projects/*/locations/*/clusters/*`. - string name = 6; - - // Whether to rotate credentials during IP rotation. - bool rotate_credentials = 7; -} - -// CompleteIPRotationRequest moves the cluster master back into single-IP mode. -message CompleteIPRotationRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster name) of the cluster to complete IP - // rotation. Specified in the format `projects/*/locations/*/clusters/*`. - string name = 7; -} - -// AcceleratorConfig represents a Hardware Accelerator request. -message AcceleratorConfig { - // The number of the accelerator cards exposed to an instance. - int64 accelerator_count = 1; - - // The accelerator type resource name. List of supported accelerators - // [here](https://cloud.google.com/compute/docs/gpus) - string accelerator_type = 2; - - // Size of partitions to create on the GPU. Valid values are described in the - // NVIDIA [mig user - // guide](https://docs.nvidia.com/datacenter/tesla/mig-user-guide/#partitioning). - string gpu_partition_size = 3; - - // The number of time-shared GPU resources to expose for each physical GPU. - int64 max_time_shared_clients_per_gpu = 4 [deprecated = true]; - - // The configuration for GPU sharing options. - optional GPUSharingConfig gpu_sharing_config = 5; - - // The configuration for auto installation of GPU driver. - optional GPUDriverInstallationConfig gpu_driver_installation_config = 6; -} - -// GPUSharingConfig represents the GPU sharing configuration for Hardware -// Accelerators. -message GPUSharingConfig { - // The type of GPU sharing strategy currently provided. - enum GPUSharingStrategy { - // Default value. - GPU_SHARING_STRATEGY_UNSPECIFIED = 0; - - // GPUs are time-shared between containers. - TIME_SHARING = 1; - } - - // The max number of containers that can share a physical GPU. - int64 max_shared_clients_per_gpu = 1; - - // The type of GPU sharing strategy to enable on the GPU node. - optional GPUSharingStrategy gpu_sharing_strategy = 2; -} - -// GPUDriverInstallationConfig specifies the version of GPU driver to be auto -// installed. -message GPUDriverInstallationConfig { - // The GPU driver version to install. - enum GPUDriverVersion { - // Default value is to not install any GPU driver. - GPU_DRIVER_VERSION_UNSPECIFIED = 0; - - // Disable GPU driver auto installation and needs manual installation - INSTALLATION_DISABLED = 1; - - // "Default" GPU driver in COS and Ubuntu. - DEFAULT = 2; - - // "Latest" GPU driver in COS. - LATEST = 3; - } - - // Mode for how the GPU driver is installed. - optional GPUDriverVersion gpu_driver_version = 1; -} - -// ManagedPrometheusConfig defines the configuration for -// Google Cloud Managed Service for Prometheus. -message ManagedPrometheusConfig { - // Enable Managed Collection. - bool enabled = 1; -} - -// WorkloadMetadataConfig defines the metadata configuration to expose to -// workloads on the node pool. -message WorkloadMetadataConfig { - // NodeMetadata is the configuration for if and how to expose the node - // metadata to the workload running on the node. - enum NodeMetadata { - // Not set. - UNSPECIFIED = 0; - - // Prevent workloads not in hostNetwork from accessing certain VM metadata, - // specifically kube-env, which contains Kubelet credentials, and the - // instance identity token. - // - // Metadata concealment is a temporary security solution available while the - // bootstrapping process for cluster nodes is being redesigned with - // significant security improvements. This feature is scheduled to be - // deprecated in the future and later removed. - SECURE = 1; - - // Expose all VM metadata to pods. - EXPOSE = 2; - - // Run the GKE Metadata Server on this node. The GKE Metadata Server exposes - // a metadata API to workloads that is compatible with the V1 Compute - // Metadata APIs exposed by the Compute Engine and App Engine Metadata - // Servers. This feature can only be enabled if Workload Identity is enabled - // at the cluster level. - GKE_METADATA_SERVER = 3; - } - - // Mode is the configuration for how to expose metadata to workloads running - // on the node. - enum Mode { - // Not set. - MODE_UNSPECIFIED = 0; - - // Expose all Compute Engine metadata to pods. - GCE_METADATA = 1; - - // Run the GKE Metadata Server on this node. The GKE Metadata Server exposes - // a metadata API to workloads that is compatible with the V1 Compute - // Metadata APIs exposed by the Compute Engine and App Engine Metadata - // Servers. This feature can only be enabled if Workload Identity is enabled - // at the cluster level. - GKE_METADATA = 2; - } - - // NodeMetadata is the configuration for how to expose metadata to the - // workloads running on the node. - NodeMetadata node_metadata = 1 [deprecated = true]; - - // Mode is the configuration for how to expose metadata to workloads running - // on the node pool. - Mode mode = 2; -} - -// SetNetworkPolicyRequest enables/disables network policy for a cluster. -message SetNetworkPolicyRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - // This field has been deprecated and replaced by the name field. - string project_id = 1 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. This field has been deprecated and replaced by the name - // field. - string zone = 2 [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 - [deprecated = true, (google.api.field_behavior) = REQUIRED]; - - // Required. Configuration options for the NetworkPolicy feature. - NetworkPolicy network_policy = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster name) of the cluster to set networking - // policy. Specified in the format `projects/*/locations/*/clusters/*`. - string name = 6; -} - -// SetMaintenancePolicyRequest sets the maintenance policy for a cluster. -message SetMaintenancePolicyRequest { - // Required. The Google Developers Console [project ID or project - // number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the Google Compute Engine - // [zone](https://cloud.google.com/compute/docs/zones#available) in which the - // cluster resides. - string zone = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the cluster to update. - string cluster_id = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. The maintenance policy to be set for the cluster. An empty field - // clears the existing maintenance policy. - MaintenancePolicy maintenance_policy = 4 - [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster name) of the cluster to set - // maintenance policy. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 5; -} - -// ListLocationsRequest is used to request the locations that offer GKE. -message ListLocationsRequest { - // Required. Contains the name of the resource requested. - // Specified in the format `projects/*`. - string parent = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// ListLocationsResponse returns the list of all GKE locations and their -// recommendation state. -message ListLocationsResponse { - // A full list of GKE locations. - repeated Location locations = 1; - - // Only return ListLocationsResponse that occur after the page_token. This - // value should be populated from the ListLocationsResponse.next_page_token if - // that response token was set (which happens when listing more Locations than - // fit in a single ListLocationsResponse). - string next_page_token = 2; -} - -// Location returns the location name, and if the location is recommended -// for GKE cluster scheduling. -message Location { - // LocationType is the type of GKE location, regional or zonal. - enum LocationType { - // LOCATION_TYPE_UNSPECIFIED means the location type was not determined. - LOCATION_TYPE_UNSPECIFIED = 0; - - // A GKE Location where Zonal clusters can be created. - ZONE = 1; - - // A GKE Location where Regional clusters can be created. - REGION = 2; - } - - // Contains the type of location this Location is for. - // Regional or Zonal. - LocationType type = 1; - - // Contains the name of the resource requested. - // Specified in the format `projects/*/locations/*`. - string name = 2; - - // Whether the location is recommended for GKE cluster scheduling. - bool recommended = 3; -} - -// StatusCondition describes why a cluster or a node pool has a certain status -// (e.g., ERROR or DEGRADED). -message StatusCondition { - // Code for each condition - enum Code { - option deprecated = true; - - // UNKNOWN indicates a generic condition. - UNKNOWN = 0; - - // GCE_STOCKOUT indicates that Google Compute Engine resources are - // temporarily unavailable. - GCE_STOCKOUT = 1; - - // GKE_SERVICE_ACCOUNT_DELETED indicates that the user deleted their robot - // service account. - GKE_SERVICE_ACCOUNT_DELETED = 2; - - // Google Compute Engine quota was exceeded. - GCE_QUOTA_EXCEEDED = 3; - - // Cluster state was manually changed by an SRE due to a system logic error. - SET_BY_OPERATOR = 4; - - // Unable to perform an encrypt operation against the CloudKMS key used for - // etcd level encryption. - CLOUD_KMS_KEY_ERROR = 7; - - // Cluster CA is expiring soon. - // More codes TBA - CA_EXPIRING = 9; - } - - // Machine-friendly representation of the condition - // Deprecated. Use canonical_code instead. - Code code = 1 [deprecated = true]; - - // Human-friendly representation of the condition - string message = 2; - - // Canonical code of the condition. - google.rpc.Code canonical_code = 3; -} - -// NetworkConfig reports the relative names of network & subnetwork. -message NetworkConfig { - // Configuration of all network bandwidth tiers - message ClusterNetworkPerformanceConfig { - // Node network tier - enum Tier { - // Default value - TIER_UNSPECIFIED = 0; - - // Higher bandwidth, actual values based on VM size. - TIER_1 = 1; - } - - // Specifies the total network bandwidth tier for the NodePool. - optional Tier total_egress_bandwidth_tier = 1; - } - - // Output only. The relative name of the Google Compute Engine - // [network][google.container.v1beta1.NetworkConfig.network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) - // to which the cluster is connected. Example: - // projects/my-project/global/networks/my-network - string network = 1; - - // Output only. The relative name of the Google Compute Engine - // [subnetwork](https://cloud.google.com/compute/docs/vpc) to which the - // cluster is connected. Example: - // projects/my-project/regions/us-central1/subnetworks/my-subnet - string subnetwork = 2; - - // Whether Intra-node visibility is enabled for this cluster. - // This makes same node pod to pod traffic visible for VPC network. - bool enable_intra_node_visibility = 5; - - // Whether the cluster disables default in-node sNAT rules. In-node sNAT rules - // will be disabled when default_snat_status is disabled. When disabled is set - // to false, default IP masquerade rules will be applied to the nodes to - // prevent sNAT on cluster internal traffic. - DefaultSnatStatus default_snat_status = 7; - - // Whether L4ILB Subsetting is enabled for this cluster. - bool enable_l4ilb_subsetting = 10; - - // The desired datapath provider for this cluster. By default, uses the - // IPTables-based kube-proxy implementation. - DatapathProvider datapath_provider = 11; - - // The desired state of IPv6 connectivity to Google Services. - // By default, no private IPv6 access to or from Google Services (all access - // will be via IPv4) - PrivateIPv6GoogleAccess private_ipv6_google_access = 12; - - // DNSConfig contains clusterDNS config for this cluster. - DNSConfig dns_config = 13; - - // ServiceExternalIPsConfig specifies if services with externalIPs field are - // blocked or not. - ServiceExternalIPsConfig service_external_ips_config = 15; - - // GatewayAPIConfig contains the desired config of Gateway API on this - // cluster. - GatewayAPIConfig gateway_api_config = 16; - - // Network bandwidth tier configuration. - ClusterNetworkPerformanceConfig network_performance_config = 18; - - // Whether FQDN Network Policy is enabled on this cluster. - optional bool enable_fqdn_network_policy = 19; -} - -// GatewayAPIConfig contains the desired config of Gateway API on this cluster. -message GatewayAPIConfig { - // Channel describes if/how Gateway API should be installed and implemented in - // a cluster. - enum Channel { - // Default value. - CHANNEL_UNSPECIFIED = 0; - - // Gateway API support is disabled - CHANNEL_DISABLED = 1; - - // Gateway API support is enabled, experimental CRDs are installed - CHANNEL_EXPERIMENTAL = 3; - - // Gateway API support is enabled, standard CRDs are installed - CHANNEL_STANDARD = 4; - } - - // The Gateway API release channel to use for Gateway API. - Channel channel = 1; -} - -// Config to block services with externalIPs field. -message ServiceExternalIPsConfig { - // Whether Services with ExternalIPs field are allowed or not. - bool enabled = 1; -} - -// ListUsableSubnetworksRequest requests the list of usable subnetworks. -// available to a user for creating clusters. -message ListUsableSubnetworksRequest { - // Required. The parent project where subnetworks are usable. - // Specified in the format `projects/*`. - string parent = 1 [(google.api.field_behavior) = REQUIRED]; - - // 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. - string filter = 2; - - // 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) - int32 page_size = 3; - - // Specifies a page token to use. Set this to the nextPageToken returned by - // previous list requests to get the next page of results. - string page_token = 4; -} - -// ListUsableSubnetworksResponse is the response of -// ListUsableSubnetworksRequest. -message ListUsableSubnetworksResponse { - // A list of usable subnetworks in the specified network project. - repeated UsableSubnetwork subnetworks = 1; - - // 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. - string next_page_token = 2; -} - -// Secondary IP range of a usable subnetwork. -message UsableSubnetworkSecondaryRange { - // Status shows the current usage of a secondary IP range. - enum Status { - // UNKNOWN is the zero value of the Status enum. It's not a valid status. - UNKNOWN = 0; - - // UNUSED denotes that this range is unclaimed by any cluster. - UNUSED = 1; - - // IN_USE_SERVICE denotes that this range is claimed by a cluster for - // services. It cannot be used for other clusters. - IN_USE_SERVICE = 2; - - // 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_SHAREABLE_POD = 3; - - // IN_USE_MANAGED_POD denotes this range was created by GKE and is claimed - // for pods. It cannot be used for other clusters. - IN_USE_MANAGED_POD = 4; - } - - // The name associated with this subnetwork secondary range, used when adding - // an alias IP range to a VM instance. - string range_name = 1; - - // The range of IP addresses belonging to this subnetwork secondary range. - string ip_cidr_range = 2; - - // This field is to determine the status of the secondary range programmably. - Status status = 3; -} - -// UsableSubnetwork resource returns the subnetwork name, its associated network -// and the primary CIDR range. -message UsableSubnetwork { - // Subnetwork Name. - // Example: projects/my-project/regions/us-central1/subnetworks/my-subnet - string subnetwork = 1; - - // Network Name. - // Example: projects/my-project/global/networks/my-network - string network = 2; - - // The range of internal addresses that are owned by this subnetwork. - string ip_cidr_range = 3; - - // Secondary IP ranges. - repeated UsableSubnetworkSecondaryRange secondary_ip_ranges = 4; - - // 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. - string status_message = 5; -} - -// VerticalPodAutoscaling contains global, per-cluster information -// required by Vertical Pod Autoscaler to automatically adjust -// the resources of pods controlled by it. -message VerticalPodAutoscaling { - // Enables vertical pod autoscaling. - bool enabled = 1; -} - -// DefaultSnatStatus contains the desired state of whether default sNAT should -// be disabled on the cluster. -message DefaultSnatStatus { - // Disables cluster default sNAT rules. - bool disabled = 1; -} - -// IntraNodeVisibilityConfig contains the desired config of the intra-node -// visibility on this cluster. -message IntraNodeVisibilityConfig { - // Enables intra node visibility for this cluster. - bool enabled = 1; -} - -// ILBSubsettingConfig contains the desired config of L4 Internal LoadBalancer -// subsetting on this cluster. -message ILBSubsettingConfig { - // Enables l4 ILB subsetting for this cluster - bool enabled = 1; -} - -// DNSConfig contains the desired set of options for configuring clusterDNS. -message DNSConfig { - // Provider lists the various in-cluster DNS providers. - enum Provider { - // Default value - PROVIDER_UNSPECIFIED = 0; - - // Use GKE default DNS provider(kube-dns) for DNS resolution. - PLATFORM_DEFAULT = 1; - - // Use CloudDNS for DNS resolution. - CLOUD_DNS = 2; - - // Use KubeDNS for DNS resolution. - KUBE_DNS = 3; - } - - // DNSScope lists the various scopes of access to cluster DNS records. - enum DNSScope { - // Default value, will be inferred as cluster scope. - DNS_SCOPE_UNSPECIFIED = 0; - - // DNS records are accessible from within the cluster. - CLUSTER_SCOPE = 1; - - // DNS records are accessible from within the VPC. - VPC_SCOPE = 2; - } - - // cluster_dns indicates which in-cluster DNS provider should be used. - Provider cluster_dns = 1; - - // cluster_dns_scope indicates the scope of access to cluster DNS records. - DNSScope cluster_dns_scope = 2; - - // cluster_dns_domain is the suffix used for all cluster service records. - string cluster_dns_domain = 3; -} - -// Constraints applied to pods. -message MaxPodsConstraint { - // Constraint enforced on the max num of pods per node. - int64 max_pods_per_node = 1; -} - -// Configuration for the use of Kubernetes Service Accounts in GCP IAM -// policies. -message WorkloadIdentityConfig { - // IAM Identity Namespace to attach all Kubernetes Service Accounts to. - string identity_namespace = 1 [deprecated = true]; - - // The workload pool to attach all Kubernetes service accounts to. - string workload_pool = 2; - - // identity provider is the third party identity provider. - string identity_provider = 3; -} - -// Configuration for direct-path (via ALTS) with workload identity. -message WorkloadALTSConfig { - // enable_alts controls whether the alts handshaker should be enabled or not - // for direct-path. - // - // Requires Workload Identity - // ([workload_pool][google.container.v1beta1.WorkloadIdentityConfig.workload_pool] - // must be non-empty). - google.protobuf.BoolValue enable_alts = 1; -} - -// Configuration for issuance of mTLS keys and certificates to Kubernetes pods. -message WorkloadCertificates { - // enable_certificates controls issuance of workload mTLS certificates. - // - // If set, the GKE Workload Identity Certificates controller and node agent - // will be deployed in the cluster, which can then be configured by creating a - // WorkloadCertificateConfig Custom Resource. - // - // Requires Workload Identity - // ([workload_pool][google.container.v1beta1.WorkloadIdentityConfig.workload_pool] - // must be non-empty). - google.protobuf.BoolValue enable_certificates = 1; -} - -// Configuration for issuance of mTLS keys and certificates to Kubernetes pods. -message MeshCertificates { - // enable_certificates controls issuance of workload mTLS certificates. - // - // If set, the GKE Workload Identity Certificates controller and node agent - // will be deployed in the cluster, which can then be configured by creating a - // WorkloadCertificateConfig Custom Resource. - // - // Requires Workload Identity - // ([workload_pool][google.container.v1alpha1.WorkloadIdentityConfig.workload_pool] - // must be non-empty). - google.protobuf.BoolValue enable_certificates = 1; -} - -// Configuration of etcd encryption. -message DatabaseEncryption { - // State of etcd encryption. - enum State { - // Should never be set - UNKNOWN = 0; - - // Secrets in etcd are encrypted. - ENCRYPTED = 1; - - // Secrets in etcd are stored in plain text (at etcd level) - this is - // unrelated to Compute Engine level full disk encryption. - DECRYPTED = 2; - } - - // 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 - string key_name = 1; - - // The desired state of etcd encryption. - State state = 2; -} - -// Configuration for exporting cluster resource usages. -message ResourceUsageExportConfig { - // Parameters for using BigQuery as the destination of resource usage export. - message BigQueryDestination { - // The ID of a BigQuery Dataset. - string dataset_id = 1; - } - - // Parameters for controlling consumption metering. - message ConsumptionMeteringConfig { - // Whether to enable consumption metering for this cluster. If enabled, a - // second BigQuery table will be created to hold resource consumption - // records. - bool enabled = 1; - } - - // Configuration to use BigQuery as usage export destination. - BigQueryDestination bigquery_destination = 1; - - // Whether to enable network egress metering for this cluster. If enabled, a - // daemonset will be created in the cluster to meter network egress traffic. - bool enable_network_egress_metering = 2; - - // Configuration to enable resource consumption metering. - ConsumptionMeteringConfig consumption_metering_config = 3; -} - -// Configuration of Shielded Nodes feature. -message ShieldedNodes { - // Whether Shielded Nodes features are enabled on all nodes in this cluster. - bool enabled = 1; -} - -// Configuration of gVNIC feature. -message VirtualNIC { - // Whether gVNIC features are enabled in the node pool. - bool enabled = 1; -} - -// Configuration of Fast Socket feature. -message FastSocket { - // Whether Fast Socket features are enabled in the node pool. - bool enabled = 1; -} - -// GetOpenIDConfigRequest gets the OIDC discovery document for the -// cluster. See the OpenID Connect Discovery 1.0 specification for details. -message GetOpenIDConfigRequest { - // The cluster (project, location, cluster name) to get the discovery document - // for. Specified in the format `projects/*/locations/*/clusters/*`. - string parent = 1; -} - -// GetOpenIDConfigResponse is an OIDC discovery document for the cluster. -// See the OpenID Connect Discovery 1.0 specification for details. -message GetOpenIDConfigResponse { - // OIDC Issuer. - string issuer = 1; - - // JSON Web Key uri. - string jwks_uri = 2; - - // Supported response types. - repeated string response_types_supported = 3; - - // Supported subject types. - repeated string subject_types_supported = 4; - - // supported ID Token signing Algorithms. - repeated string id_token_signing_alg_values_supported = 5; - - // Supported claims. - repeated string claims_supported = 6; - - // Supported grant types. - repeated string grant_types = 7; -} - -// GetJSONWebKeysRequest gets the public component of the keys used by the -// cluster to sign token requests. This will be the jwks_uri for the discover -// document returned by getOpenIDConfig. See the OpenID Connect -// Discovery 1.0 specification for details. -message GetJSONWebKeysRequest { - // The cluster (project, location, cluster name) to get keys for. Specified in - // the format `projects/*/locations/*/clusters/*`. - string parent = 1; -} - -// Jwk is a JSON Web Key as specified in RFC 7517 -message Jwk { - // Key Type. - string kty = 1; - - // Algorithm. - string alg = 2; - - // Permitted uses for the public keys. - string use = 3; - - // Key ID. - string kid = 4; - - // Used for RSA keys. - string n = 5; - - // Used for RSA keys. - string e = 6; - - // Used for ECDSA keys. - string x = 7; - - // Used for ECDSA keys. - string y = 8; - - // Used for ECDSA keys. - string crv = 9; -} - -// GetJSONWebKeysResponse is a valid JSON Web Key Set as specififed in rfc 7517 -message GetJSONWebKeysResponse { - // The public component of the keys used by the cluster to sign token - // requests. - repeated Jwk keys = 1; -} - -// CheckAutopilotCompatibilityRequest requests getting the blockers for the -// given operation in the cluster. -message CheckAutopilotCompatibilityRequest { - // The name (project, location, cluster) of the cluster to retrieve. - // Specified in the format `projects/*/locations/*/clusters/*`. - string name = 1; -} - -// AutopilotCompatibilityIssue contains information about a specific -// compatibility issue with Autopilot mode. -message AutopilotCompatibilityIssue { - // The type of the reported issue. - enum IssueType { - // Default value, should not be used. - UNSPECIFIED = 0; - - // Indicates that the issue is a known incompatibility between the - // cluster and Autopilot mode. - INCOMPATIBILITY = 1; - - // Indicates the issue is an incompatibility if customers take no further - // action to resolve. - ADDITIONAL_CONFIG_REQUIRED = 2; - - // Indicates the issue is not an incompatibility, but depending on the - // workloads business logic, there is a potential that they won't work on - // Autopilot. - PASSED_WITH_OPTIONAL_CONFIG = 3; - } - - // The last time when this issue was observed. - google.protobuf.Timestamp last_observation = 1; - - // The constraint type of the issue. - string constraint_type = 2; - - // The incompatibility type of this issue. - IssueType incompatibility_type = 3; - - // The name of the resources which are subject to this issue. - repeated string subjects = 4; - - // A URL to a public documnetation, which addresses resolving this issue. - string documentation_url = 5; - - // The description of the issue. - string description = 6; -} - -// CheckAutopilotCompatibilityResponse has a list of compatibility issues. -message CheckAutopilotCompatibilityResponse { - // The list of issues for the given operation. - repeated AutopilotCompatibilityIssue issues = 1; - - // The summary of the autopilot compatibility response. - string summary = 2; -} - -// ReleaseChannel indicates which release channel a cluster is -// subscribed to. Release channels are arranged in order of risk. -// -// When a cluster is subscribed to a release channel, Google maintains -// both the master version and the node version. Node auto-upgrade -// defaults to true and cannot be disabled. -message ReleaseChannel { - // Possible values for 'channel'. - enum Channel { - // No channel specified. - UNSPECIFIED = 0; - - // RAPID channel is offered on an early access basis for customers who want - // to test new releases. - // - // WARNING: Versions available in the RAPID Channel may be subject to - // unresolved issues with no known workaround and are not subject to any - // SLAs. - RAPID = 1; - - // Clusters subscribed to REGULAR receive versions that are considered GA - // quality. REGULAR is intended for production users who want to take - // advantage of new features. - REGULAR = 2; - - // Clusters subscribed to STABLE receive versions that are known to be - // stable and reliable in production. - STABLE = 3; - } - - // channel specifies which release channel the cluster is subscribed to. - Channel channel = 1; -} - -// Configuration for fine-grained cost management feature. -message CostManagementConfig { - // Whether the feature is enabled or not. - bool enabled = 1; -} - -// Configuration for Cloud TPU. -message TpuConfig { - // Whether Cloud TPU integration is enabled or not. - bool enabled = 1; - - // Whether to use service networking for Cloud TPU or not. - bool use_service_networking = 2; - - // IPv4 CIDR block reserved for Cloud TPU in the VPC. - string ipv4_cidr_block = 3; -} - -// PrivateIPv6GoogleAccess controls whether and how the pods can communicate -// with Google Services through gRPC over IPv6. -enum PrivateIPv6GoogleAccess { - // Default value. Same as DISABLED - PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0; - - // No private access to or from Google Services - PRIVATE_IPV6_GOOGLE_ACCESS_DISABLED = 1; - - // Enables private IPv6 access to Google Services from GKE - PRIVATE_IPV6_GOOGLE_ACCESS_TO_GOOGLE = 2; - - // Enables private IPv6 access to and from Google Services - PRIVATE_IPV6_GOOGLE_ACCESS_BIDIRECTIONAL = 3; -} - -// Master is the configuration for components on master. -message Master {} - -// Autopilot is the configuration for Autopilot settings on the cluster. -message Autopilot { - // Enable Autopilot - bool enabled = 1; - - // Workload policy configuration for Autopilot. - WorkloadPolicyConfig workload_policy_config = 2; -} - -// WorkloadPolicyConfig is the configuration of workload policy for autopilot -// clusters. -message WorkloadPolicyConfig { - // If true, workloads can use NET_ADMIN capability. - optional bool allow_net_admin = 1; -} - -// NotificationConfig is the configuration of notifications. -message NotificationConfig { - // Types of notifications currently supported. Can be used to filter what - // notifications are sent. - enum EventType { - // Not set, will be ignored. - EVENT_TYPE_UNSPECIFIED = 0; - - // Corresponds with UpgradeAvailableEvent. - UPGRADE_AVAILABLE_EVENT = 1; - - // Corresponds with UpgradeEvent. - UPGRADE_EVENT = 2; - - // Corresponds with SecurityBulletinEvent. - SECURITY_BULLETIN_EVENT = 3; - } - - // Pub/Sub specific notification config. - message PubSub { - // Enable notifications for Pub/Sub. - bool enabled = 1; - - // The desired Pub/Sub topic to which notifications will be - // sent by GKE. Format is `projects/{project}/topics/{topic}`. - string topic = 2 [ - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } - ]; - - // Allows filtering to one or more specific event types. If no filter is - // specified, or if a filter is specified with no event types, all event - // types will be sent - Filter filter = 3; - } - - // Allows filtering to one or more specific event types. If event types are - // present, those and only those event types will be transmitted to the - // cluster. Other types will be skipped. If no filter is specified, or no - // event types are present, all event types will be sent - message Filter { - // Event types to allowlist. - repeated EventType event_type = 1; - } - - // Notification config for Pub/Sub. - PubSub pubsub = 1; -} - -// ConfidentialNodes is configuration for the confidential nodes feature, which -// makes nodes run on confidential VMs. -message ConfidentialNodes { - // Whether Confidential Nodes feature is enabled. - bool enabled = 1; -} - -// UpgradeResourceType is the resource type that is upgrading. It is used -// in upgrade notifications. -enum UpgradeResourceType { - // Default value. This shouldn't be used. - UPGRADE_RESOURCE_TYPE_UNSPECIFIED = 0; - - // Master / control plane - MASTER = 1; - - // Node pool - NODE_POOL = 2; -} - -// UpgradeEvent is a notification sent to customers by the cluster server when -// a resource is upgrading. -message UpgradeEvent { - // The resource type that is upgrading. - UpgradeResourceType resource_type = 1; - - // The operation associated with this upgrade. - string operation = 2; - - // The time when the operation was started. - google.protobuf.Timestamp operation_start_time = 3; - - // The current version before the upgrade. - string current_version = 4; - - // The target version for the upgrade. - string target_version = 5; - - // Optional relative path to the resource. For example in node pool upgrades, - // the relative path of the node pool. - string resource = 6; -} - -// UpgradeAvailableEvent is a notification sent to customers when a new -// available version is released. -message UpgradeAvailableEvent { - // The release version available for upgrade. - string version = 1; - - // The resource type of the release version. - UpgradeResourceType resource_type = 2; - - // The release channel of the version. If empty, it means a non-channel - // release. - ReleaseChannel release_channel = 3; - - // Optional relative path to the resource. For example, the relative path of - // the node pool. - string resource = 4; - - // Windows node versions info. - WindowsVersions windows_versions = 5; -} - -// SecurityBulletinEvent is a notification sent to customers when a security -// bulletin has been posted that they are vulnerable to. -message SecurityBulletinEvent { - // The resource type (node/control plane) that has the vulnerability. Multiple - // notifications (1 notification per resource type) will be sent for a - // vulnerability that affects > 1 resource type. - string resource_type_affected = 1; - - // The ID of the bulletin corresponding to the vulnerability. - string bulletin_id = 2; - - // The CVEs associated with this bulletin. - repeated string cve_ids = 3; - - // The severity of this bulletin as it relates to GKE. - string severity = 4; - - // The URI link to the bulletin on the website for more information. - string bulletin_uri = 5; - - // A brief description of the bulletin. See the bulletin pointed to by the - // bulletin_uri field for an expanded description. - string brief_description = 6; - - // The GKE minor versions affected by this vulnerability. - repeated string affected_supported_minors = 7; - - // The GKE versions where this vulnerability is patched. - repeated string patched_versions = 8; - - // This represents a version selected from the patched_versions field that - // the cluster receiving this notification should most likely want to upgrade - // to based on its current version. Note that if this notification is being - // received by a given cluster, it means that this version is currently - // available as an upgrade target in that cluster's location. - string suggested_upgrade_target = 9; - - // If this field is specified, it means there are manual steps that the user - // must take to make their clusters safe. - bool manual_steps_required = 10; -} - -// IdentityServiceConfig is configuration for Identity Service which allows -// customers to use external identity providers with the K8S API -message IdentityServiceConfig { - // Whether to enable the Identity Service component - bool enabled = 1; -} - -// Strategy used for node pool update. -enum NodePoolUpdateStrategy { - // Default value if unset. GKE internally defaults the update strategy to - // SURGE for unspecified strategies. - NODE_POOL_UPDATE_STRATEGY_UNSPECIFIED = 0; - - // blue-green upgrade. - BLUE_GREEN = 2; - - // SURGE is the traditional way of upgrading a node pool. - // max_surge and max_unavailable determines the level of upgrade parallelism. - SURGE = 3; -} - -// LoggingConfig is cluster logging configuration. -message LoggingConfig { - // Logging components configuration - LoggingComponentConfig component_config = 1; -} - -// LoggingComponentConfig is cluster logging component configuration. -message LoggingComponentConfig { - // GKE components exposing logs - enum Component { - // Default value. This shouldn't be used. - COMPONENT_UNSPECIFIED = 0; - - // system components - SYSTEM_COMPONENTS = 1; - - // workloads - WORKLOADS = 2; - - // kube-apiserver - APISERVER = 3; - - // kube-scheduler - SCHEDULER = 4; - - // kube-controller-manager - CONTROLLER_MANAGER = 5; - } - - // Select components to collect logs. An empty set would disable all logging. - repeated Component enable_components = 1; -} - -// MonitoringConfig is cluster monitoring configuration. -message MonitoringConfig { - // Monitoring components configuration - MonitoringComponentConfig component_config = 1; - - // Enable Google Cloud Managed Service for Prometheus - // in the cluster. - ManagedPrometheusConfig managed_prometheus_config = 2; - - // Configuration of Advanced Datapath Observability features. - AdvancedDatapathObservabilityConfig advanced_datapath_observability_config = - 3; -} - -// AdvancedDatapathObservabilityConfig specifies configuration of observability -// features of advanced datapath. -message AdvancedDatapathObservabilityConfig { - // Supported Relay modes - enum RelayMode { - // Default value. This shouldn't be used. - RELAY_MODE_UNSPECIFIED = 0; - - // disabled - DISABLED = 1; - - // exposed via internal load balancer - INTERNAL_VPC_LB = 3; - - // exposed via external load balancer - EXTERNAL_LB = 4; - } - - // Expose flow metrics on nodes - bool enable_metrics = 1; - - // Method used to make Relay available - RelayMode relay_mode = 2; -} - -// NodePoolLoggingConfig specifies logging configuration for nodepools. -message NodePoolLoggingConfig { - // Logging variant configuration. - LoggingVariantConfig variant_config = 1; -} - -// LoggingVariantConfig specifies the behaviour of the logging component. -message LoggingVariantConfig { - // Logging component variants. - enum Variant { - // Default value. This shouldn't be used. - VARIANT_UNSPECIFIED = 0; - - // default logging variant. - DEFAULT = 1; - - // maximum logging throughput variant. - MAX_THROUGHPUT = 2; - } - - // Logging variant deployed on nodes. - Variant variant = 1; -} - -// MonitoringComponentConfig is cluster monitoring component configuration. -message MonitoringComponentConfig { - // GKE components exposing metrics - enum Component { - // Default value. This shouldn't be used. - COMPONENT_UNSPECIFIED = 0; - - // system components - SYSTEM_COMPONENTS = 1; - - // Deprecated: Use Google Cloud Managed Service for Prometheus. - WORKLOADS = 2 [deprecated = true]; - - // kube-apiserver - APISERVER = 3; - - // kube-scheduler - SCHEDULER = 4; - - // kube-controller-manager - CONTROLLER_MANAGER = 5; - } - - // Select components to collect metrics. An empty set would disable all - // monitoring. - repeated Component enable_components = 1; -} - -// The datapath provider selects the implementation of the Kubernetes networking -// model for service resolution and network policy enforcement. -enum DatapathProvider { - // Default value. - DATAPATH_PROVIDER_UNSPECIFIED = 0; - - // Use the IPTables implementation based on kube-proxy. - LEGACY_DATAPATH = 1; - - // Use the eBPF based GKE Dataplane V2 with additional features. See the [GKE - // Dataplane V2 - // documentation](https://cloud.google.com/kubernetes-engine/docs/how-to/dataplane-v2) - // for more. - ADVANCED_DATAPATH = 2; -} - -// Fleet is the fleet configuration for the cluster. -message Fleet { - // The Fleet host project(project ID or project number) where this cluster - // will be registered to. This field cannot be changed after the cluster has - // been registered. - string project = 1; - - // [Output only] The full resource name of the registered fleet membership of - // the cluster, in the format - // `//gkehub.googleapis.com/projects/*/locations/*/memberships/*`. - string membership = 2; - - // [Output only] Whether the cluster has been registered through the fleet - // API. - bool pre_registered = 3; -} - -// Possible values for IP stack type -enum StackType { - // By default, the clusters will be IPV4 only - STACK_TYPE_UNSPECIFIED = 0; - - // The value used if the cluster is a IPV4 only - IPV4 = 1; - - // The value used if the cluster is a dual stack cluster - IPV4_IPV6 = 2; -} diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.cancel_operation.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.cancel_operation.js deleted file mode 100644 index 939c8c4aaca..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.cancel_operation.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, operationId) { - // [START container_v1beta1_generated_ClusterManager_CancelOperation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, operation id) of the operation to cancel. - * Specified in the format `projects/* /locations/* /operations/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callCancelOperation() { - // Construct request - const request = { - projectId, - zone, - operationId, - }; - - // Run request - const response = await containerClient.cancelOperation(request); - console.log(response); - } - - callCancelOperation(); - // [END container_v1beta1_generated_ClusterManager_CancelOperation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js deleted file mode 100644 index 4511c66ce17..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1beta1_generated_ClusterManager_CheckAutopilotCompatibility_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster) of the cluster to retrieve. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callCheckAutopilotCompatibility() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.checkAutopilotCompatibility(request); - console.log(response); - } - - callCheckAutopilotCompatibility(); - // [END container_v1beta1_generated_ClusterManager_CheckAutopilotCompatibility_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_i_p_rotation.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_i_p_rotation.js deleted file mode 100644 index 57cb300a08f..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_i_p_rotation.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId) { - // [START container_v1beta1_generated_ClusterManager_CompleteIPRotation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster name) of the cluster to complete IP - * rotation. Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callCompleteIPRotation() { - // Construct request - const request = { - projectId, - zone, - clusterId, - }; - - // Run request - const response = await containerClient.completeIPRotation(request); - console.log(response); - } - - callCompleteIPRotation(); - // [END container_v1beta1_generated_ClusterManager_CompleteIPRotation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_node_pool_upgrade.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_node_pool_upgrade.js deleted file mode 100644 index 152c6971b1b..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.complete_node_pool_upgrade.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1beta1_generated_ClusterManager_CompleteNodePoolUpgrade_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster, node pool id) of the node pool to - * complete upgrade. - * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callCompleteNodePoolUpgrade() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.completeNodePoolUpgrade(request); - console.log(response); - } - - callCompleteNodePoolUpgrade(); - // [END container_v1beta1_generated_ClusterManager_CompleteNodePoolUpgrade_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_cluster.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_cluster.js deleted file mode 100644 index 4414e1ca9d3..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_cluster.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, cluster) { - // [START container_v1beta1_generated_ClusterManager_CreateCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. A cluster - * resource (https://cloud.google.com/container-engine/reference/rest/v1beta1/projects.locations.clusters) - */ - // const cluster = {} - /** - * The parent (project and location) where the cluster will be created. - * Specified in the format `projects/* /locations/*`. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callCreateCluster() { - // Construct request - const request = { - projectId, - zone, - cluster, - }; - - // Run request - const response = await containerClient.createCluster(request); - console.log(response); - } - - callCreateCluster(); - // [END container_v1beta1_generated_ClusterManager_CreateCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_node_pool.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_node_pool.js deleted file mode 100644 index 9d53c6be79e..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.create_node_pool.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, nodePool) { - // [START container_v1beta1_generated_ClusterManager_CreateNodePool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The node pool to create. - */ - // const nodePool = {} - /** - * The parent (project, location, cluster name) where the node pool will be - * created. Specified in the format - * `projects/* /locations/* /clusters/*`. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callCreateNodePool() { - // Construct request - const request = { - projectId, - zone, - clusterId, - nodePool, - }; - - // Run request - const response = await containerClient.createNodePool(request); - console.log(response); - } - - callCreateNodePool(); - // [END container_v1beta1_generated_ClusterManager_CreateNodePool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_cluster.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_cluster.js deleted file mode 100644 index d387c456166..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_cluster.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId) { - // [START container_v1beta1_generated_ClusterManager_DeleteCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster) of the cluster to delete. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callDeleteCluster() { - // Construct request - const request = { - projectId, - zone, - clusterId, - }; - - // Run request - const response = await containerClient.deleteCluster(request); - console.log(response); - } - - callDeleteCluster(); - // [END container_v1beta1_generated_ClusterManager_DeleteCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_node_pool.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_node_pool.js deleted file mode 100644 index d406bb8686c..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.delete_node_pool.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, nodePoolId) { - // [START container_v1beta1_generated_ClusterManager_DeleteNodePool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster, node pool id) of the node pool to - * delete. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callDeleteNodePool() { - // Construct request - const request = { - projectId, - zone, - clusterId, - nodePoolId, - }; - - // Run request - const response = await containerClient.deleteNodePool(request); - console.log(response); - } - - callDeleteNodePool(); - // [END container_v1beta1_generated_ClusterManager_DeleteNodePool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_cluster.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_cluster.js deleted file mode 100644 index 0e388e69226..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_cluster.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId) { - // [START container_v1beta1_generated_ClusterManager_GetCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster) of the cluster to retrieve. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callGetCluster() { - // Construct request - const request = { - projectId, - zone, - clusterId, - }; - - // Run request - const response = await containerClient.getCluster(request); - console.log(response); - } - - callGetCluster(); - // [END container_v1beta1_generated_ClusterManager_GetCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_j_s_o_n_web_keys.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_j_s_o_n_web_keys.js deleted file mode 100644 index f48cfa5316d..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_j_s_o_n_web_keys.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START container_v1beta1_generated_ClusterManager_GetJSONWebKeys_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The cluster (project, location, cluster name) to get keys for. Specified in - * the format `projects/* /locations/* /clusters/*`. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callGetJSONWebKeys() { - // Construct request - const request = { - }; - - // Run request - const response = await containerClient.getJSONWebKeys(request); - console.log(response); - } - - callGetJSONWebKeys(); - // [END container_v1beta1_generated_ClusterManager_GetJSONWebKeys_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_node_pool.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_node_pool.js deleted file mode 100644 index 21f384189f6..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_node_pool.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, nodePoolId) { - // [START container_v1beta1_generated_ClusterManager_GetNodePool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster, node pool id) of the node pool to - * get. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callGetNodePool() { - // Construct request - const request = { - projectId, - zone, - clusterId, - nodePoolId, - }; - - // Run request - const response = await containerClient.getNodePool(request); - console.log(response); - } - - callGetNodePool(); - // [END container_v1beta1_generated_ClusterManager_GetNodePool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_operation.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_operation.js deleted file mode 100644 index f693d6982e6..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_operation.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, operationId) { - // [START container_v1beta1_generated_ClusterManager_GetOperation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, operation id) of the operation to get. - * Specified in the format `projects/* /locations/* /operations/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callGetOperation() { - // Construct request - const request = { - projectId, - zone, - operationId, - }; - - // Run request - const response = await containerClient.getOperation(request); - console.log(response); - } - - callGetOperation(); - // [END container_v1beta1_generated_ClusterManager_GetOperation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_server_config.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_server_config.js deleted file mode 100644 index 147c03feb39..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.get_server_config.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone) { - // [START container_v1beta1_generated_ClusterManager_GetServerConfig_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project and location) of the server config to get, - * specified in the format `projects/* /locations/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callGetServerConfig() { - // Construct request - const request = { - projectId, - zone, - }; - - // Run request - const response = await containerClient.getServerConfig(request); - console.log(response); - } - - callGetServerConfig(); - // [END container_v1beta1_generated_ClusterManager_GetServerConfig_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_clusters.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_clusters.js deleted file mode 100644 index 3a468a6e586..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_clusters.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone) { - // [START container_v1beta1_generated_ClusterManager_ListClusters_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The parent (project and location) where the clusters will be listed. - * Specified in the format `projects/* /locations/*`. - * Location "-" matches all zones and all regions. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callListClusters() { - // Construct request - const request = { - projectId, - zone, - }; - - // Run request - const response = await containerClient.listClusters(request); - console.log(response); - } - - callListClusters(); - // [END container_v1beta1_generated_ClusterManager_ListClusters_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_locations.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_locations.js deleted file mode 100644 index 62e86afb204..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_locations.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START container_v1beta1_generated_ClusterManager_ListLocations_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Contains the name of the resource requested. - * Specified in the format `projects/*`. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callListLocations() { - // Construct request - const request = { - parent, - }; - - // Run request - const response = await containerClient.listLocations(request); - console.log(response); - } - - callListLocations(); - // [END container_v1beta1_generated_ClusterManager_ListLocations_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_node_pools.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_node_pools.js deleted file mode 100644 index 6c5aaa855e4..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_node_pools.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId) { - // [START container_v1beta1_generated_ClusterManager_ListNodePools_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The parent (project, location, cluster name) where the node pools will be - * listed. Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callListNodePools() { - // Construct request - const request = { - projectId, - zone, - clusterId, - }; - - // Run request - const response = await containerClient.listNodePools(request); - console.log(response); - } - - callListNodePools(); - // [END container_v1beta1_generated_ClusterManager_ListNodePools_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_operations.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_operations.js deleted file mode 100644 index adaf08f3129..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_operations.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone) { - // [START container_v1beta1_generated_ClusterManager_ListOperations_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The parent (project and location) where the operations will be listed. - * Specified in the format `projects/* /locations/*`. - * Location "-" matches all zones and all regions. - */ - // const parent = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callListOperations() { - // Construct request - const request = { - projectId, - zone, - }; - - // Run request - const response = await containerClient.listOperations(request); - console.log(response); - } - - callListOperations(); - // [END container_v1beta1_generated_ClusterManager_ListOperations_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_usable_subnetworks.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_usable_subnetworks.js deleted file mode 100644 index 400d21f447c..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.list_usable_subnetworks.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START container_v1beta1_generated_ClusterManager_ListUsableSubnetworks_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent project where subnetworks are usable. - * Specified in the format `projects/*`. - */ - // const parent = 'abc123' - /** - * 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. - */ - // const filter = 'abc123' - /** - * 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) - */ - // const pageSize = 1234 - /** - * Specifies a page token to use. Set this to the nextPageToken returned by - * previous list requests to get the next page of results. - */ - // const pageToken = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callListUsableSubnetworks() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await containerClient.listUsableSubnetworksAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListUsableSubnetworks(); - // [END container_v1beta1_generated_ClusterManager_ListUsableSubnetworks_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.rollback_node_pool_upgrade.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.rollback_node_pool_upgrade.js deleted file mode 100644 index fd127925ad0..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.rollback_node_pool_upgrade.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, nodePoolId) { - // [START container_v1beta1_generated_ClusterManager_RollbackNodePoolUpgrade_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster, node pool id) of the node poll to - * rollback upgrade. - * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - /** - * Option for rollback to ignore the PodDisruptionBudget. - * Default value is false. - */ - // const respectPdb = true - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callRollbackNodePoolUpgrade() { - // Construct request - const request = { - projectId, - zone, - clusterId, - nodePoolId, - }; - - // Run request - const response = await containerClient.rollbackNodePoolUpgrade(request); - console.log(response); - } - - callRollbackNodePoolUpgrade(); - // [END container_v1beta1_generated_ClusterManager_RollbackNodePoolUpgrade_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_addons_config.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_addons_config.js deleted file mode 100644 index 575a4bf0e5f..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_addons_config.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, addonsConfig) { - // [START container_v1beta1_generated_ClusterManager_SetAddonsConfig_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The desired configurations for the various addons available to - * run in the cluster. - */ - // const addonsConfig = {} - /** - * The name (project, location, cluster) of the cluster to set addons. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetAddonsConfig() { - // Construct request - const request = { - projectId, - zone, - clusterId, - addonsConfig, - }; - - // Run request - const response = await containerClient.setAddonsConfig(request); - console.log(response); - } - - callSetAddonsConfig(); - // [END container_v1beta1_generated_ClusterManager_SetAddonsConfig_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_labels.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_labels.js deleted file mode 100644 index 9690ae6d011..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_labels.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, resourceLabels, labelFingerprint) { - // [START container_v1beta1_generated_ClusterManager_SetLabels_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The labels to set for that cluster. - */ - // const resourceLabels = 1234 - /** - * 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. - */ - // const labelFingerprint = 'abc123' - /** - * The name (project, location, cluster name) of the cluster to set labels. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetLabels() { - // Construct request - const request = { - projectId, - zone, - clusterId, - resourceLabels, - labelFingerprint, - }; - - // Run request - const response = await containerClient.setLabels(request); - console.log(response); - } - - callSetLabels(); - // [END container_v1beta1_generated_ClusterManager_SetLabels_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_legacy_abac.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_legacy_abac.js deleted file mode 100644 index c59d4c74879..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_legacy_abac.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, enabled) { - // [START container_v1beta1_generated_ClusterManager_SetLegacyAbac_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Whether ABAC authorization will be enabled in the cluster. - */ - // const enabled = true - /** - * The name (project, location, cluster name) of the cluster to set legacy - * abac. Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetLegacyAbac() { - // Construct request - const request = { - projectId, - zone, - clusterId, - enabled, - }; - - // Run request - const response = await containerClient.setLegacyAbac(request); - console.log(response); - } - - callSetLegacyAbac(); - // [END container_v1beta1_generated_ClusterManager_SetLegacyAbac_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_locations.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_locations.js deleted file mode 100644 index 7a830f08e75..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_locations.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, locations) { - // [START container_v1beta1_generated_ClusterManager_SetLocations_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The desired list of Google Compute Engine - * zones (https://cloud.google.com/compute/docs/zones#available) 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. - */ - // const locations = 'abc123' - /** - * The name (project, location, cluster) of the cluster to set locations. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetLocations() { - // Construct request - const request = { - projectId, - zone, - clusterId, - locations, - }; - - // Run request - const response = await containerClient.setLocations(request); - console.log(response); - } - - callSetLocations(); - // [END container_v1beta1_generated_ClusterManager_SetLocations_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_logging_service.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_logging_service.js deleted file mode 100644 index e6cd4a0d7f1..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_logging_service.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, loggingService) { - // [START container_v1beta1_generated_ClusterManager_SetLoggingService_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The logging service the cluster should use to write logs. - * Currently available options: - * * `logging.googleapis.com/kubernetes` - The Cloud Logging - * service with a Kubernetes-native resource model - * * `logging.googleapis.com` - The legacy Cloud Logging service (no longer - * available as of GKE 1.15). - * * `none` - no logs will be exported from the cluster. - * If left as an empty string,`logging.googleapis.com/kubernetes` will be - * used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. - */ - // const loggingService = 'abc123' - /** - * The name (project, location, cluster) of the cluster to set logging. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetLoggingService() { - // Construct request - const request = { - projectId, - zone, - clusterId, - loggingService, - }; - - // Run request - const response = await containerClient.setLoggingService(request); - console.log(response); - } - - callSetLoggingService(); - // [END container_v1beta1_generated_ClusterManager_SetLoggingService_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_maintenance_policy.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_maintenance_policy.js deleted file mode 100644 index fa688eb7520..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_maintenance_policy.js +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, maintenancePolicy) { - // [START container_v1beta1_generated_ClusterManager_SetMaintenancePolicy_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The Google Developers Console project ID or project - * number (https://cloud.google.com/resource-manager/docs/creating-managing-projects). - */ - // const projectId = 'abc123' - /** - * Required. The name of the Google Compute Engine - * zone (https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. - */ - // const zone = 'abc123' - /** - * Required. The name of the cluster to update. - */ - // const clusterId = 'abc123' - /** - * Required. The maintenance policy to be set for the cluster. An empty field - * clears the existing maintenance policy. - */ - // const maintenancePolicy = {} - /** - * The name (project, location, cluster name) of the cluster to set - * maintenance policy. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetMaintenancePolicy() { - // Construct request - const request = { - projectId, - zone, - clusterId, - maintenancePolicy, - }; - - // Run request - const response = await containerClient.setMaintenancePolicy(request); - console.log(response); - } - - callSetMaintenancePolicy(); - // [END container_v1beta1_generated_ClusterManager_SetMaintenancePolicy_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_master_auth.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_master_auth.js deleted file mode 100644 index f39467e7cab..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_master_auth.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, action, update) { - // [START container_v1beta1_generated_ClusterManager_SetMasterAuth_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The exact form of action to be taken on the master auth. - */ - // const action = {} - /** - * Required. A description of the update. - */ - // const update = {} - /** - * The name (project, location, cluster) of the cluster to set auth. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetMasterAuth() { - // Construct request - const request = { - projectId, - zone, - clusterId, - action, - update, - }; - - // Run request - const response = await containerClient.setMasterAuth(request); - console.log(response); - } - - callSetMasterAuth(); - // [END container_v1beta1_generated_ClusterManager_SetMasterAuth_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_monitoring_service.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_monitoring_service.js deleted file mode 100644 index a7fe3208d49..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_monitoring_service.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, monitoringService) { - // [START container_v1beta1_generated_ClusterManager_SetMonitoringService_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The monitoring service the cluster should use to write metrics. - * Currently available options: - * * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring - * service with a Kubernetes-native resource model - * * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no - * longer available as of GKE 1.15). - * * `none` - No metrics will be exported from the cluster. - * If left as an empty string,`monitoring.googleapis.com/kubernetes` will be - * used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. - */ - // const monitoringService = 'abc123' - /** - * The name (project, location, cluster) of the cluster to set monitoring. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetMonitoringService() { - // Construct request - const request = { - projectId, - zone, - clusterId, - monitoringService, - }; - - // Run request - const response = await containerClient.setMonitoringService(request); - console.log(response); - } - - callSetMonitoringService(); - // [END container_v1beta1_generated_ClusterManager_SetMonitoringService_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_network_policy.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_network_policy.js deleted file mode 100644 index 08f2bd01e43..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_network_policy.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, networkPolicy) { - // [START container_v1beta1_generated_ClusterManager_SetNetworkPolicy_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Configuration options for the NetworkPolicy feature. - */ - // const networkPolicy = {} - /** - * The name (project, location, cluster name) of the cluster to set networking - * policy. Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetNetworkPolicy() { - // Construct request - const request = { - projectId, - zone, - clusterId, - networkPolicy, - }; - - // Run request - const response = await containerClient.setNetworkPolicy(request); - console.log(response); - } - - callSetNetworkPolicy(); - // [END container_v1beta1_generated_ClusterManager_SetNetworkPolicy_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_autoscaling.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_autoscaling.js deleted file mode 100644 index 48045be1f16..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_autoscaling.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, nodePoolId, autoscaling) { - // [START container_v1beta1_generated_ClusterManager_SetNodePoolAutoscaling_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Autoscaling configuration for the node pool. - */ - // const autoscaling = {} - /** - * The name (project, location, cluster, node pool) of the node pool to set - * autoscaler settings. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetNodePoolAutoscaling() { - // Construct request - const request = { - projectId, - zone, - clusterId, - nodePoolId, - autoscaling, - }; - - // Run request - const response = await containerClient.setNodePoolAutoscaling(request); - console.log(response); - } - - callSetNodePoolAutoscaling(); - // [END container_v1beta1_generated_ClusterManager_SetNodePoolAutoscaling_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_management.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_management.js deleted file mode 100644 index 904e07be6c2..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_management.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, nodePoolId, management) { - // [START container_v1beta1_generated_ClusterManager_SetNodePoolManagement_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. NodeManagement configuration for the node pool. - */ - // const management = {} - /** - * The name (project, location, cluster, node pool id) of the node pool to set - * management properties. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetNodePoolManagement() { - // Construct request - const request = { - projectId, - zone, - clusterId, - nodePoolId, - management, - }; - - // Run request - const response = await containerClient.setNodePoolManagement(request); - console.log(response); - } - - callSetNodePoolManagement(); - // [END container_v1beta1_generated_ClusterManager_SetNodePoolManagement_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_size.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_size.js deleted file mode 100644 index 3903f3ff656..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.set_node_pool_size.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, nodePoolId, nodeCount) { - // [START container_v1beta1_generated_ClusterManager_SetNodePoolSize_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The desired node count for the pool. - */ - // const nodeCount = 1234 - /** - * The name (project, location, cluster, node pool id) of the node pool to set - * size. - * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callSetNodePoolSize() { - // Construct request - const request = { - projectId, - zone, - clusterId, - nodePoolId, - nodeCount, - }; - - // Run request - const response = await containerClient.setNodePoolSize(request); - console.log(response); - } - - callSetNodePoolSize(); - // [END container_v1beta1_generated_ClusterManager_SetNodePoolSize_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.start_i_p_rotation.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.start_i_p_rotation.js deleted file mode 100644 index 181752cb53f..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.start_i_p_rotation.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId) { - // [START container_v1beta1_generated_ClusterManager_StartIPRotation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name (project, location, cluster name) of the cluster to start IP - * rotation. Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - /** - * Whether to rotate credentials during IP rotation. - */ - // const rotateCredentials = true - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callStartIPRotation() { - // Construct request - const request = { - projectId, - zone, - clusterId, - }; - - // Run request - const response = await containerClient.startIPRotation(request); - console.log(response); - } - - callStartIPRotation(); - // [END container_v1beta1_generated_ClusterManager_StartIPRotation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_cluster.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_cluster.js deleted file mode 100644 index 23c5ff8b0c8..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_cluster.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, update) { - // [START container_v1beta1_generated_ClusterManager_UpdateCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. A description of the update. - */ - // const update = {} - /** - * The name (project, location, cluster) of the cluster to update. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callUpdateCluster() { - // Construct request - const request = { - projectId, - zone, - clusterId, - update, - }; - - // Run request - const response = await containerClient.updateCluster(request); - console.log(response); - } - - callUpdateCluster(); - // [END container_v1beta1_generated_ClusterManager_UpdateCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_master.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_master.js deleted file mode 100644 index d76efa7a362..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_master.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, masterVersion) { - // [START container_v1beta1_generated_ClusterManager_UpdateMaster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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 - */ - // const masterVersion = 'abc123' - /** - * The name (project, location, cluster) of the cluster to update. - * Specified in the format `projects/* /locations/* /clusters/*`. - */ - // const name = 'abc123' - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callUpdateMaster() { - // Construct request - const request = { - projectId, - zone, - clusterId, - masterVersion, - }; - - // Run request - const response = await containerClient.updateMaster(request); - console.log(response); - } - - callUpdateMaster(); - // [END container_v1beta1_generated_ClusterManager_UpdateMaster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_node_pool.js b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_node_pool.js deleted file mode 100644 index 8f5b298a36e..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/cluster_manager.update_node_pool.js +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, zone, clusterId, nodePoolId, nodeVersion, imageType) { - // [START container_v1beta1_generated_ClusterManager_UpdateNodePool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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 - */ - // const nodeVersion = 'abc123' - /** - * Required. The desired image type for the node pool. Please see - * https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for - * available image types. - */ - // const imageType = 'abc123' - /** - * The desired list of Google Compute Engine - * zones (https://cloud.google.com/compute/docs/zones#available) in which the - * node pool's nodes should be located. Changing the locations for a node pool - * will result in nodes being either created or removed from the node pool, - * depending on whether locations are being added or removed. - */ - // const locations = 'abc123' - /** - * The desired workload metadata config for the node pool. - */ - // const workloadMetadataConfig = {} - /** - * The name (project, location, cluster, node pool) of the node pool to - * update. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - */ - // const name = 'abc123' - /** - * Upgrade settings control disruption and speed of the upgrade. - */ - // const upgradeSettings = {} - /** - * The desired network tags to be applied to all nodes in the node pool. - * If this field is not present, the tags will not be changed. Otherwise, - * the existing network tags will be *replaced* with the provided tags. - */ - // const tags = {} - /** - * The desired node taints to be applied to all nodes in the node pool. - * If this field is not present, the taints will not be changed. Otherwise, - * the existing node taints will be *replaced* with the provided taints. - */ - // const taints = {} - /** - * The desired node labels to be applied to all nodes in the node pool. - * If this field is not present, the labels will not be changed. Otherwise, - * the existing node labels will be *replaced* with the provided labels. - */ - // const labels = {} - /** - * Parameters that can be configured on Linux nodes. - */ - // const linuxNodeConfig = {} - /** - * Node kubelet configs. - */ - // const kubeletConfig = {} - /** - * Node network config. - */ - // const nodeNetworkConfig = {} - /** - * GCFS config. - */ - // const gcfsConfig = {} - /** - * Confidential nodes config. - * All the nodes in the node pool will be Confidential VM once enabled. - */ - // const confidentialNodes = {} - /** - * Enable or disable gvnic on the node pool. - */ - // const gvnic = {} - /** - * The current etag of the node pool. - * If an etag is provided and does not match the current etag of the node - * pool, update will be blocked and an ABORTED error will be returned. - */ - // const etag = 'abc123' - /** - * Enable or disable NCCL fast socket for the node pool. - */ - // const fastSocket = {} - /** - * Logging configuration. - */ - // const loggingConfig = {} - /** - * The resource labels for the node pool to use to annotate any related - * Google Compute Engine resources. - */ - // const resourceLabels = {} - /** - * Parameters that can be configured on Windows nodes. - */ - // const windowsNodeConfig = {} - - // Imports the Container library - const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; - - // Instantiates a client - const containerClient = new ClusterManagerClient(); - - async function callUpdateNodePool() { - // Construct request - const request = { - projectId, - zone, - clusterId, - nodePoolId, - nodeVersion, - imageType, - }; - - // Run request - const response = await containerClient.updateNodePool(request); - console.log(response); - } - - callUpdateNodePool(); - // [END container_v1beta1_generated_ClusterManager_UpdateNodePool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json b/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json deleted file mode 100644 index 5e5c05ee1ca..00000000000 --- a/owl-bot-staging/google-container/v1beta1/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json +++ /dev/null @@ -1,1955 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-container", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.container.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "regionTag": "container_v1beta1_generated_ClusterManager_ListClusters_async", - "title": "ClusterManager listClusters Sample", - "origin": "API_DEFINITION", - "description": " Lists all clusters owned by a project in either the specified zone or all zones.", - "canonical": true, - "file": "cluster_manager.list_clusters.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListClusters", - "fullName": "google.container.v1beta1.ClusterManager.ListClusters", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.ListClustersResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "ListClusters", - "fullName": "google.container.v1beta1.ClusterManager.ListClusters", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_GetCluster_async", - "title": "ClusterManager getCluster Sample", - "origin": "API_DEFINITION", - "description": " Gets the details for a specific cluster.", - "canonical": true, - "file": "cluster_manager.get_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCluster", - "fullName": "google.container.v1beta1.ClusterManager.GetCluster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Cluster", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "GetCluster", - "fullName": "google.container.v1beta1.ClusterManager.GetCluster", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_CreateCluster_async", - "title": "ClusterManager createCluster Sample", - "origin": "API_DEFINITION", - "description": " 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](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). 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.", - "canonical": true, - "file": "cluster_manager.create_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateCluster", - "fullName": "google.container.v1beta1.ClusterManager.CreateCluster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster", - "type": ".google.container.v1beta1.Cluster" - }, - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "CreateCluster", - "fullName": "google.container.v1beta1.ClusterManager.CreateCluster", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_UpdateCluster_async", - "title": "ClusterManager updateCluster Sample", - "origin": "API_DEFINITION", - "description": " Updates the settings for a specific cluster.", - "canonical": true, - "file": "cluster_manager.update_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateCluster", - "fullName": "google.container.v1beta1.ClusterManager.UpdateCluster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "update", - "type": ".google.container.v1beta1.ClusterUpdate" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "UpdateCluster", - "fullName": "google.container.v1beta1.ClusterManager.UpdateCluster", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_UpdateNodePool_async", - "title": "ClusterManager updateNodePool Sample", - "origin": "API_DEFINITION", - "description": " Updates the version and/or image type of a specific node pool.", - "canonical": true, - "file": "cluster_manager.update_node_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 160, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateNodePool", - "fullName": "google.container.v1beta1.ClusterManager.UpdateNodePool", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "node_version", - "type": "TYPE_STRING" - }, - { - "name": "image_type", - "type": "TYPE_STRING" - }, - { - "name": "locations", - "type": "TYPE_STRING[]" - }, - { - "name": "workload_metadata_config", - "type": ".google.container.v1beta1.WorkloadMetadataConfig" - }, - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "upgrade_settings", - "type": ".google.container.v1beta1.NodePool.UpgradeSettings" - }, - { - "name": "tags", - "type": ".google.container.v1beta1.NetworkTags" - }, - { - "name": "taints", - "type": ".google.container.v1beta1.NodeTaints" - }, - { - "name": "labels", - "type": ".google.container.v1beta1.NodeLabels" - }, - { - "name": "linux_node_config", - "type": ".google.container.v1beta1.LinuxNodeConfig" - }, - { - "name": "kubelet_config", - "type": ".google.container.v1beta1.NodeKubeletConfig" - }, - { - "name": "node_network_config", - "type": ".google.container.v1beta1.NodeNetworkConfig" - }, - { - "name": "gcfs_config", - "type": ".google.container.v1beta1.GcfsConfig" - }, - { - "name": "confidential_nodes", - "type": ".google.container.v1beta1.ConfidentialNodes" - }, - { - "name": "gvnic", - "type": ".google.container.v1beta1.VirtualNIC" - }, - { - "name": "etag", - "type": "TYPE_STRING" - }, - { - "name": "fast_socket", - "type": ".google.container.v1beta1.FastSocket" - }, - { - "name": "logging_config", - "type": ".google.container.v1beta1.NodePoolLoggingConfig" - }, - { - "name": "resource_labels", - "type": ".google.container.v1beta1.ResourceLabels" - }, - { - "name": "windows_node_config", - "type": ".google.container.v1beta1.WindowsNodeConfig" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "UpdateNodePool", - "fullName": "google.container.v1beta1.ClusterManager.UpdateNodePool", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_SetNodePoolAutoscaling_async", - "title": "ClusterManager setNodePoolAutoscaling Sample", - "origin": "API_DEFINITION", - "description": " Sets the autoscaling settings of a specific node pool.", - "canonical": true, - "file": "cluster_manager.set_node_pool_autoscaling.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetNodePoolAutoscaling", - "fullName": "google.container.v1beta1.ClusterManager.SetNodePoolAutoscaling", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "autoscaling", - "type": ".google.container.v1beta1.NodePoolAutoscaling" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "SetNodePoolAutoscaling", - "fullName": "google.container.v1beta1.ClusterManager.SetNodePoolAutoscaling", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_SetLoggingService_async", - "title": "ClusterManager setLoggingService Sample", - "origin": "API_DEFINITION", - "description": " Sets the logging service for a specific cluster.", - "canonical": true, - "file": "cluster_manager.set_logging_service.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetLoggingService", - "fullName": "google.container.v1beta1.ClusterManager.SetLoggingService", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "logging_service", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "SetLoggingService", - "fullName": "google.container.v1beta1.ClusterManager.SetLoggingService", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_SetMonitoringService_async", - "title": "ClusterManager setMonitoringService Sample", - "origin": "API_DEFINITION", - "description": " Sets the monitoring service for a specific cluster.", - "canonical": true, - "file": "cluster_manager.set_monitoring_service.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetMonitoringService", - "fullName": "google.container.v1beta1.ClusterManager.SetMonitoringService", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "monitoring_service", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "SetMonitoringService", - "fullName": "google.container.v1beta1.ClusterManager.SetMonitoringService", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_SetAddonsConfig_async", - "title": "ClusterManager setAddonsConfig Sample", - "origin": "API_DEFINITION", - "description": " Sets the addons for a specific cluster.", - "canonical": true, - "file": "cluster_manager.set_addons_config.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetAddonsConfig", - "fullName": "google.container.v1beta1.ClusterManager.SetAddonsConfig", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "addons_config", - "type": ".google.container.v1beta1.AddonsConfig" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "SetAddonsConfig", - "fullName": "google.container.v1beta1.ClusterManager.SetAddonsConfig", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_SetLocations_async", - "title": "ClusterManager setLocations Sample", - "origin": "API_DEFINITION", - "description": " Sets the locations for a specific cluster. Deprecated. Use [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters/update) instead.", - "canonical": true, - "file": "cluster_manager.set_locations.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetLocations", - "fullName": "google.container.v1beta1.ClusterManager.SetLocations", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "locations", - "type": "TYPE_STRING[]" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "SetLocations", - "fullName": "google.container.v1beta1.ClusterManager.SetLocations", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_UpdateMaster_async", - "title": "ClusterManager updateMaster Sample", - "origin": "API_DEFINITION", - "description": " Updates the master for a specific cluster.", - "canonical": true, - "file": "cluster_manager.update_master.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateMaster", - "fullName": "google.container.v1beta1.ClusterManager.UpdateMaster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "master_version", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "UpdateMaster", - "fullName": "google.container.v1beta1.ClusterManager.UpdateMaster", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_SetMasterAuth_async", - "title": "ClusterManager setMasterAuth Sample", - "origin": "API_DEFINITION", - "description": " Sets master auth materials. Currently supports changing the admin password or a specific cluster, either via password generation or explicitly setting the password.", - "canonical": true, - "file": "cluster_manager.set_master_auth.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetMasterAuth", - "fullName": "google.container.v1beta1.ClusterManager.SetMasterAuth", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "action", - "type": ".google.container.v1beta1.SetMasterAuthRequest.Action" - }, - { - "name": "update", - "type": ".google.container.v1beta1.MasterAuth" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "SetMasterAuth", - "fullName": "google.container.v1beta1.ClusterManager.SetMasterAuth", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_DeleteCluster_async", - "title": "ClusterManager deleteCluster Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "cluster_manager.delete_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteCluster", - "fullName": "google.container.v1beta1.ClusterManager.DeleteCluster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "DeleteCluster", - "fullName": "google.container.v1beta1.ClusterManager.DeleteCluster", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_ListOperations_async", - "title": "ClusterManager listOperations Sample", - "origin": "API_DEFINITION", - "description": " Lists all operations in a project in the specified zone or all zones.", - "canonical": true, - "file": "cluster_manager.list_operations.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListOperations", - "fullName": "google.container.v1beta1.ClusterManager.ListOperations", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.ListOperationsResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "ListOperations", - "fullName": "google.container.v1beta1.ClusterManager.ListOperations", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_GetOperation_async", - "title": "ClusterManager getOperation Sample", - "origin": "API_DEFINITION", - "description": " Gets the specified operation.", - "canonical": true, - "file": "cluster_manager.get_operation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetOperation", - "fullName": "google.container.v1beta1.ClusterManager.GetOperation", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "operation_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "GetOperation", - "fullName": "google.container.v1beta1.ClusterManager.GetOperation", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_CancelOperation_async", - "title": "ClusterManager cancelOperation Sample", - "origin": "API_DEFINITION", - "description": " Cancels the specified operation.", - "canonical": true, - "file": "cluster_manager.cancel_operation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CancelOperation", - "fullName": "google.container.v1beta1.ClusterManager.CancelOperation", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "operation_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "CancelOperation", - "fullName": "google.container.v1beta1.ClusterManager.CancelOperation", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_GetServerConfig_async", - "title": "ClusterManager getServerConfig Sample", - "origin": "API_DEFINITION", - "description": " Returns configuration info about the Google Kubernetes Engine service.", - "canonical": true, - "file": "cluster_manager.get_server_config.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetServerConfig", - "fullName": "google.container.v1beta1.ClusterManager.GetServerConfig", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.ServerConfig", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "GetServerConfig", - "fullName": "google.container.v1beta1.ClusterManager.GetServerConfig", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_GetJSONWebKeys_async", - "title": "ClusterManager getJSONWebKeys Sample", - "origin": "API_DEFINITION", - "description": " Gets the public component of the cluster signing keys in JSON Web Key format. This API is not yet intended for general use, and is not available for all clusters.", - "canonical": true, - "file": "cluster_manager.get_j_s_o_n_web_keys.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetJSONWebKeys", - "fullName": "google.container.v1beta1.ClusterManager.GetJSONWebKeys", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.GetJSONWebKeysResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "GetJSONWebKeys", - "fullName": "google.container.v1beta1.ClusterManager.GetJSONWebKeys", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_ListNodePools_async", - "title": "ClusterManager listNodePools Sample", - "origin": "API_DEFINITION", - "description": " Lists the node pools for a cluster.", - "canonical": true, - "file": "cluster_manager.list_node_pools.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListNodePools", - "fullName": "google.container.v1beta1.ClusterManager.ListNodePools", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.ListNodePoolsResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "ListNodePools", - "fullName": "google.container.v1beta1.ClusterManager.ListNodePools", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_GetNodePool_async", - "title": "ClusterManager getNodePool Sample", - "origin": "API_DEFINITION", - "description": " Retrieves the requested node pool.", - "canonical": true, - "file": "cluster_manager.get_node_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetNodePool", - "fullName": "google.container.v1beta1.ClusterManager.GetNodePool", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.NodePool", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "GetNodePool", - "fullName": "google.container.v1beta1.ClusterManager.GetNodePool", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_CreateNodePool_async", - "title": "ClusterManager createNodePool Sample", - "origin": "API_DEFINITION", - "description": " Creates a node pool for a cluster.", - "canonical": true, - "file": "cluster_manager.create_node_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateNodePool", - "fullName": "google.container.v1beta1.ClusterManager.CreateNodePool", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool", - "type": ".google.container.v1beta1.NodePool" - }, - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "CreateNodePool", - "fullName": "google.container.v1beta1.ClusterManager.CreateNodePool", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_DeleteNodePool_async", - "title": "ClusterManager deleteNodePool Sample", - "origin": "API_DEFINITION", - "description": " Deletes a node pool from a cluster.", - "canonical": true, - "file": "cluster_manager.delete_node_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteNodePool", - "fullName": "google.container.v1beta1.ClusterManager.DeleteNodePool", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "DeleteNodePool", - "fullName": "google.container.v1beta1.ClusterManager.DeleteNodePool", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_CompleteNodePoolUpgrade_async", - "title": "ClusterManager completeNodePoolUpgrade Sample", - "origin": "API_DEFINITION", - "description": " CompleteNodePoolUpgrade will signal an on-going node pool upgrade to complete.", - "canonical": true, - "file": "cluster_manager.complete_node_pool_upgrade.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CompleteNodePoolUpgrade", - "fullName": "google.container.v1beta1.ClusterManager.CompleteNodePoolUpgrade", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "CompleteNodePoolUpgrade", - "fullName": "google.container.v1beta1.ClusterManager.CompleteNodePoolUpgrade", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_RollbackNodePoolUpgrade_async", - "title": "ClusterManager rollbackNodePoolUpgrade Sample", - "origin": "API_DEFINITION", - "description": " Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last upgrade successfully completed.", - "canonical": true, - "file": "cluster_manager.rollback_node_pool_upgrade.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RollbackNodePoolUpgrade", - "fullName": "google.container.v1beta1.ClusterManager.RollbackNodePoolUpgrade", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "respect_pdb", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "RollbackNodePoolUpgrade", - "fullName": "google.container.v1beta1.ClusterManager.RollbackNodePoolUpgrade", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_SetNodePoolManagement_async", - "title": "ClusterManager setNodePoolManagement Sample", - "origin": "API_DEFINITION", - "description": " Sets the NodeManagement options for a node pool.", - "canonical": true, - "file": "cluster_manager.set_node_pool_management.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetNodePoolManagement", - "fullName": "google.container.v1beta1.ClusterManager.SetNodePoolManagement", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "management", - "type": ".google.container.v1beta1.NodeManagement" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "SetNodePoolManagement", - "fullName": "google.container.v1beta1.ClusterManager.SetNodePoolManagement", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_SetLabels_async", - "title": "ClusterManager setLabels Sample", - "origin": "API_DEFINITION", - "description": " Sets labels on a cluster.", - "canonical": true, - "file": "cluster_manager.set_labels.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetLabels", - "fullName": "google.container.v1beta1.ClusterManager.SetLabels", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "resource_labels", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "label_fingerprint", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "SetLabels", - "fullName": "google.container.v1beta1.ClusterManager.SetLabels", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_SetLegacyAbac_async", - "title": "ClusterManager setLegacyAbac Sample", - "origin": "API_DEFINITION", - "description": " Enables or disables the ABAC authorization mechanism on a cluster.", - "canonical": true, - "file": "cluster_manager.set_legacy_abac.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetLegacyAbac", - "fullName": "google.container.v1beta1.ClusterManager.SetLegacyAbac", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "enabled", - "type": "TYPE_BOOL" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "SetLegacyAbac", - "fullName": "google.container.v1beta1.ClusterManager.SetLegacyAbac", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_StartIPRotation_async", - "title": "ClusterManager startIPRotation Sample", - "origin": "API_DEFINITION", - "description": " Starts master IP rotation.", - "canonical": true, - "file": "cluster_manager.start_i_p_rotation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "StartIPRotation", - "fullName": "google.container.v1beta1.ClusterManager.StartIPRotation", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "rotate_credentials", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "StartIPRotation", - "fullName": "google.container.v1beta1.ClusterManager.StartIPRotation", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_CompleteIPRotation_async", - "title": "ClusterManager completeIPRotation Sample", - "origin": "API_DEFINITION", - "description": " Completes master IP rotation.", - "canonical": true, - "file": "cluster_manager.complete_i_p_rotation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CompleteIPRotation", - "fullName": "google.container.v1beta1.ClusterManager.CompleteIPRotation", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "CompleteIPRotation", - "fullName": "google.container.v1beta1.ClusterManager.CompleteIPRotation", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_SetNodePoolSize_async", - "title": "ClusterManager setNodePoolSize Sample", - "origin": "API_DEFINITION", - "description": " SetNodePoolSizeRequest sets the size of a node pool. The new size will be used for all replicas, including future replicas created by modifying [NodePool.locations][google.container.v1beta1.NodePool.locations].", - "canonical": true, - "file": "cluster_manager.set_node_pool_size.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetNodePoolSize", - "fullName": "google.container.v1beta1.ClusterManager.SetNodePoolSize", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "node_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "node_count", - "type": "TYPE_INT32" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "SetNodePoolSize", - "fullName": "google.container.v1beta1.ClusterManager.SetNodePoolSize", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_SetNetworkPolicy_async", - "title": "ClusterManager setNetworkPolicy Sample", - "origin": "API_DEFINITION", - "description": " Enables or disables Network Policy for a cluster.", - "canonical": true, - "file": "cluster_manager.set_network_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetNetworkPolicy", - "fullName": "google.container.v1beta1.ClusterManager.SetNetworkPolicy", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "network_policy", - "type": ".google.container.v1beta1.NetworkPolicy" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "SetNetworkPolicy", - "fullName": "google.container.v1beta1.ClusterManager.SetNetworkPolicy", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_SetMaintenancePolicy_async", - "title": "ClusterManager setMaintenancePolicy Sample", - "origin": "API_DEFINITION", - "description": " Sets the maintenance policy for a cluster.", - "canonical": true, - "file": "cluster_manager.set_maintenance_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 78, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetMaintenancePolicy", - "fullName": "google.container.v1beta1.ClusterManager.SetMaintenancePolicy", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "maintenance_policy", - "type": ".google.container.v1beta1.MaintenancePolicy" - }, - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.Operation", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "SetMaintenancePolicy", - "fullName": "google.container.v1beta1.ClusterManager.SetMaintenancePolicy", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_ListUsableSubnetworks_async", - "title": "ClusterManager listUsableSubnetworks Sample", - "origin": "API_DEFINITION", - "description": " Lists subnetworks that can be used for creating clusters in a project.", - "canonical": true, - "file": "cluster_manager.list_usable_subnetworks.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListUsableSubnetworks", - "fullName": "google.container.v1beta1.ClusterManager.ListUsableSubnetworks", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.ListUsableSubnetworksResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "ListUsableSubnetworks", - "fullName": "google.container.v1beta1.ClusterManager.ListUsableSubnetworks", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_CheckAutopilotCompatibility_async", - "title": "ClusterManager checkAutopilotCompatibility Sample", - "origin": "API_DEFINITION", - "description": " Checks the cluster compatibility with Autopilot mode, and returns a list of compatibility issues.", - "canonical": true, - "file": "cluster_manager.check_autopilot_compatibility.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CheckAutopilotCompatibility", - "fullName": "google.container.v1beta1.ClusterManager.CheckAutopilotCompatibility", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.CheckAutopilotCompatibilityResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "CheckAutopilotCompatibility", - "fullName": "google.container.v1beta1.ClusterManager.CheckAutopilotCompatibility", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - }, - { - "regionTag": "container_v1beta1_generated_ClusterManager_ListLocations_async", - "title": "ClusterManager listLocations Sample", - "origin": "API_DEFINITION", - "description": " Fetches locations that offer Google Kubernetes Engine.", - "canonical": true, - "file": "cluster_manager.list_locations.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListLocations", - "fullName": "google.container.v1beta1.ClusterManager.ListLocations", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.container.v1beta1.ListLocationsResponse", - "client": { - "shortName": "ClusterManagerClient", - "fullName": "google.container.v1beta1.ClusterManagerClient" - }, - "method": { - "shortName": "ListLocations", - "fullName": "google.container.v1beta1.ClusterManager.ListLocations", - "service": { - "shortName": "ClusterManager", - "fullName": "google.container.v1beta1.ClusterManager" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-container/v1beta1/src/index.ts b/owl-bot-staging/google-container/v1beta1/src/index.ts deleted file mode 100644 index 44cbef9d2d2..00000000000 --- a/owl-bot-staging/google-container/v1beta1/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1beta1 from './v1beta1'; -const ClusterManagerClient = v1beta1.ClusterManagerClient; -type ClusterManagerClient = v1beta1.ClusterManagerClient; -export {v1beta1, ClusterManagerClient}; -export default {v1beta1, ClusterManagerClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client.ts b/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client.ts deleted file mode 100644 index 168ebbd3a99..00000000000 --- a/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client.ts +++ /dev/null @@ -1,3623 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1beta1/cluster_manager_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './cluster_manager_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Google Kubernetes Engine Cluster Manager v1beta1 - * @class - * @memberof v1beta1 - */ -export class ClusterManagerClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - clusterManagerStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of ClusterManagerClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ClusterManagerClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof ClusterManagerClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listUsableSubnetworks: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'subnetworks') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.container.v1beta1.ClusterManager', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.clusterManagerStub) { - return this.clusterManagerStub; - } - - // Put together the "service stub" for - // google.container.v1beta1.ClusterManager. - this.clusterManagerStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.container.v1beta1.ClusterManager') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.container.v1beta1.ClusterManager, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const clusterManagerStubMethods = - ['listClusters', 'getCluster', 'createCluster', 'updateCluster', 'updateNodePool', 'setNodePoolAutoscaling', 'setLoggingService', 'setMonitoringService', 'setAddonsConfig', 'setLocations', 'updateMaster', 'setMasterAuth', 'deleteCluster', 'listOperations', 'getOperation', 'cancelOperation', 'getServerConfig', 'getJsonWebKeys', 'listNodePools', 'getNodePool', 'createNodePool', 'deleteNodePool', 'completeNodePoolUpgrade', 'rollbackNodePoolUpgrade', 'setNodePoolManagement', 'setLabels', 'setLegacyAbac', 'startIpRotation', 'completeIpRotation', 'setNodePoolSize', 'setNetworkPolicy', 'setMaintenancePolicy', 'listUsableSubnetworks', 'checkAutopilotCompatibility', 'listLocations']; - for (const methodName of clusterManagerStubMethods) { - const callPromise = this.clusterManagerStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.clusterManagerStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'container.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'container.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Lists all clusters owned by a project in either the specified zone or all - * zones. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the parent field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides, or "-" for all zones. This field has been deprecated and - * replaced by the parent field. - * @param {string} request.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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.ListClustersResponse | ListClustersResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.list_clusters.js - * region_tag:container_v1beta1_generated_ClusterManager_ListClusters_async - */ - listClusters( - request?: protos.google.container.v1beta1.IListClustersRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IListClustersResponse, - protos.google.container.v1beta1.IListClustersRequest|undefined, {}|undefined - ]>; - listClusters( - request: protos.google.container.v1beta1.IListClustersRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IListClustersResponse, - protos.google.container.v1beta1.IListClustersRequest|null|undefined, - {}|null|undefined>): void; - listClusters( - request: protos.google.container.v1beta1.IListClustersRequest, - callback: Callback< - protos.google.container.v1beta1.IListClustersResponse, - protos.google.container.v1beta1.IListClustersRequest|null|undefined, - {}|null|undefined>): void; - listClusters( - request?: protos.google.container.v1beta1.IListClustersRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IListClustersResponse, - protos.google.container.v1beta1.IListClustersRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IListClustersResponse, - protos.google.container.v1beta1.IListClustersRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IListClustersResponse, - protos.google.container.v1beta1.IListClustersRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - }); - this.initialize(); - return this.innerApiCalls.listClusters(request, options, callback); - } -/** - * Gets the details for a specific cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to retrieve. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to retrieve. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Cluster | Cluster}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.get_cluster.js - * region_tag:container_v1beta1_generated_ClusterManager_GetCluster_async - */ - getCluster( - request?: protos.google.container.v1beta1.IGetClusterRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.ICluster, - protos.google.container.v1beta1.IGetClusterRequest|undefined, {}|undefined - ]>; - getCluster( - request: protos.google.container.v1beta1.IGetClusterRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.ICluster, - protos.google.container.v1beta1.IGetClusterRequest|null|undefined, - {}|null|undefined>): void; - getCluster( - request: protos.google.container.v1beta1.IGetClusterRequest, - callback: Callback< - protos.google.container.v1beta1.ICluster, - protos.google.container.v1beta1.IGetClusterRequest|null|undefined, - {}|null|undefined>): void; - getCluster( - request?: protos.google.container.v1beta1.IGetClusterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.ICluster, - protos.google.container.v1beta1.IGetClusterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.ICluster, - protos.google.container.v1beta1.IGetClusterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.ICluster, - protos.google.container.v1beta1.IGetClusterRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.getCluster(request, options, callback); - } -/** - * 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](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). - * - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the parent field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the parent - * field. - * @param {google.container.v1beta1.Cluster} request.cluster - * Required. A [cluster - * resource](https://cloud.google.com/container-engine/reference/rest/v1beta1/projects.locations.clusters) - * @param {string} request.parent - * The parent (project and location) where the cluster will be created. - * Specified in the format `projects/* /locations/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.create_cluster.js - * region_tag:container_v1beta1_generated_ClusterManager_CreateCluster_async - */ - createCluster( - request?: protos.google.container.v1beta1.ICreateClusterRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICreateClusterRequest|undefined, {}|undefined - ]>; - createCluster( - request: protos.google.container.v1beta1.ICreateClusterRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICreateClusterRequest|null|undefined, - {}|null|undefined>): void; - createCluster( - request: protos.google.container.v1beta1.ICreateClusterRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICreateClusterRequest|null|undefined, - {}|null|undefined>): void; - createCluster( - request?: protos.google.container.v1beta1.ICreateClusterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICreateClusterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICreateClusterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICreateClusterRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - }); - this.initialize(); - return this.innerApiCalls.createCluster(request, options, callback); - } -/** - * Updates the settings for a specific cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {google.container.v1beta1.ClusterUpdate} request.update - * Required. A description of the update. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to update. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.update_cluster.js - * region_tag:container_v1beta1_generated_ClusterManager_UpdateCluster_async - */ - updateCluster( - request?: protos.google.container.v1beta1.IUpdateClusterRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateClusterRequest|undefined, {}|undefined - ]>; - updateCluster( - request: protos.google.container.v1beta1.IUpdateClusterRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateClusterRequest|null|undefined, - {}|null|undefined>): void; - updateCluster( - request: protos.google.container.v1beta1.IUpdateClusterRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateClusterRequest|null|undefined, - {}|null|undefined>): void; - updateCluster( - request?: protos.google.container.v1beta1.IUpdateClusterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateClusterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateClusterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateClusterRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateCluster(request, options, callback); - } -/** - * Updates the version and/or image type of a specific node pool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Required. Deprecated. The name of the node pool to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodeVersion - * 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 - * @param {string} request.imageType - * Required. The desired image type for the node pool. Please see - * https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for - * available image types. - * @param {string[]} request.locations - * The desired list of Google Compute Engine - * [zones](https://cloud.google.com/compute/docs/zones#available) in which the - * node pool's nodes should be located. Changing the locations for a node pool - * will result in nodes being either created or removed from the node pool, - * depending on whether locations are being added or removed. - * @param {google.container.v1beta1.WorkloadMetadataConfig} request.workloadMetadataConfig - * The desired workload metadata config for the node pool. - * @param {string} request.name - * The name (project, location, cluster, node pool) of the node pool to - * update. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {google.container.v1beta1.NodePool.UpgradeSettings} request.upgradeSettings - * Upgrade settings control disruption and speed of the upgrade. - * @param {google.container.v1beta1.NetworkTags} request.tags - * The desired network tags to be applied to all nodes in the node pool. - * If this field is not present, the tags will not be changed. Otherwise, - * the existing network tags will be *replaced* with the provided tags. - * @param {google.container.v1beta1.NodeTaints} request.taints - * The desired node taints to be applied to all nodes in the node pool. - * If this field is not present, the taints will not be changed. Otherwise, - * the existing node taints will be *replaced* with the provided taints. - * @param {google.container.v1beta1.NodeLabels} request.labels - * The desired node labels to be applied to all nodes in the node pool. - * If this field is not present, the labels will not be changed. Otherwise, - * the existing node labels will be *replaced* with the provided labels. - * @param {google.container.v1beta1.LinuxNodeConfig} request.linuxNodeConfig - * Parameters that can be configured on Linux nodes. - * @param {google.container.v1beta1.NodeKubeletConfig} request.kubeletConfig - * Node kubelet configs. - * @param {google.container.v1beta1.NodeNetworkConfig} request.nodeNetworkConfig - * Node network config. - * @param {google.container.v1beta1.GcfsConfig} request.gcfsConfig - * GCFS config. - * @param {google.container.v1beta1.ConfidentialNodes} request.confidentialNodes - * Confidential nodes config. - * All the nodes in the node pool will be Confidential VM once enabled. - * @param {google.container.v1beta1.VirtualNIC} request.gvnic - * Enable or disable gvnic on the node pool. - * @param {string} request.etag - * The current etag of the node pool. - * If an etag is provided and does not match the current etag of the node - * pool, update will be blocked and an ABORTED error will be returned. - * @param {google.container.v1beta1.FastSocket} request.fastSocket - * Enable or disable NCCL fast socket for the node pool. - * @param {google.container.v1beta1.NodePoolLoggingConfig} request.loggingConfig - * Logging configuration. - * @param {google.container.v1beta1.ResourceLabels} request.resourceLabels - * The resource labels for the node pool to use to annotate any related - * Google Compute Engine resources. - * @param {google.container.v1beta1.WindowsNodeConfig} request.windowsNodeConfig - * Parameters that can be configured on Windows nodes. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.update_node_pool.js - * region_tag:container_v1beta1_generated_ClusterManager_UpdateNodePool_async - */ - updateNodePool( - request?: protos.google.container.v1beta1.IUpdateNodePoolRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateNodePoolRequest|undefined, {}|undefined - ]>; - updateNodePool( - request: protos.google.container.v1beta1.IUpdateNodePoolRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateNodePoolRequest|null|undefined, - {}|null|undefined>): void; - updateNodePool( - request: protos.google.container.v1beta1.IUpdateNodePoolRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateNodePoolRequest|null|undefined, - {}|null|undefined>): void; - updateNodePool( - request?: protos.google.container.v1beta1.IUpdateNodePoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateNodePoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateNodePoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateNodePoolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateNodePool(request, options, callback); - } -/** - * Sets the autoscaling settings of a specific node pool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Required. Deprecated. The name of the node pool to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {google.container.v1beta1.NodePoolAutoscaling} request.autoscaling - * Required. Autoscaling configuration for the node pool. - * @param {string} request.name - * The name (project, location, cluster, node pool) of the node pool to set - * autoscaler settings. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.set_node_pool_autoscaling.js - * region_tag:container_v1beta1_generated_ClusterManager_SetNodePoolAutoscaling_async - */ - setNodePoolAutoscaling( - request?: protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest|undefined, {}|undefined - ]>; - setNodePoolAutoscaling( - request: protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest|null|undefined, - {}|null|undefined>): void; - setNodePoolAutoscaling( - request: protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest|null|undefined, - {}|null|undefined>): void; - setNodePoolAutoscaling( - request?: protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolAutoscalingRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setNodePoolAutoscaling(request, options, callback); - } -/** - * Sets the logging service for a specific cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string} request.loggingService - * Required. The logging service the cluster should use to write logs. - * Currently available options: - * - * * `logging.googleapis.com/kubernetes` - The Cloud Logging - * service with a Kubernetes-native resource model - * * `logging.googleapis.com` - The legacy Cloud Logging service (no longer - * available as of GKE 1.15). - * * `none` - no logs will be exported from the cluster. - * - * If left as an empty string,`logging.googleapis.com/kubernetes` will be - * used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to set logging. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.set_logging_service.js - * region_tag:container_v1beta1_generated_ClusterManager_SetLoggingService_async - */ - setLoggingService( - request?: protos.google.container.v1beta1.ISetLoggingServiceRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLoggingServiceRequest|undefined, {}|undefined - ]>; - setLoggingService( - request: protos.google.container.v1beta1.ISetLoggingServiceRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLoggingServiceRequest|null|undefined, - {}|null|undefined>): void; - setLoggingService( - request: protos.google.container.v1beta1.ISetLoggingServiceRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLoggingServiceRequest|null|undefined, - {}|null|undefined>): void; - setLoggingService( - request?: protos.google.container.v1beta1.ISetLoggingServiceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLoggingServiceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLoggingServiceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLoggingServiceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setLoggingService(request, options, callback); - } -/** - * Sets the monitoring service for a specific cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string} request.monitoringService - * Required. The monitoring service the cluster should use to write metrics. - * Currently available options: - * - * * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring - * service with a Kubernetes-native resource model - * * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no - * longer available as of GKE 1.15). - * * `none` - No metrics will be exported from the cluster. - * - * If left as an empty string,`monitoring.googleapis.com/kubernetes` will be - * used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to set monitoring. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.set_monitoring_service.js - * region_tag:container_v1beta1_generated_ClusterManager_SetMonitoringService_async - */ - setMonitoringService( - request?: protos.google.container.v1beta1.ISetMonitoringServiceRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMonitoringServiceRequest|undefined, {}|undefined - ]>; - setMonitoringService( - request: protos.google.container.v1beta1.ISetMonitoringServiceRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMonitoringServiceRequest|null|undefined, - {}|null|undefined>): void; - setMonitoringService( - request: protos.google.container.v1beta1.ISetMonitoringServiceRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMonitoringServiceRequest|null|undefined, - {}|null|undefined>): void; - setMonitoringService( - request?: protos.google.container.v1beta1.ISetMonitoringServiceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMonitoringServiceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMonitoringServiceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMonitoringServiceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setMonitoringService(request, options, callback); - } -/** - * Sets the addons for a specific cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {google.container.v1beta1.AddonsConfig} request.addonsConfig - * Required. The desired configurations for the various addons available to - * run in the cluster. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to set addons. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.set_addons_config.js - * region_tag:container_v1beta1_generated_ClusterManager_SetAddonsConfig_async - */ - setAddonsConfig( - request?: protos.google.container.v1beta1.ISetAddonsConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetAddonsConfigRequest|undefined, {}|undefined - ]>; - setAddonsConfig( - request: protos.google.container.v1beta1.ISetAddonsConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetAddonsConfigRequest|null|undefined, - {}|null|undefined>): void; - setAddonsConfig( - request: protos.google.container.v1beta1.ISetAddonsConfigRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetAddonsConfigRequest|null|undefined, - {}|null|undefined>): void; - setAddonsConfig( - request?: protos.google.container.v1beta1.ISetAddonsConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetAddonsConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetAddonsConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetAddonsConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setAddonsConfig(request, options, callback); - } -/** - * Sets the locations for a specific cluster. - * Deprecated. Use - * [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters/update) - * instead. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string[]} request.locations - * Required. The desired list of Google Compute Engine - * [zones](https://cloud.google.com/compute/docs/zones#available) 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. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to set locations. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.set_locations.js - * region_tag:container_v1beta1_generated_ClusterManager_SetLocations_async - * @deprecated SetLocations is deprecated and may be removed in a future version. - */ - setLocations( - request?: protos.google.container.v1beta1.ISetLocationsRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLocationsRequest|undefined, {}|undefined - ]>; - setLocations( - request: protos.google.container.v1beta1.ISetLocationsRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLocationsRequest|null|undefined, - {}|null|undefined>): void; - setLocations( - request: protos.google.container.v1beta1.ISetLocationsRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLocationsRequest|null|undefined, - {}|null|undefined>): void; - setLocations( - request?: protos.google.container.v1beta1.ISetLocationsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLocationsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLocationsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLocationsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - this.warn('DEP$ClusterManager-$SetLocations','SetLocations is deprecated and may be removed in a future version.', 'DeprecationWarning'); - return this.innerApiCalls.setLocations(request, options, callback); - } -/** - * Updates the master for a specific cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {string} request.masterVersion - * 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 - * @param {string} request.name - * The name (project, location, cluster) of the cluster to update. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.update_master.js - * region_tag:container_v1beta1_generated_ClusterManager_UpdateMaster_async - */ - updateMaster( - request?: protos.google.container.v1beta1.IUpdateMasterRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateMasterRequest|undefined, {}|undefined - ]>; - updateMaster( - request: protos.google.container.v1beta1.IUpdateMasterRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateMasterRequest|null|undefined, - {}|null|undefined>): void; - updateMaster( - request: protos.google.container.v1beta1.IUpdateMasterRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateMasterRequest|null|undefined, - {}|null|undefined>): void; - updateMaster( - request?: protos.google.container.v1beta1.IUpdateMasterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateMasterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateMasterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IUpdateMasterRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateMaster(request, options, callback); - } -/** - * Sets master auth materials. Currently supports changing the admin password - * or a specific cluster, either via password generation or explicitly setting - * the password. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to upgrade. - * This field has been deprecated and replaced by the name field. - * @param {google.container.v1beta1.SetMasterAuthRequest.Action} request.action - * Required. The exact form of action to be taken on the master auth. - * @param {google.container.v1beta1.MasterAuth} request.update - * Required. A description of the update. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to set auth. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.set_master_auth.js - * region_tag:container_v1beta1_generated_ClusterManager_SetMasterAuth_async - */ - setMasterAuth( - request?: protos.google.container.v1beta1.ISetMasterAuthRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMasterAuthRequest|undefined, {}|undefined - ]>; - setMasterAuth( - request: protos.google.container.v1beta1.ISetMasterAuthRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMasterAuthRequest|null|undefined, - {}|null|undefined>): void; - setMasterAuth( - request: protos.google.container.v1beta1.ISetMasterAuthRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMasterAuthRequest|null|undefined, - {}|null|undefined>): void; - setMasterAuth( - request?: protos.google.container.v1beta1.ISetMasterAuthRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMasterAuthRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMasterAuthRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMasterAuthRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setMasterAuth(request, options, callback); - } -/** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to delete. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to delete. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.delete_cluster.js - * region_tag:container_v1beta1_generated_ClusterManager_DeleteCluster_async - */ - deleteCluster( - request?: protos.google.container.v1beta1.IDeleteClusterRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IDeleteClusterRequest|undefined, {}|undefined - ]>; - deleteCluster( - request: protos.google.container.v1beta1.IDeleteClusterRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IDeleteClusterRequest|null|undefined, - {}|null|undefined>): void; - deleteCluster( - request: protos.google.container.v1beta1.IDeleteClusterRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IDeleteClusterRequest|null|undefined, - {}|null|undefined>): void; - deleteCluster( - request?: protos.google.container.v1beta1.IDeleteClusterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IDeleteClusterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IDeleteClusterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IDeleteClusterRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteCluster(request, options, callback); - } -/** - * Lists all operations in a project in the specified zone or all zones. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the parent field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) to return - * operations for, or `-` for all zones. This field has been deprecated and - * replaced by the parent field. - * @param {string} request.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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.ListOperationsResponse | ListOperationsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.list_operations.js - * region_tag:container_v1beta1_generated_ClusterManager_ListOperations_async - */ - listOperations( - request?: protos.google.container.v1beta1.IListOperationsRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IListOperationsResponse, - protos.google.container.v1beta1.IListOperationsRequest|undefined, {}|undefined - ]>; - listOperations( - request: protos.google.container.v1beta1.IListOperationsRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IListOperationsResponse, - protos.google.container.v1beta1.IListOperationsRequest|null|undefined, - {}|null|undefined>): void; - listOperations( - request: protos.google.container.v1beta1.IListOperationsRequest, - callback: Callback< - protos.google.container.v1beta1.IListOperationsResponse, - protos.google.container.v1beta1.IListOperationsRequest|null|undefined, - {}|null|undefined>): void; - listOperations( - request?: protos.google.container.v1beta1.IListOperationsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IListOperationsResponse, - protos.google.container.v1beta1.IListOperationsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IListOperationsResponse, - protos.google.container.v1beta1.IListOperationsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IListOperationsResponse, - protos.google.container.v1beta1.IListOperationsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - }); - this.initialize(); - return this.innerApiCalls.listOperations(request, options, callback); - } -/** - * Gets the specified operation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.operationId - * Required. Deprecated. The server-assigned `name` of the operation. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, operation id) of the operation to get. - * Specified in the format `projects/* /locations/* /operations/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.get_operation.js - * region_tag:container_v1beta1_generated_ClusterManager_GetOperation_async - */ - getOperation( - request?: protos.google.container.v1beta1.IGetOperationRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IGetOperationRequest|undefined, {}|undefined - ]>; - getOperation( - request: protos.google.container.v1beta1.IGetOperationRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IGetOperationRequest|null|undefined, - {}|null|undefined>): void; - getOperation( - request: protos.google.container.v1beta1.IGetOperationRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IGetOperationRequest|null|undefined, - {}|null|undefined>): void; - getOperation( - request?: protos.google.container.v1beta1.IGetOperationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IGetOperationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IGetOperationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IGetOperationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'operation_id': request.operationId ?? '', - }); - this.initialize(); - return this.innerApiCalls.getOperation(request, options, callback); - } -/** - * Cancels the specified operation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * operation resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.operationId - * Required. Deprecated. The server-assigned `name` of the operation. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, operation id) of the operation to cancel. - * Specified in the format `projects/* /locations/* /operations/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.cancel_operation.js - * region_tag:container_v1beta1_generated_ClusterManager_CancelOperation_async - */ - cancelOperation( - request?: protos.google.container.v1beta1.ICancelOperationRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.container.v1beta1.ICancelOperationRequest|undefined, {}|undefined - ]>; - cancelOperation( - request: protos.google.container.v1beta1.ICancelOperationRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1beta1.ICancelOperationRequest|null|undefined, - {}|null|undefined>): void; - cancelOperation( - request: protos.google.container.v1beta1.ICancelOperationRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1beta1.ICancelOperationRequest|null|undefined, - {}|null|undefined>): void; - cancelOperation( - request?: protos.google.container.v1beta1.ICancelOperationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1beta1.ICancelOperationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1beta1.ICancelOperationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.container.v1beta1.ICancelOperationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'operation_id': request.operationId ?? '', - }); - this.initialize(); - return this.innerApiCalls.cancelOperation(request, options, callback); - } -/** - * Returns configuration info about the Google Kubernetes Engine service. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) to return - * operations for. This field has been deprecated and replaced by the name - * field. - * @param {string} request.name - * The name (project and location) of the server config to get, - * specified in the format `projects/* /locations/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.ServerConfig | ServerConfig}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.get_server_config.js - * region_tag:container_v1beta1_generated_ClusterManager_GetServerConfig_async - */ - getServerConfig( - request?: protos.google.container.v1beta1.IGetServerConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IServerConfig, - protos.google.container.v1beta1.IGetServerConfigRequest|undefined, {}|undefined - ]>; - getServerConfig( - request: protos.google.container.v1beta1.IGetServerConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IServerConfig, - protos.google.container.v1beta1.IGetServerConfigRequest|null|undefined, - {}|null|undefined>): void; - getServerConfig( - request: protos.google.container.v1beta1.IGetServerConfigRequest, - callback: Callback< - protos.google.container.v1beta1.IServerConfig, - protos.google.container.v1beta1.IGetServerConfigRequest|null|undefined, - {}|null|undefined>): void; - getServerConfig( - request?: protos.google.container.v1beta1.IGetServerConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IServerConfig, - protos.google.container.v1beta1.IGetServerConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IServerConfig, - protos.google.container.v1beta1.IGetServerConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IServerConfig, - protos.google.container.v1beta1.IGetServerConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - }); - this.initialize(); - return this.innerApiCalls.getServerConfig(request, options, callback); - } -/** - * Gets the public component of the cluster signing keys in - * JSON Web Key format. - * This API is not yet intended for general use, and is not available for all - * clusters. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The cluster (project, location, cluster name) to get keys for. Specified in - * the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.GetJSONWebKeysResponse | GetJSONWebKeysResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.get_j_s_o_n_web_keys.js - * region_tag:container_v1beta1_generated_ClusterManager_GetJSONWebKeys_async - */ - getJSONWebKeys( - request?: protos.google.container.v1beta1.IGetJSONWebKeysRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IGetJSONWebKeysResponse, - protos.google.container.v1beta1.IGetJSONWebKeysRequest|undefined, {}|undefined - ]>; - getJSONWebKeys( - request: protos.google.container.v1beta1.IGetJSONWebKeysRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IGetJSONWebKeysResponse, - protos.google.container.v1beta1.IGetJSONWebKeysRequest|null|undefined, - {}|null|undefined>): void; - getJSONWebKeys( - request: protos.google.container.v1beta1.IGetJSONWebKeysRequest, - callback: Callback< - protos.google.container.v1beta1.IGetJSONWebKeysResponse, - protos.google.container.v1beta1.IGetJSONWebKeysRequest|null|undefined, - {}|null|undefined>): void; - getJSONWebKeys( - request?: protos.google.container.v1beta1.IGetJSONWebKeysRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IGetJSONWebKeysResponse, - protos.google.container.v1beta1.IGetJSONWebKeysRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IGetJSONWebKeysResponse, - protos.google.container.v1beta1.IGetJSONWebKeysRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IGetJSONWebKeysResponse, - protos.google.container.v1beta1.IGetJSONWebKeysRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.getJsonWebKeys(request, options, callback); - } -/** - * Lists the node pools for a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the parent field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the parent - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the parent field. - * @param {string} request.parent - * The parent (project, location, cluster name) where the node pools will be - * listed. Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.ListNodePoolsResponse | ListNodePoolsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.list_node_pools.js - * region_tag:container_v1beta1_generated_ClusterManager_ListNodePools_async - */ - listNodePools( - request?: protos.google.container.v1beta1.IListNodePoolsRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IListNodePoolsResponse, - protos.google.container.v1beta1.IListNodePoolsRequest|undefined, {}|undefined - ]>; - listNodePools( - request: protos.google.container.v1beta1.IListNodePoolsRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IListNodePoolsResponse, - protos.google.container.v1beta1.IListNodePoolsRequest|null|undefined, - {}|null|undefined>): void; - listNodePools( - request: protos.google.container.v1beta1.IListNodePoolsRequest, - callback: Callback< - protos.google.container.v1beta1.IListNodePoolsResponse, - protos.google.container.v1beta1.IListNodePoolsRequest|null|undefined, - {}|null|undefined>): void; - listNodePools( - request?: protos.google.container.v1beta1.IListNodePoolsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IListNodePoolsResponse, - protos.google.container.v1beta1.IListNodePoolsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IListNodePoolsResponse, - protos.google.container.v1beta1.IListNodePoolsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IListNodePoolsResponse, - protos.google.container.v1beta1.IListNodePoolsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.listNodePools(request, options, callback); - } -/** - * Retrieves the requested node pool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Required. Deprecated. The name of the node pool. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster, node pool id) of the node pool to - * get. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.NodePool | NodePool}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.get_node_pool.js - * region_tag:container_v1beta1_generated_ClusterManager_GetNodePool_async - */ - getNodePool( - request?: protos.google.container.v1beta1.IGetNodePoolRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.INodePool, - protos.google.container.v1beta1.IGetNodePoolRequest|undefined, {}|undefined - ]>; - getNodePool( - request: protos.google.container.v1beta1.IGetNodePoolRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.INodePool, - protos.google.container.v1beta1.IGetNodePoolRequest|null|undefined, - {}|null|undefined>): void; - getNodePool( - request: protos.google.container.v1beta1.IGetNodePoolRequest, - callback: Callback< - protos.google.container.v1beta1.INodePool, - protos.google.container.v1beta1.IGetNodePoolRequest|null|undefined, - {}|null|undefined>): void; - getNodePool( - request?: protos.google.container.v1beta1.IGetNodePoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.INodePool, - protos.google.container.v1beta1.IGetNodePoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.INodePool, - protos.google.container.v1beta1.IGetNodePoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.INodePool, - protos.google.container.v1beta1.IGetNodePoolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.getNodePool(request, options, callback); - } -/** - * Creates a node pool for a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the parent field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the parent - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the parent field. - * @param {google.container.v1beta1.NodePool} request.nodePool - * Required. The node pool to create. - * @param {string} request.parent - * The parent (project, location, cluster name) where the node pool will be - * created. Specified in the format - * `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.create_node_pool.js - * region_tag:container_v1beta1_generated_ClusterManager_CreateNodePool_async - */ - createNodePool( - request?: protos.google.container.v1beta1.ICreateNodePoolRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICreateNodePoolRequest|undefined, {}|undefined - ]>; - createNodePool( - request: protos.google.container.v1beta1.ICreateNodePoolRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICreateNodePoolRequest|null|undefined, - {}|null|undefined>): void; - createNodePool( - request: protos.google.container.v1beta1.ICreateNodePoolRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICreateNodePoolRequest|null|undefined, - {}|null|undefined>): void; - createNodePool( - request?: protos.google.container.v1beta1.ICreateNodePoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICreateNodePoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICreateNodePoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICreateNodePoolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.createNodePool(request, options, callback); - } -/** - * Deletes a node pool from a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Required. Deprecated. The name of the node pool to delete. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster, node pool id) of the node pool to - * delete. Specified in the format - * `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.delete_node_pool.js - * region_tag:container_v1beta1_generated_ClusterManager_DeleteNodePool_async - */ - deleteNodePool( - request?: protos.google.container.v1beta1.IDeleteNodePoolRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IDeleteNodePoolRequest|undefined, {}|undefined - ]>; - deleteNodePool( - request: protos.google.container.v1beta1.IDeleteNodePoolRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IDeleteNodePoolRequest|null|undefined, - {}|null|undefined>): void; - deleteNodePool( - request: protos.google.container.v1beta1.IDeleteNodePoolRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IDeleteNodePoolRequest|null|undefined, - {}|null|undefined>): void; - deleteNodePool( - request?: protos.google.container.v1beta1.IDeleteNodePoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IDeleteNodePoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IDeleteNodePoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IDeleteNodePoolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteNodePool(request, options, callback); - } -/** - * CompleteNodePoolUpgrade will signal an on-going node pool upgrade to - * complete. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The name (project, location, cluster, node pool id) of the node pool to - * complete upgrade. - * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.complete_node_pool_upgrade.js - * region_tag:container_v1beta1_generated_ClusterManager_CompleteNodePoolUpgrade_async - */ - completeNodePoolUpgrade( - request?: protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest|undefined, {}|undefined - ]>; - completeNodePoolUpgrade( - request: protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>): void; - completeNodePoolUpgrade( - request: protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>): void; - completeNodePoolUpgrade( - request?: protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.completeNodePoolUpgrade(request, options, callback); - } -/** - * Rolls back a previously Aborted or Failed NodePool upgrade. - * This makes no changes if the last upgrade successfully completed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to rollback. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Required. Deprecated. The name of the node pool to rollback. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster, node pool id) of the node poll to - * rollback upgrade. - * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {boolean} request.respectPdb - * Option for rollback to ignore the PodDisruptionBudget. - * Default value is false. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.rollback_node_pool_upgrade.js - * region_tag:container_v1beta1_generated_ClusterManager_RollbackNodePoolUpgrade_async - */ - rollbackNodePoolUpgrade( - request?: protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest|undefined, {}|undefined - ]>; - rollbackNodePoolUpgrade( - request: protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>): void; - rollbackNodePoolUpgrade( - request: protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>): void; - rollbackNodePoolUpgrade( - request?: protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IRollbackNodePoolUpgradeRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.rollbackNodePoolUpgrade(request, options, callback); - } -/** - * Sets the NodeManagement options for a node pool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to update. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Required. Deprecated. The name of the node pool to update. - * This field has been deprecated and replaced by the name field. - * @param {google.container.v1beta1.NodeManagement} request.management - * Required. NodeManagement configuration for the node pool. - * @param {string} request.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/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.set_node_pool_management.js - * region_tag:container_v1beta1_generated_ClusterManager_SetNodePoolManagement_async - */ - setNodePoolManagement( - request?: protos.google.container.v1beta1.ISetNodePoolManagementRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolManagementRequest|undefined, {}|undefined - ]>; - setNodePoolManagement( - request: protos.google.container.v1beta1.ISetNodePoolManagementRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolManagementRequest|null|undefined, - {}|null|undefined>): void; - setNodePoolManagement( - request: protos.google.container.v1beta1.ISetNodePoolManagementRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolManagementRequest|null|undefined, - {}|null|undefined>): void; - setNodePoolManagement( - request?: protos.google.container.v1beta1.ISetNodePoolManagementRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolManagementRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolManagementRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolManagementRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setNodePoolManagement(request, options, callback); - } -/** - * Sets labels on a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the name field. - * @param {number[]} request.resourceLabels - * Required. The labels to set for that cluster. - * @param {string} request.labelFingerprint - * 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. - * @param {string} request.name - * The name (project, location, cluster name) of the cluster to set labels. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.set_labels.js - * region_tag:container_v1beta1_generated_ClusterManager_SetLabels_async - */ - setLabels( - request?: protos.google.container.v1beta1.ISetLabelsRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLabelsRequest|undefined, {}|undefined - ]>; - setLabels( - request: protos.google.container.v1beta1.ISetLabelsRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLabelsRequest|null|undefined, - {}|null|undefined>): void; - setLabels( - request: protos.google.container.v1beta1.ISetLabelsRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLabelsRequest|null|undefined, - {}|null|undefined>): void; - setLabels( - request?: protos.google.container.v1beta1.ISetLabelsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLabelsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLabelsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLabelsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setLabels(request, options, callback); - } -/** - * Enables or disables the ABAC authorization mechanism on a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to update. - * This field has been deprecated and replaced by the name field. - * @param {boolean} request.enabled - * Required. Whether ABAC authorization will be enabled in the cluster. - * @param {string} request.name - * The name (project, location, cluster name) of the cluster to set legacy - * abac. Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.set_legacy_abac.js - * region_tag:container_v1beta1_generated_ClusterManager_SetLegacyAbac_async - */ - setLegacyAbac( - request?: protos.google.container.v1beta1.ISetLegacyAbacRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLegacyAbacRequest|undefined, {}|undefined - ]>; - setLegacyAbac( - request: protos.google.container.v1beta1.ISetLegacyAbacRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLegacyAbacRequest|null|undefined, - {}|null|undefined>): void; - setLegacyAbac( - request: protos.google.container.v1beta1.ISetLegacyAbacRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLegacyAbacRequest|null|undefined, - {}|null|undefined>): void; - setLegacyAbac( - request?: protos.google.container.v1beta1.ISetLegacyAbacRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLegacyAbacRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLegacyAbacRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetLegacyAbacRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setLegacyAbac(request, options, callback); - } -/** - * Starts master IP rotation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster name) of the cluster to start IP - * rotation. Specified in the format `projects/* /locations/* /clusters/*`. - * @param {boolean} request.rotateCredentials - * Whether to rotate credentials during IP rotation. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.start_i_p_rotation.js - * region_tag:container_v1beta1_generated_ClusterManager_StartIPRotation_async - */ - startIPRotation( - request?: protos.google.container.v1beta1.IStartIPRotationRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IStartIPRotationRequest|undefined, {}|undefined - ]>; - startIPRotation( - request: protos.google.container.v1beta1.IStartIPRotationRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IStartIPRotationRequest|null|undefined, - {}|null|undefined>): void; - startIPRotation( - request: protos.google.container.v1beta1.IStartIPRotationRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IStartIPRotationRequest|null|undefined, - {}|null|undefined>): void; - startIPRotation( - request?: protos.google.container.v1beta1.IStartIPRotationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IStartIPRotationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IStartIPRotationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.IStartIPRotationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.startIpRotation(request, options, callback); - } -/** - * Completes master IP rotation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the name field. - * @param {string} request.name - * The name (project, location, cluster name) of the cluster to complete IP - * rotation. Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.complete_i_p_rotation.js - * region_tag:container_v1beta1_generated_ClusterManager_CompleteIPRotation_async - */ - completeIPRotation( - request?: protos.google.container.v1beta1.ICompleteIPRotationRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICompleteIPRotationRequest|undefined, {}|undefined - ]>; - completeIPRotation( - request: protos.google.container.v1beta1.ICompleteIPRotationRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICompleteIPRotationRequest|null|undefined, - {}|null|undefined>): void; - completeIPRotation( - request: protos.google.container.v1beta1.ICompleteIPRotationRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICompleteIPRotationRequest|null|undefined, - {}|null|undefined>): void; - completeIPRotation( - request?: protos.google.container.v1beta1.ICompleteIPRotationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICompleteIPRotationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICompleteIPRotationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ICompleteIPRotationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.completeIpRotation(request, options, callback); - } -/** - * SetNodePoolSizeRequest sets the size of a node pool. The new size will be - * used for all replicas, including future replicas created by modifying - * {@link google.container.v1beta1.NodePool.locations|NodePool.locations}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster to update. - * This field has been deprecated and replaced by the name field. - * @param {string} request.nodePoolId - * Required. Deprecated. The name of the node pool to update. - * This field has been deprecated and replaced by the name field. - * @param {number} request.nodeCount - * Required. The desired node count for the pool. - * @param {string} request.name - * The name (project, location, cluster, node pool id) of the node pool to set - * size. - * Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.set_node_pool_size.js - * region_tag:container_v1beta1_generated_ClusterManager_SetNodePoolSize_async - */ - setNodePoolSize( - request?: protos.google.container.v1beta1.ISetNodePoolSizeRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolSizeRequest|undefined, {}|undefined - ]>; - setNodePoolSize( - request: protos.google.container.v1beta1.ISetNodePoolSizeRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolSizeRequest|null|undefined, - {}|null|undefined>): void; - setNodePoolSize( - request: protos.google.container.v1beta1.ISetNodePoolSizeRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolSizeRequest|null|undefined, - {}|null|undefined>): void; - setNodePoolSize( - request?: protos.google.container.v1beta1.ISetNodePoolSizeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolSizeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolSizeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNodePoolSizeRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - 'node_pool_id': request.nodePoolId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setNodePoolSize(request, options, callback); - } -/** - * Enables or disables Network Policy for a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Deprecated. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * This field has been deprecated and replaced by the name field. - * @param {string} request.zone - * Required. Deprecated. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. This field has been deprecated and replaced by the name - * field. - * @param {string} request.clusterId - * Required. Deprecated. The name of the cluster. - * This field has been deprecated and replaced by the name field. - * @param {google.container.v1beta1.NetworkPolicy} request.networkPolicy - * Required. Configuration options for the NetworkPolicy feature. - * @param {string} request.name - * The name (project, location, cluster name) of the cluster to set networking - * policy. Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.set_network_policy.js - * region_tag:container_v1beta1_generated_ClusterManager_SetNetworkPolicy_async - */ - setNetworkPolicy( - request?: protos.google.container.v1beta1.ISetNetworkPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNetworkPolicyRequest|undefined, {}|undefined - ]>; - setNetworkPolicy( - request: protos.google.container.v1beta1.ISetNetworkPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNetworkPolicyRequest|null|undefined, - {}|null|undefined>): void; - setNetworkPolicy( - request: protos.google.container.v1beta1.ISetNetworkPolicyRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNetworkPolicyRequest|null|undefined, - {}|null|undefined>): void; - setNetworkPolicy( - request?: protos.google.container.v1beta1.ISetNetworkPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNetworkPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNetworkPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetNetworkPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setNetworkPolicy(request, options, callback); - } -/** - * Sets the maintenance policy for a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The Google Developers Console [project ID or project - * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - * @param {string} request.zone - * Required. The name of the Google Compute Engine - * [zone](https://cloud.google.com/compute/docs/zones#available) in which the - * cluster resides. - * @param {string} request.clusterId - * Required. The name of the cluster to update. - * @param {google.container.v1beta1.MaintenancePolicy} request.maintenancePolicy - * Required. The maintenance policy to be set for the cluster. An empty field - * clears the existing maintenance policy. - * @param {string} request.name - * The name (project, location, cluster name) of the cluster to set - * maintenance policy. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.Operation | Operation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.set_maintenance_policy.js - * region_tag:container_v1beta1_generated_ClusterManager_SetMaintenancePolicy_async - */ - setMaintenancePolicy( - request?: protos.google.container.v1beta1.ISetMaintenancePolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMaintenancePolicyRequest|undefined, {}|undefined - ]>; - setMaintenancePolicy( - request: protos.google.container.v1beta1.ISetMaintenancePolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMaintenancePolicyRequest|null|undefined, - {}|null|undefined>): void; - setMaintenancePolicy( - request: protos.google.container.v1beta1.ISetMaintenancePolicyRequest, - callback: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMaintenancePolicyRequest|null|undefined, - {}|null|undefined>): void; - setMaintenancePolicy( - request?: protos.google.container.v1beta1.ISetMaintenancePolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMaintenancePolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMaintenancePolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IOperation, - protos.google.container.v1beta1.ISetMaintenancePolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - 'project_id': request.projectId ?? '', - 'zone': request.zone ?? '', - 'cluster_id': request.clusterId ?? '', - }); - this.initialize(); - return this.innerApiCalls.setMaintenancePolicy(request, options, callback); - } -/** - * Checks the cluster compatibility with Autopilot mode, and returns a list of - * compatibility issues. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The name (project, location, cluster) of the cluster to retrieve. - * Specified in the format `projects/* /locations/* /clusters/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.CheckAutopilotCompatibilityResponse | CheckAutopilotCompatibilityResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js - * region_tag:container_v1beta1_generated_ClusterManager_CheckAutopilotCompatibility_async - */ - checkAutopilotCompatibility( - request?: protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, - protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest|undefined, {}|undefined - ]>; - checkAutopilotCompatibility( - request: protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, - protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest|null|undefined, - {}|null|undefined>): void; - checkAutopilotCompatibility( - request: protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest, - callback: Callback< - protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, - protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest|null|undefined, - {}|null|undefined>): void; - checkAutopilotCompatibility( - request?: protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, - protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, - protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, - protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.checkAutopilotCompatibility(request, options, callback); - } -/** - * Fetches locations that offer Google Kubernetes Engine. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Contains the name of the resource requested. - * Specified in the format `projects/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.container.v1beta1.ListLocationsResponse | ListLocationsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.list_locations.js - * region_tag:container_v1beta1_generated_ClusterManager_ListLocations_async - */ - listLocations( - request?: protos.google.container.v1beta1.IListLocationsRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IListLocationsResponse, - protos.google.container.v1beta1.IListLocationsRequest|undefined, {}|undefined - ]>; - listLocations( - request: protos.google.container.v1beta1.IListLocationsRequest, - options: CallOptions, - callback: Callback< - protos.google.container.v1beta1.IListLocationsResponse, - protos.google.container.v1beta1.IListLocationsRequest|null|undefined, - {}|null|undefined>): void; - listLocations( - request: protos.google.container.v1beta1.IListLocationsRequest, - callback: Callback< - protos.google.container.v1beta1.IListLocationsResponse, - protos.google.container.v1beta1.IListLocationsRequest|null|undefined, - {}|null|undefined>): void; - listLocations( - request?: protos.google.container.v1beta1.IListLocationsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.container.v1beta1.IListLocationsResponse, - protos.google.container.v1beta1.IListLocationsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.container.v1beta1.IListLocationsResponse, - protos.google.container.v1beta1.IListLocationsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.container.v1beta1.IListLocationsResponse, - protos.google.container.v1beta1.IListLocationsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listLocations(request, options, callback); - } - - /** - * Lists subnetworks that can be used for creating clusters in a project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent project where subnetworks are usable. - * Specified in the format `projects/*`. - * @param {string} request.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. - * @param {number} request.pageSize - * 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) - * @param {string} request.pageToken - * Specifies a page token to use. Set this to the nextPageToken returned by - * previous list requests to get the next page of results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link google.container.v1beta1.UsableSubnetwork | UsableSubnetwork}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listUsableSubnetworksAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listUsableSubnetworks( - request?: protos.google.container.v1beta1.IListUsableSubnetworksRequest, - options?: CallOptions): - Promise<[ - protos.google.container.v1beta1.IUsableSubnetwork[], - protos.google.container.v1beta1.IListUsableSubnetworksRequest|null, - protos.google.container.v1beta1.IListUsableSubnetworksResponse - ]>; - listUsableSubnetworks( - request: protos.google.container.v1beta1.IListUsableSubnetworksRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.container.v1beta1.IListUsableSubnetworksRequest, - protos.google.container.v1beta1.IListUsableSubnetworksResponse|null|undefined, - protos.google.container.v1beta1.IUsableSubnetwork>): void; - listUsableSubnetworks( - request: protos.google.container.v1beta1.IListUsableSubnetworksRequest, - callback: PaginationCallback< - protos.google.container.v1beta1.IListUsableSubnetworksRequest, - protos.google.container.v1beta1.IListUsableSubnetworksResponse|null|undefined, - protos.google.container.v1beta1.IUsableSubnetwork>): void; - listUsableSubnetworks( - request?: protos.google.container.v1beta1.IListUsableSubnetworksRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.container.v1beta1.IListUsableSubnetworksRequest, - protos.google.container.v1beta1.IListUsableSubnetworksResponse|null|undefined, - protos.google.container.v1beta1.IUsableSubnetwork>, - callback?: PaginationCallback< - protos.google.container.v1beta1.IListUsableSubnetworksRequest, - protos.google.container.v1beta1.IListUsableSubnetworksResponse|null|undefined, - protos.google.container.v1beta1.IUsableSubnetwork>): - Promise<[ - protos.google.container.v1beta1.IUsableSubnetwork[], - protos.google.container.v1beta1.IListUsableSubnetworksRequest|null, - protos.google.container.v1beta1.IListUsableSubnetworksResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listUsableSubnetworks(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent project where subnetworks are usable. - * Specified in the format `projects/*`. - * @param {string} request.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. - * @param {number} request.pageSize - * 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) - * @param {string} request.pageToken - * Specifies a page token to use. Set this to the nextPageToken returned by - * previous list requests to get the next page of results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link google.container.v1beta1.UsableSubnetwork | UsableSubnetwork} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listUsableSubnetworksAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listUsableSubnetworksStream( - request?: protos.google.container.v1beta1.IListUsableSubnetworksRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listUsableSubnetworks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listUsableSubnetworks.createStream( - this.innerApiCalls.listUsableSubnetworks as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listUsableSubnetworks`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent project where subnetworks are usable. - * Specified in the format `projects/*`. - * @param {string} request.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. - * @param {number} request.pageSize - * 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) - * @param {string} request.pageToken - * Specifies a page token to use. Set this to the nextPageToken returned by - * previous list requests to get the next page of results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * {@link google.container.v1beta1.UsableSubnetwork | UsableSubnetwork}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1beta1/cluster_manager.list_usable_subnetworks.js - * region_tag:container_v1beta1_generated_ClusterManager_ListUsableSubnetworks_async - */ - listUsableSubnetworksAsync( - request?: protos.google.container.v1beta1.IListUsableSubnetworksRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listUsableSubnetworks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listUsableSubnetworks.asyncIterate( - this.innerApiCalls['listUsableSubnetworks'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.clusterManagerStub && !this._terminated) { - return this.clusterManagerStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client_config.json b/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client_config.json deleted file mode 100644 index 911352f9362..00000000000 --- a/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_client_config.json +++ /dev/null @@ -1,198 +0,0 @@ -{ - "interfaces": { - "google.container.v1beta1.ClusterManager": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListClusters": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetCluster": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateCluster": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateCluster": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateNodePool": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetNodePoolAutoscaling": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetLoggingService": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetMonitoringService": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetAddonsConfig": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetLocations": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateMaster": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetMasterAuth": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteCluster": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListOperations": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetOperation": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CancelOperation": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetServerConfig": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetJSONWebKeys": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListNodePools": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetNodePool": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateNodePool": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteNodePool": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CompleteNodePoolUpgrade": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RollbackNodePoolUpgrade": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetNodePoolManagement": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetLabels": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetLegacyAbac": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "StartIPRotation": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CompleteIPRotation": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetNodePoolSize": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetNetworkPolicy": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetMaintenancePolicy": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListUsableSubnetworks": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CheckAutopilotCompatibility": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListLocations": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_proto_list.json b/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_proto_list.json deleted file mode 100644 index 7a594ccf698..00000000000 --- a/owl-bot-staging/google-container/v1beta1/src/v1beta1/cluster_manager_proto_list.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - "../../protos/google/container/v1beta1/cluster_service.proto" -] diff --git a/owl-bot-staging/google-container/v1beta1/src/v1beta1/gapic_metadata.json b/owl-bot-staging/google-container/v1beta1/src/v1beta1/gapic_metadata.json deleted file mode 100644 index 0278af900c2..00000000000 --- a/owl-bot-staging/google-container/v1beta1/src/v1beta1/gapic_metadata.json +++ /dev/null @@ -1,377 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.container.v1beta1", - "libraryPackage": "@google-cloud/container", - "services": { - "ClusterManager": { - "clients": { - "grpc": { - "libraryClient": "ClusterManagerClient", - "rpcs": { - "ListClusters": { - "methods": [ - "listClusters" - ] - }, - "GetCluster": { - "methods": [ - "getCluster" - ] - }, - "CreateCluster": { - "methods": [ - "createCluster" - ] - }, - "UpdateCluster": { - "methods": [ - "updateCluster" - ] - }, - "UpdateNodePool": { - "methods": [ - "updateNodePool" - ] - }, - "SetNodePoolAutoscaling": { - "methods": [ - "setNodePoolAutoscaling" - ] - }, - "SetLoggingService": { - "methods": [ - "setLoggingService" - ] - }, - "SetMonitoringService": { - "methods": [ - "setMonitoringService" - ] - }, - "SetAddonsConfig": { - "methods": [ - "setAddonsConfig" - ] - }, - "SetLocations": { - "methods": [ - "setLocations" - ] - }, - "UpdateMaster": { - "methods": [ - "updateMaster" - ] - }, - "SetMasterAuth": { - "methods": [ - "setMasterAuth" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "ListOperations": { - "methods": [ - "listOperations" - ] - }, - "GetOperation": { - "methods": [ - "getOperation" - ] - }, - "CancelOperation": { - "methods": [ - "cancelOperation" - ] - }, - "GetServerConfig": { - "methods": [ - "getServerConfig" - ] - }, - "GetJSONWebKeys": { - "methods": [ - "getJSONWebKeys" - ] - }, - "ListNodePools": { - "methods": [ - "listNodePools" - ] - }, - "GetNodePool": { - "methods": [ - "getNodePool" - ] - }, - "CreateNodePool": { - "methods": [ - "createNodePool" - ] - }, - "DeleteNodePool": { - "methods": [ - "deleteNodePool" - ] - }, - "CompleteNodePoolUpgrade": { - "methods": [ - "completeNodePoolUpgrade" - ] - }, - "RollbackNodePoolUpgrade": { - "methods": [ - "rollbackNodePoolUpgrade" - ] - }, - "SetNodePoolManagement": { - "methods": [ - "setNodePoolManagement" - ] - }, - "SetLabels": { - "methods": [ - "setLabels" - ] - }, - "SetLegacyAbac": { - "methods": [ - "setLegacyAbac" - ] - }, - "StartIPRotation": { - "methods": [ - "startIPRotation" - ] - }, - "CompleteIPRotation": { - "methods": [ - "completeIPRotation" - ] - }, - "SetNodePoolSize": { - "methods": [ - "setNodePoolSize" - ] - }, - "SetNetworkPolicy": { - "methods": [ - "setNetworkPolicy" - ] - }, - "SetMaintenancePolicy": { - "methods": [ - "setMaintenancePolicy" - ] - }, - "CheckAutopilotCompatibility": { - "methods": [ - "checkAutopilotCompatibility" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - }, - "ListUsableSubnetworks": { - "methods": [ - "listUsableSubnetworks", - "listUsableSubnetworksStream", - "listUsableSubnetworksAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "ClusterManagerClient", - "rpcs": { - "ListClusters": { - "methods": [ - "listClusters" - ] - }, - "GetCluster": { - "methods": [ - "getCluster" - ] - }, - "CreateCluster": { - "methods": [ - "createCluster" - ] - }, - "UpdateCluster": { - "methods": [ - "updateCluster" - ] - }, - "UpdateNodePool": { - "methods": [ - "updateNodePool" - ] - }, - "SetNodePoolAutoscaling": { - "methods": [ - "setNodePoolAutoscaling" - ] - }, - "SetLoggingService": { - "methods": [ - "setLoggingService" - ] - }, - "SetMonitoringService": { - "methods": [ - "setMonitoringService" - ] - }, - "SetAddonsConfig": { - "methods": [ - "setAddonsConfig" - ] - }, - "SetLocations": { - "methods": [ - "setLocations" - ] - }, - "UpdateMaster": { - "methods": [ - "updateMaster" - ] - }, - "SetMasterAuth": { - "methods": [ - "setMasterAuth" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "ListOperations": { - "methods": [ - "listOperations" - ] - }, - "GetOperation": { - "methods": [ - "getOperation" - ] - }, - "CancelOperation": { - "methods": [ - "cancelOperation" - ] - }, - "GetServerConfig": { - "methods": [ - "getServerConfig" - ] - }, - "GetJSONWebKeys": { - "methods": [ - "getJSONWebKeys" - ] - }, - "ListNodePools": { - "methods": [ - "listNodePools" - ] - }, - "GetNodePool": { - "methods": [ - "getNodePool" - ] - }, - "CreateNodePool": { - "methods": [ - "createNodePool" - ] - }, - "DeleteNodePool": { - "methods": [ - "deleteNodePool" - ] - }, - "CompleteNodePoolUpgrade": { - "methods": [ - "completeNodePoolUpgrade" - ] - }, - "RollbackNodePoolUpgrade": { - "methods": [ - "rollbackNodePoolUpgrade" - ] - }, - "SetNodePoolManagement": { - "methods": [ - "setNodePoolManagement" - ] - }, - "SetLabels": { - "methods": [ - "setLabels" - ] - }, - "SetLegacyAbac": { - "methods": [ - "setLegacyAbac" - ] - }, - "StartIPRotation": { - "methods": [ - "startIPRotation" - ] - }, - "CompleteIPRotation": { - "methods": [ - "completeIPRotation" - ] - }, - "SetNodePoolSize": { - "methods": [ - "setNodePoolSize" - ] - }, - "SetNetworkPolicy": { - "methods": [ - "setNetworkPolicy" - ] - }, - "SetMaintenancePolicy": { - "methods": [ - "setMaintenancePolicy" - ] - }, - "CheckAutopilotCompatibility": { - "methods": [ - "checkAutopilotCompatibility" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - }, - "ListUsableSubnetworks": { - "methods": [ - "listUsableSubnetworks", - "listUsableSubnetworksStream", - "listUsableSubnetworksAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-container/v1beta1/src/v1beta1/index.ts b/owl-bot-staging/google-container/v1beta1/src/v1beta1/index.ts deleted file mode 100644 index b1b39233034..00000000000 --- a/owl-bot-staging/google-container/v1beta1/src/v1beta1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {ClusterManagerClient} from './cluster_manager_client'; diff --git a/owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 1101d781caa..00000000000 --- a/owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const container = require('@google-cloud/container'); - -function main() { - const clusterManagerClient = new container.ClusterManagerClient(); -} - -main(); diff --git a/owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 6685b8649e6..00000000000 --- a/owl-bot-staging/google-container/v1beta1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {ClusterManagerClient} from '@google-cloud/container'; - -// check that the client class type name can be used -function doStuffWithClusterManagerClient(client: ClusterManagerClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const clusterManagerClient = new ClusterManagerClient(); - doStuffWithClusterManagerClient(clusterManagerClient); -} - -main(); diff --git a/owl-bot-staging/google-container/v1beta1/system-test/install.ts b/owl-bot-staging/google-container/v1beta1/system-test/install.ts deleted file mode 100644 index c8f81b25a86..00000000000 --- a/owl-bot-staging/google-container/v1beta1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/google-container/v1beta1/test/gapic_cluster_manager_v1beta1.ts b/owl-bot-staging/google-container/v1beta1/test/gapic_cluster_manager_v1beta1.ts deleted file mode 100644 index 7f93f752f2c..00000000000 --- a/owl-bot-staging/google-container/v1beta1/test/gapic_cluster_manager_v1beta1.ts +++ /dev/null @@ -1,5238 +0,0 @@ -// Copyright 2023 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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as clustermanagerModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta1.ClusterManagerClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = clustermanagerModule.v1beta1.ClusterManagerClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = clustermanagerModule.v1beta1.ClusterManagerClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = clustermanagerModule.v1beta1.ClusterManagerClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.clusterManagerStub, undefined); - await client.initialize(); - assert(client.clusterManagerStub); - }); - - it('has close method for the initialized client', done => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.clusterManagerStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.clusterManagerStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - }); - - describe('listClusters', () => { - it('invokes listClusters without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.ListClustersResponse() - ); - client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); - const [response] = await client.listClusters(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClusters without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.ListClustersResponse() - ); - client.innerApiCalls.listClusters = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listClusters( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IListClustersResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClusters with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listClusters = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listClusters(request), expectedError); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClusters with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.ListClustersRequest', ['zone']); - request.zone = defaultValue3; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.listClusters(request), expectedError); - }); - }); - - describe('getCluster', () => { - it('invokes getCluster without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Cluster() - ); - client.innerApiCalls.getCluster = stubSimpleCall(expectedResponse); - const [response] = await client.getCluster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Cluster() - ); - client.innerApiCalls.getCluster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCluster( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.ICluster|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCluster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.GetClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getCluster(request), expectedError); - }); - }); - - describe('createCluster', () => { - it('invokes createCluster without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.createCluster = stubSimpleCall(expectedResponse); - const [response] = await client.createCluster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.createCluster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCluster( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCluster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CreateClusterRequest', ['zone']); - request.zone = defaultValue3; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createCluster(request), expectedError); - }); - }); - - describe('updateCluster', () => { - it('invokes updateCluster without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.UpdateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.updateCluster = stubSimpleCall(expectedResponse); - const [response] = await client.updateCluster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.UpdateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.updateCluster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateCluster( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.UpdateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCluster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.UpdateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.UpdateClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateCluster(request), expectedError); - }); - }); - - describe('updateNodePool', () => { - it('invokes updateNodePool without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.UpdateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.updateNodePool = stubSimpleCall(expectedResponse); - const [response] = await client.updateNodePool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateNodePool without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.UpdateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.updateNodePool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateNodePool( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateNodePool with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.UpdateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateNodePool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateNodePool(request), expectedError); - const actualRequest = (client.innerApiCalls.updateNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateNodePool with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.UpdateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.UpdateNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateNodePool(request), expectedError); - }); - }); - - describe('setNodePoolAutoscaling', () => { - it('invokes setNodePoolAutoscaling without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNodePoolAutoscalingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCall(expectedResponse); - const [response] = await client.setNodePoolAutoscaling(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolAutoscaling without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNodePoolAutoscalingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setNodePoolAutoscaling( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolAutoscaling with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNodePoolAutoscalingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setNodePoolAutoscaling(request), expectedError); - const actualRequest = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolAutoscaling as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolAutoscaling with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNodePoolAutoscalingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolAutoscalingRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setNodePoolAutoscaling(request), expectedError); - }); - }); - - describe('setLoggingService', () => { - it('invokes setLoggingService without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLoggingServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setLoggingService = stubSimpleCall(expectedResponse); - const [response] = await client.setLoggingService(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLoggingService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLoggingService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLoggingService without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLoggingServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setLoggingService = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setLoggingService( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLoggingService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLoggingService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLoggingService with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLoggingServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setLoggingService = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setLoggingService(request), expectedError); - const actualRequest = (client.innerApiCalls.setLoggingService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLoggingService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLoggingService with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLoggingServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLoggingServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setLoggingService(request), expectedError); - }); - }); - - describe('setMonitoringService', () => { - it('invokes setMonitoringService without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetMonitoringServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setMonitoringService = stubSimpleCall(expectedResponse); - const [response] = await client.setMonitoringService(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setMonitoringService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMonitoringService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMonitoringService without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetMonitoringServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setMonitoringService = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setMonitoringService( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setMonitoringService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMonitoringService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMonitoringService with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetMonitoringServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setMonitoringService = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setMonitoringService(request), expectedError); - const actualRequest = (client.innerApiCalls.setMonitoringService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMonitoringService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMonitoringService with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetMonitoringServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetMonitoringServiceRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setMonitoringService(request), expectedError); - }); - }); - - describe('setAddonsConfig', () => { - it('invokes setAddonsConfig without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetAddonsConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setAddonsConfig = stubSimpleCall(expectedResponse); - const [response] = await client.setAddonsConfig(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setAddonsConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setAddonsConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setAddonsConfig without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetAddonsConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setAddonsConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setAddonsConfig( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setAddonsConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setAddonsConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setAddonsConfig with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetAddonsConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setAddonsConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setAddonsConfig(request), expectedError); - const actualRequest = (client.innerApiCalls.setAddonsConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setAddonsConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setAddonsConfig with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetAddonsConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetAddonsConfigRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setAddonsConfig(request), expectedError); - }); - }); - - describe('setLocations', () => { - it('invokes setLocations without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLocationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setLocations = stubSimpleCall(expectedResponse); - const [response] = await client.setLocations(request); - assert(stub.calledOnce); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLocations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLocations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLocations without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLocationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setLocations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setLocations( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert(stub.calledOnce); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLocations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLocations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLocations with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLocationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setLocations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setLocations(request), expectedError); - assert(stub.calledOnce); - const actualRequest = (client.innerApiCalls.setLocations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLocations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLocations with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLocationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLocationsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setLocations(request), expectedError); - assert(stub.calledOnce); - }); - }); - - describe('updateMaster', () => { - it('invokes updateMaster without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.UpdateMasterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.updateMaster = stubSimpleCall(expectedResponse); - const [response] = await client.updateMaster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateMaster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateMaster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateMaster without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.UpdateMasterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.updateMaster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateMaster( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateMaster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateMaster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateMaster with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.UpdateMasterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateMaster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateMaster(request), expectedError); - const actualRequest = (client.innerApiCalls.updateMaster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateMaster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateMaster with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.UpdateMasterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.UpdateMasterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateMaster(request), expectedError); - }); - }); - - describe('setMasterAuth', () => { - it('invokes setMasterAuth without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetMasterAuthRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setMasterAuth = stubSimpleCall(expectedResponse); - const [response] = await client.setMasterAuth(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setMasterAuth as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMasterAuth as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMasterAuth without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetMasterAuthRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setMasterAuth = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setMasterAuth( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setMasterAuth as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMasterAuth as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMasterAuth with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetMasterAuthRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setMasterAuth = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setMasterAuth(request), expectedError); - const actualRequest = (client.innerApiCalls.setMasterAuth as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMasterAuth as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMasterAuth with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetMasterAuthRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetMasterAuthRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setMasterAuth(request), expectedError); - }); - }); - - describe('deleteCluster', () => { - it('invokes deleteCluster without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.deleteCluster = stubSimpleCall(expectedResponse); - const [response] = await client.deleteCluster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.deleteCluster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteCluster( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCluster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.DeleteClusterRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteCluster(request), expectedError); - }); - }); - - describe('listOperations', () => { - it('invokes listOperations without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.ListOperationsResponse() - ); - client.innerApiCalls.listOperations = stubSimpleCall(expectedResponse); - const [response] = await client.listOperations(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listOperations without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.ListOperationsResponse() - ); - client.innerApiCalls.listOperations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listOperations( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IListOperationsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listOperations with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listOperations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listOperations(request), expectedError); - const actualRequest = (client.innerApiCalls.listOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listOperations with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.ListOperationsRequest', ['zone']); - request.zone = defaultValue3; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.listOperations(request), expectedError); - }); - }); - - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.getOperation = stubSimpleCall(expectedResponse); - const [response] = await client.getOperation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getOperation without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.getOperation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getOperation( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getOperation with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getOperation(request), expectedError); - const actualRequest = (client.innerApiCalls.getOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getOperation with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.GetOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getOperation(request), expectedError); - }); - }); - - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CancelOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.cancelOperation = stubSimpleCall(expectedResponse); - const [response] = await client.cancelOperation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelOperation without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CancelOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.cancelOperation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelOperation( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelOperation with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CancelOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&operation_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelOperation(request), expectedError); - const actualRequest = (client.innerApiCalls.cancelOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelOperation with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CancelOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.CancelOperationRequest', ['operationId']); - request.operationId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.cancelOperation(request), expectedError); - }); - }); - - describe('getServerConfig', () => { - it('invokes getServerConfig without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetServerConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.ServerConfig() - ); - client.innerApiCalls.getServerConfig = stubSimpleCall(expectedResponse); - const [response] = await client.getServerConfig(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getServerConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getServerConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getServerConfig without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetServerConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.ServerConfig() - ); - client.innerApiCalls.getServerConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getServerConfig( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IServerConfig|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getServerConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getServerConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getServerConfig with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetServerConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['zone']); - request.zone = defaultValue3; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getServerConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getServerConfig(request), expectedError); - const actualRequest = (client.innerApiCalls.getServerConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getServerConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getServerConfig with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetServerConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetServerConfigRequest', ['zone']); - request.zone = defaultValue3; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getServerConfig(request), expectedError); - }); - }); - - describe('getJSONWebKeys', () => { - it('invokes getJSONWebKeys without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetJSONWebKeysRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetJSONWebKeysRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.GetJSONWebKeysResponse() - ); - client.innerApiCalls.getJsonWebKeys = stubSimpleCall(expectedResponse); - const [response] = await client.getJSONWebKeys(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getJsonWebKeys as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJsonWebKeys as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJSONWebKeys without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetJSONWebKeysRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetJSONWebKeysRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.GetJSONWebKeysResponse() - ); - client.innerApiCalls.getJsonWebKeys = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getJSONWebKeys( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IGetJSONWebKeysResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getJsonWebKeys as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJsonWebKeys as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJSONWebKeys with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetJSONWebKeysRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetJSONWebKeysRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getJsonWebKeys = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getJSONWebKeys(request), expectedError); - const actualRequest = (client.innerApiCalls.getJsonWebKeys as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJsonWebKeys as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJSONWebKeys with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetJSONWebKeysRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetJSONWebKeysRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getJSONWebKeys(request), expectedError); - }); - }); - - describe('listNodePools', () => { - it('invokes listNodePools without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListNodePoolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.ListNodePoolsResponse() - ); - client.innerApiCalls.listNodePools = stubSimpleCall(expectedResponse); - const [response] = await client.listNodePools(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listNodePools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNodePools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNodePools without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListNodePoolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.ListNodePoolsResponse() - ); - client.innerApiCalls.listNodePools = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listNodePools( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IListNodePoolsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listNodePools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNodePools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNodePools with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListNodePoolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listNodePools = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listNodePools(request), expectedError); - const actualRequest = (client.innerApiCalls.listNodePools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNodePools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNodePools with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListNodePoolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.ListNodePoolsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.listNodePools(request), expectedError); - }); - }); - - describe('getNodePool', () => { - it('invokes getNodePool without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.NodePool() - ); - client.innerApiCalls.getNodePool = stubSimpleCall(expectedResponse); - const [response] = await client.getNodePool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNodePool without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.NodePool() - ); - client.innerApiCalls.getNodePool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getNodePool( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.INodePool|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNodePool with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getNodePool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getNodePool(request), expectedError); - const actualRequest = (client.innerApiCalls.getNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNodePool with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.GetNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.GetNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getNodePool(request), expectedError); - }); - }); - - describe('createNodePool', () => { - it('invokes createNodePool without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CreateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.createNodePool = stubSimpleCall(expectedResponse); - const [response] = await client.createNodePool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createNodePool without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CreateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.createNodePool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createNodePool( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createNodePool with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CreateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `parent=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createNodePool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createNodePool(request), expectedError); - const actualRequest = (client.innerApiCalls.createNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createNodePool with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CreateNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['parent']); - request.parent = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.CreateNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createNodePool(request), expectedError); - }); - }); - - describe('deleteNodePool', () => { - it('invokes deleteNodePool without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.DeleteNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.deleteNodePool = stubSimpleCall(expectedResponse); - const [response] = await client.deleteNodePool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteNodePool without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.DeleteNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.deleteNodePool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteNodePool( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteNodePool with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.DeleteNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteNodePool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteNodePool(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteNodePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteNodePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteNodePool with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.DeleteNodePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.DeleteNodePoolRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteNodePool(request), expectedError); - }); - }); - - describe('completeNodePoolUpgrade', () => { - it('invokes completeNodePoolUpgrade without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CompleteNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CompleteNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.completeNodePoolUpgrade = stubSimpleCall(expectedResponse); - const [response] = await client.completeNodePoolUpgrade(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes completeNodePoolUpgrade without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CompleteNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CompleteNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.completeNodePoolUpgrade = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.completeNodePoolUpgrade( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes completeNodePoolUpgrade with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CompleteNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CompleteNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.completeNodePoolUpgrade = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.completeNodePoolUpgrade(request), expectedError); - const actualRequest = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeNodePoolUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes completeNodePoolUpgrade with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CompleteNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CompleteNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.completeNodePoolUpgrade(request), expectedError); - }); - }); - - describe('rollbackNodePoolUpgrade', () => { - it('invokes rollbackNodePoolUpgrade without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.RollbackNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCall(expectedResponse); - const [response] = await client.rollbackNodePoolUpgrade(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollbackNodePoolUpgrade without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.RollbackNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.rollbackNodePoolUpgrade( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollbackNodePoolUpgrade with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.RollbackNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.rollbackNodePoolUpgrade(request), expectedError); - const actualRequest = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackNodePoolUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollbackNodePoolUpgrade with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.RollbackNodePoolUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.RollbackNodePoolUpgradeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.rollbackNodePoolUpgrade(request), expectedError); - }); - }); - - describe('setNodePoolManagement', () => { - it('invokes setNodePoolManagement without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNodePoolManagementRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setNodePoolManagement = stubSimpleCall(expectedResponse); - const [response] = await client.setNodePoolManagement(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNodePoolManagement as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolManagement as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolManagement without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNodePoolManagementRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setNodePoolManagement = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setNodePoolManagement( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNodePoolManagement as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolManagement as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolManagement with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNodePoolManagementRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setNodePoolManagement = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setNodePoolManagement(request), expectedError); - const actualRequest = (client.innerApiCalls.setNodePoolManagement as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolManagement as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolManagement with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNodePoolManagementRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolManagementRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setNodePoolManagement(request), expectedError); - }); - }); - - describe('setLabels', () => { - it('invokes setLabels without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLabelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); - const [response] = await client.setLabels(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLabels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLabels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLabels without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLabelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setLabels = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setLabels( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLabels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLabels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLabels with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLabelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setLabels = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setLabels(request), expectedError); - const actualRequest = (client.innerApiCalls.setLabels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLabels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLabels with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLabelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLabelsRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setLabels(request), expectedError); - }); - }); - - describe('setLegacyAbac', () => { - it('invokes setLegacyAbac without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLegacyAbacRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setLegacyAbac = stubSimpleCall(expectedResponse); - const [response] = await client.setLegacyAbac(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLegacyAbac as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLegacyAbac as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLegacyAbac without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLegacyAbacRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setLegacyAbac = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setLegacyAbac( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setLegacyAbac as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLegacyAbac as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLegacyAbac with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLegacyAbacRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setLegacyAbac = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setLegacyAbac(request), expectedError); - const actualRequest = (client.innerApiCalls.setLegacyAbac as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setLegacyAbac as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setLegacyAbac with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetLegacyAbacRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetLegacyAbacRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setLegacyAbac(request), expectedError); - }); - }); - - describe('startIPRotation', () => { - it('invokes startIPRotation without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.StartIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.startIpRotation = stubSimpleCall(expectedResponse); - const [response] = await client.startIPRotation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.startIpRotation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.startIpRotation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes startIPRotation without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.StartIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.startIpRotation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.startIPRotation( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.startIpRotation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.startIpRotation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes startIPRotation with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.StartIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.startIpRotation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.startIPRotation(request), expectedError); - const actualRequest = (client.innerApiCalls.startIpRotation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.startIpRotation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes startIPRotation with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.StartIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.StartIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.startIPRotation(request), expectedError); - }); - }); - - describe('completeIPRotation', () => { - it('invokes completeIPRotation without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CompleteIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.completeIpRotation = stubSimpleCall(expectedResponse); - const [response] = await client.completeIPRotation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.completeIpRotation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeIpRotation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes completeIPRotation without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CompleteIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.completeIpRotation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.completeIPRotation( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.completeIpRotation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeIpRotation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes completeIPRotation with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CompleteIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.completeIpRotation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.completeIPRotation(request), expectedError); - const actualRequest = (client.innerApiCalls.completeIpRotation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeIpRotation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes completeIPRotation with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CompleteIPRotationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.CompleteIPRotationRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.completeIPRotation(request), expectedError); - }); - }); - - describe('setNodePoolSize', () => { - it('invokes setNodePoolSize without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNodePoolSizeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setNodePoolSize = stubSimpleCall(expectedResponse); - const [response] = await client.setNodePoolSize(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNodePoolSize as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolSize as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolSize without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNodePoolSizeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setNodePoolSize = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setNodePoolSize( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNodePoolSize as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolSize as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolSize with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNodePoolSizeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}&node_pool_id=${defaultValue5}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setNodePoolSize = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setNodePoolSize(request), expectedError); - const actualRequest = (client.innerApiCalls.setNodePoolSize as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNodePoolSize as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNodePoolSize with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNodePoolSizeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['clusterId']); - request.clusterId = defaultValue4; - const defaultValue5 = - getTypeDefaultValue('.google.container.v1beta1.SetNodePoolSizeRequest', ['nodePoolId']); - request.nodePoolId = defaultValue5; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setNodePoolSize(request), expectedError); - }); - }); - - describe('setNetworkPolicy', () => { - it('invokes setNetworkPolicy without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNetworkPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setNetworkPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.setNetworkPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNetworkPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNetworkPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNetworkPolicy without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNetworkPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setNetworkPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setNetworkPolicy( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setNetworkPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNetworkPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNetworkPolicy with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNetworkPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setNetworkPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setNetworkPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.setNetworkPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setNetworkPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setNetworkPolicy with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetNetworkPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetNetworkPolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setNetworkPolicy(request), expectedError); - }); - }); - - describe('setMaintenancePolicy', () => { - it('invokes setMaintenancePolicy without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetMaintenancePolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setMaintenancePolicy = stubSimpleCall(expectedResponse); - const [response] = await client.setMaintenancePolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setMaintenancePolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMaintenancePolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMaintenancePolicy without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetMaintenancePolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.Operation() - ); - client.innerApiCalls.setMaintenancePolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setMaintenancePolicy( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setMaintenancePolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMaintenancePolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMaintenancePolicy with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetMaintenancePolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedHeaderRequestParams = `name=${defaultValue1}&project_id=${defaultValue2}&zone=${defaultValue3}&cluster_id=${defaultValue4}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setMaintenancePolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setMaintenancePolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.setMaintenancePolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setMaintenancePolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setMaintenancePolicy with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.SetMaintenancePolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['name']); - request.name = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['projectId']); - request.projectId = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['zone']); - request.zone = defaultValue3; - const defaultValue4 = - getTypeDefaultValue('.google.container.v1beta1.SetMaintenancePolicyRequest', ['clusterId']); - request.clusterId = defaultValue4; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setMaintenancePolicy(request), expectedError); - }); - }); - - describe('checkAutopilotCompatibility', () => { - it('invokes checkAutopilotCompatibility without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CheckAutopilotCompatibilityRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CheckAutopilotCompatibilityRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.CheckAutopilotCompatibilityResponse() - ); - client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCall(expectedResponse); - const [response] = await client.checkAutopilotCompatibility(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkAutopilotCompatibility without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CheckAutopilotCompatibilityRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CheckAutopilotCompatibilityRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.CheckAutopilotCompatibilityResponse() - ); - client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.checkAutopilotCompatibility( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkAutopilotCompatibility with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CheckAutopilotCompatibilityRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CheckAutopilotCompatibilityRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkAutopilotCompatibility(request), expectedError); - const actualRequest = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkAutopilotCompatibility as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkAutopilotCompatibility with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.CheckAutopilotCompatibilityRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.CheckAutopilotCompatibilityRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.checkAutopilotCompatibility(request), expectedError); - }); - }); - - describe('listLocations', () => { - it('invokes listLocations without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListLocationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListLocationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.ListLocationsResponse() - ); - client.innerApiCalls.listLocations = stubSimpleCall(expectedResponse); - const [response] = await client.listLocations(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listLocations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listLocations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listLocations without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListLocationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListLocationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.container.v1beta1.ListLocationsResponse() - ); - client.innerApiCalls.listLocations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listLocations( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IListLocationsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listLocations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listLocations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listLocations with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListLocationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListLocationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listLocations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listLocations(request), expectedError); - const actualRequest = (client.innerApiCalls.listLocations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listLocations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listLocations with closed client', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListLocationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListLocationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.listLocations(request), expectedError); - }); - }); - - describe('listUsableSubnetworks', () => { - it('invokes listUsableSubnetworks without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), - ]; - client.innerApiCalls.listUsableSubnetworks = stubSimpleCall(expectedResponse); - const [response] = await client.listUsableSubnetworks(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listUsableSubnetworks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUsableSubnetworks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listUsableSubnetworks without error using callback', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), - ]; - client.innerApiCalls.listUsableSubnetworks = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listUsableSubnetworks( - request, - (err?: Error|null, result?: protos.google.container.v1beta1.IUsableSubnetwork[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listUsableSubnetworks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUsableSubnetworks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listUsableSubnetworks with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listUsableSubnetworks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listUsableSubnetworks(request), expectedError); - const actualRequest = (client.innerApiCalls.listUsableSubnetworks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUsableSubnetworks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listUsableSubnetworksStream without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), - ]; - client.descriptors.page.listUsableSubnetworks.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listUsableSubnetworksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.container.v1beta1.UsableSubnetwork[] = []; - stream.on('data', (response: protos.google.container.v1beta1.UsableSubnetwork) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listUsableSubnetworks, request)); - assert( - (client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listUsableSubnetworksStream with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listUsableSubnetworks.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listUsableSubnetworksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.container.v1beta1.UsableSubnetwork[] = []; - stream.on('data', (response: protos.google.container.v1beta1.UsableSubnetwork) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listUsableSubnetworks, request)); - assert( - (client.descriptors.page.listUsableSubnetworks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listUsableSubnetworks without error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), - generateSampleMessage(new protos.google.container.v1beta1.UsableSubnetwork()), - ]; - client.descriptors.page.listUsableSubnetworks.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.container.v1beta1.IUsableSubnetwork[] = []; - const iterable = client.listUsableSubnetworksAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listUsableSubnetworks with error', async () => { - const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.container.v1beta1.ListUsableSubnetworksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.container.v1beta1.ListUsableSubnetworksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listUsableSubnetworks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listUsableSubnetworksAsync(request); - await assert.rejects(async () => { - const responses: protos.google.container.v1beta1.IUsableSubnetwork[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listUsableSubnetworks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); -}); diff --git a/owl-bot-staging/google-container/v1beta1/tsconfig.json b/owl-bot-staging/google-container/v1beta1/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-container/v1beta1/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/google-container/v1beta1/webpack.config.js b/owl-bot-staging/google-container/v1beta1/webpack.config.js deleted file mode 100644 index 9032271af9d..00000000000 --- a/owl-bot-staging/google-container/v1beta1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 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. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'ClusterManager', - filename: './cluster-manager.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/packages/google-container/protos/google/container/v1/cluster_service.proto b/packages/google-container/protos/google/container/v1/cluster_service.proto index 8fa1e9d0069..83149cc4f44 100644 --- a/packages/google-container/protos/google/container/v1/cluster_service.proto +++ b/packages/google-container/protos/google/container/v1/cluster_service.proto @@ -615,6 +615,9 @@ message NodeKubeletConfig { // Controls the maximum number of processes allowed to run in a pod. The value // must be greater than or equal to 1024 and less than 4194304. int64 pod_pids_limit = 4; + + // Enable or disable Kubelet read only port. + optional bool insecure_kubelet_readonly_port_enabled = 7; } // Parameters that describe the nodes in a cluster. @@ -917,6 +920,12 @@ message NodeNetworkConfig { // Example: max_pods_per_node of 30 will result in 32 IPs (/27) when // overprovisioning is disabled. PodCIDROverprovisionConfig pod_cidr_overprovision_config = 13; + + // Output only. [Output only] The utilization of the IPv4 range for the pod. + // The ratio is Usage/[Total number of IPs in the secondary range], + // Usage=numNodes*numZones*podIPsPerNode. + double pod_ipv4_range_utilization = 16 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // A set of Shielded Instance options. @@ -1178,6 +1187,9 @@ message AddonsConfig { // Configuration for the Backup for GKE agent addon. GkeBackupAgentConfig gke_backup_agent_config = 16; + + // Configuration for the Cloud Storage Fuse CSI driver. + GcsFuseCsiDriverConfig gcs_fuse_csi_driver_config = 17; } // Configuration options for the HTTP (L7) load balancing controller addon, @@ -1308,6 +1320,12 @@ message GcpFilestoreCsiDriverConfig { bool enabled = 1; } +// Configuration for the Cloud Storage Fuse CSI driver. +message GcsFuseCsiDriverConfig { + // Whether the Cloud Storage Fuse CSI driver is enabled for this cluster. + bool enabled = 1; +} + // Configuration for the Backup for GKE Agent. message GkeBackupAgentConfig { // Whether the Backup for GKE agent is enabled for this cluster. @@ -1555,6 +1573,12 @@ message IPAllocationPolicy { // IPAllocationPolicy. AdditionalPodRangesConfig additional_pod_ranges_config = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output only] The utilization of the cluster default IPv4 + // range for the pod. The ratio is Usage/[Total number of IPs in the secondary + // range], Usage=numNodes*numZones*podIPsPerNode. + double default_pod_ipv4_range_utilization = 25 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // A Google Kubernetes Engine cluster. @@ -2204,6 +2228,19 @@ message ClusterUpdate { message AdditionalPodRangesConfig { // Name for pod secondary ipv4 range which has the actual range defined ahead. repeated string pod_range_names = 1; + + // Output only. [Output only] Information for additional pod range. + repeated RangeInfo pod_range_info = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// RangeInfo contains the range name and the range utilization by this cluster. +message RangeInfo { + // Output only. [Output only] Name of a range. + string range_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output only] The utilization of the range. + double utilization = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; } // This operation resource represents operations that may have happened or are @@ -3815,6 +3852,9 @@ message AutoprovisioningNodePoolDefaults { // https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for // available image types. string image_type = 10; + + // Enable or disable Kubelet read only port. + optional bool insecure_kubelet_readonly_port_enabled = 13; } // Contains information about amount of some resource in the cluster. @@ -4467,7 +4507,7 @@ message DNSConfig { // Use CloudDNS for DNS resolution. CLOUD_DNS = 2; - // Use KubeDNS for DNS resolution + // Use KubeDNS for DNS resolution. KUBE_DNS = 3; } @@ -4931,6 +4971,35 @@ message MonitoringConfig { // Enable Google Cloud Managed Service for Prometheus // in the cluster. ManagedPrometheusConfig managed_prometheus_config = 2; + + // Configuration of Advanced Datapath Observability features. + AdvancedDatapathObservabilityConfig advanced_datapath_observability_config = + 3; +} + +// AdvancedDatapathObservabilityConfig specifies configuration of observability +// features of advanced datapath. +message AdvancedDatapathObservabilityConfig { + // Supported Relay modes + enum RelayMode { + // Default value. This shouldn't be used. + RELAY_MODE_UNSPECIFIED = 0; + + // disabled + DISABLED = 1; + + // exposed via internal load balancer + INTERNAL_VPC_LB = 3; + + // exposed via external load balancer + EXTERNAL_LB = 4; + } + + // Expose flow metrics on nodes + bool enable_metrics = 1; + + // Method used to make Relay available + RelayMode relay_mode = 2; } // NodePoolLoggingConfig specifies logging configuration for nodepools. diff --git a/packages/google-container/protos/protos.d.ts b/packages/google-container/protos/protos.d.ts index d65adf502c7..b69e8845f52 100644 --- a/packages/google-container/protos/protos.d.ts +++ b/packages/google-container/protos/protos.d.ts @@ -995,6 +995,9 @@ export namespace google { /** NodeKubeletConfig podPidsLimit */ podPidsLimit?: (number|Long|string|null); + + /** NodeKubeletConfig insecureKubeletReadonlyPortEnabled */ + insecureKubeletReadonlyPortEnabled?: (boolean|null); } /** Represents a NodeKubeletConfig. */ @@ -1018,6 +1021,12 @@ export namespace google { /** NodeKubeletConfig podPidsLimit. */ public podPidsLimit: (number|Long|string); + /** NodeKubeletConfig insecureKubeletReadonlyPortEnabled. */ + public insecureKubeletReadonlyPortEnabled?: (boolean|null); + + /** NodeKubeletConfig _insecureKubeletReadonlyPortEnabled. */ + public _insecureKubeletReadonlyPortEnabled?: "insecureKubeletReadonlyPortEnabled"; + /** * Creates a new NodeKubeletConfig instance using the specified properties. * @param [properties] Properties to set @@ -1514,6 +1523,9 @@ export namespace google { /** NodeNetworkConfig podCidrOverprovisionConfig */ podCidrOverprovisionConfig?: (google.container.v1.IPodCIDROverprovisionConfig|null); + + /** NodeNetworkConfig podIpv4RangeUtilization */ + podIpv4RangeUtilization?: (number|null); } /** Represents a NodeNetworkConfig. */ @@ -1543,6 +1555,9 @@ export namespace google { /** NodeNetworkConfig podCidrOverprovisionConfig. */ public podCidrOverprovisionConfig?: (google.container.v1.IPodCIDROverprovisionConfig|null); + /** NodeNetworkConfig podIpv4RangeUtilization. */ + public podIpv4RangeUtilization: number; + /** NodeNetworkConfig _enablePrivateNodes. */ public _enablePrivateNodes?: "enablePrivateNodes"; @@ -3148,6 +3163,9 @@ export namespace google { /** AddonsConfig gkeBackupAgentConfig */ gkeBackupAgentConfig?: (google.container.v1.IGkeBackupAgentConfig|null); + + /** AddonsConfig gcsFuseCsiDriverConfig */ + gcsFuseCsiDriverConfig?: (google.container.v1.IGcsFuseCsiDriverConfig|null); } /** Represents an AddonsConfig. */ @@ -3189,6 +3207,9 @@ export namespace google { /** AddonsConfig gkeBackupAgentConfig. */ public gkeBackupAgentConfig?: (google.container.v1.IGkeBackupAgentConfig|null); + /** AddonsConfig gcsFuseCsiDriverConfig. */ + public gcsFuseCsiDriverConfig?: (google.container.v1.IGcsFuseCsiDriverConfig|null); + /** * Creates a new AddonsConfig instance using the specified properties. * @param [properties] Properties to set @@ -4495,6 +4516,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a GcsFuseCsiDriverConfig. */ + interface IGcsFuseCsiDriverConfig { + + /** GcsFuseCsiDriverConfig enabled */ + enabled?: (boolean|null); + } + + /** Represents a GcsFuseCsiDriverConfig. */ + class GcsFuseCsiDriverConfig implements IGcsFuseCsiDriverConfig { + + /** + * Constructs a new GcsFuseCsiDriverConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.container.v1.IGcsFuseCsiDriverConfig); + + /** GcsFuseCsiDriverConfig enabled. */ + public enabled: boolean; + + /** + * Creates a new GcsFuseCsiDriverConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsFuseCsiDriverConfig instance + */ + public static create(properties?: google.container.v1.IGcsFuseCsiDriverConfig): google.container.v1.GcsFuseCsiDriverConfig; + + /** + * Encodes the specified GcsFuseCsiDriverConfig message. Does not implicitly {@link google.container.v1.GcsFuseCsiDriverConfig.verify|verify} messages. + * @param message GcsFuseCsiDriverConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.container.v1.IGcsFuseCsiDriverConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsFuseCsiDriverConfig message, length delimited. Does not implicitly {@link google.container.v1.GcsFuseCsiDriverConfig.verify|verify} messages. + * @param message GcsFuseCsiDriverConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.container.v1.IGcsFuseCsiDriverConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsFuseCsiDriverConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsFuseCsiDriverConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.container.v1.GcsFuseCsiDriverConfig; + + /** + * Decodes a GcsFuseCsiDriverConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsFuseCsiDriverConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.container.v1.GcsFuseCsiDriverConfig; + + /** + * Verifies a GcsFuseCsiDriverConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsFuseCsiDriverConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsFuseCsiDriverConfig + */ + public static fromObject(object: { [k: string]: any }): google.container.v1.GcsFuseCsiDriverConfig; + + /** + * Creates a plain object from a GcsFuseCsiDriverConfig message. Also converts values to other types if specified. + * @param message GcsFuseCsiDriverConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.container.v1.GcsFuseCsiDriverConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsFuseCsiDriverConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsFuseCsiDriverConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a GkeBackupAgentConfig. */ interface IGkeBackupAgentConfig { @@ -5288,6 +5406,9 @@ export namespace google { /** IPAllocationPolicy additionalPodRangesConfig */ additionalPodRangesConfig?: (google.container.v1.IAdditionalPodRangesConfig|null); + + /** IPAllocationPolicy defaultPodIpv4RangeUtilization */ + defaultPodIpv4RangeUtilization?: (number|null); } /** Represents a IPAllocationPolicy. */ @@ -5356,6 +5477,9 @@ export namespace google { /** IPAllocationPolicy additionalPodRangesConfig. */ public additionalPodRangesConfig?: (google.container.v1.IAdditionalPodRangesConfig|null); + /** IPAllocationPolicy defaultPodIpv4RangeUtilization. */ + public defaultPodIpv4RangeUtilization: number; + /** * Creates a new IPAllocationPolicy instance using the specified properties. * @param [properties] Properties to set @@ -6854,6 +6978,9 @@ export namespace google { /** AdditionalPodRangesConfig podRangeNames */ podRangeNames?: (string[]|null); + + /** AdditionalPodRangesConfig podRangeInfo */ + podRangeInfo?: (google.container.v1.IRangeInfo[]|null); } /** Represents an AdditionalPodRangesConfig. */ @@ -6868,6 +6995,9 @@ export namespace google { /** AdditionalPodRangesConfig podRangeNames. */ public podRangeNames: string[]; + /** AdditionalPodRangesConfig podRangeInfo. */ + public podRangeInfo: google.container.v1.IRangeInfo[]; + /** * Creates a new AdditionalPodRangesConfig instance using the specified properties. * @param [properties] Properties to set @@ -6946,6 +7076,109 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a RangeInfo. */ + interface IRangeInfo { + + /** RangeInfo rangeName */ + rangeName?: (string|null); + + /** RangeInfo utilization */ + utilization?: (number|null); + } + + /** Represents a RangeInfo. */ + class RangeInfo implements IRangeInfo { + + /** + * Constructs a new RangeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.container.v1.IRangeInfo); + + /** RangeInfo rangeName. */ + public rangeName: string; + + /** RangeInfo utilization. */ + public utilization: number; + + /** + * Creates a new RangeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns RangeInfo instance + */ + public static create(properties?: google.container.v1.IRangeInfo): google.container.v1.RangeInfo; + + /** + * Encodes the specified RangeInfo message. Does not implicitly {@link google.container.v1.RangeInfo.verify|verify} messages. + * @param message RangeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.container.v1.IRangeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RangeInfo message, length delimited. Does not implicitly {@link google.container.v1.RangeInfo.verify|verify} messages. + * @param message RangeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.container.v1.IRangeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RangeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RangeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.container.v1.RangeInfo; + + /** + * Decodes a RangeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RangeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.container.v1.RangeInfo; + + /** + * Verifies a RangeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RangeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RangeInfo + */ + public static fromObject(object: { [k: string]: any }): google.container.v1.RangeInfo; + + /** + * Creates a plain object from a RangeInfo message. Also converts values to other types if specified. + * @param message RangeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.container.v1.RangeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RangeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RangeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an Operation. */ interface IOperation { @@ -13056,6 +13289,9 @@ export namespace google { /** AutoprovisioningNodePoolDefaults imageType */ imageType?: (string|null); + + /** AutoprovisioningNodePoolDefaults insecureKubeletReadonlyPortEnabled */ + insecureKubeletReadonlyPortEnabled?: (boolean|null); } /** Represents an AutoprovisioningNodePoolDefaults. */ @@ -13097,6 +13333,12 @@ export namespace google { /** AutoprovisioningNodePoolDefaults imageType. */ public imageType: string; + /** AutoprovisioningNodePoolDefaults insecureKubeletReadonlyPortEnabled. */ + public insecureKubeletReadonlyPortEnabled?: (boolean|null); + + /** AutoprovisioningNodePoolDefaults _insecureKubeletReadonlyPortEnabled. */ + public _insecureKubeletReadonlyPortEnabled?: "insecureKubeletReadonlyPortEnabled"; + /** * Creates a new AutoprovisioningNodePoolDefaults instance using the specified properties. * @param [properties] Properties to set @@ -19641,6 +19883,9 @@ export namespace google { /** MonitoringConfig managedPrometheusConfig */ managedPrometheusConfig?: (google.container.v1.IManagedPrometheusConfig|null); + + /** MonitoringConfig advancedDatapathObservabilityConfig */ + advancedDatapathObservabilityConfig?: (google.container.v1.IAdvancedDatapathObservabilityConfig|null); } /** Represents a MonitoringConfig. */ @@ -19658,6 +19903,9 @@ export namespace google { /** MonitoringConfig managedPrometheusConfig. */ public managedPrometheusConfig?: (google.container.v1.IManagedPrometheusConfig|null); + /** MonitoringConfig advancedDatapathObservabilityConfig. */ + public advancedDatapathObservabilityConfig?: (google.container.v1.IAdvancedDatapathObservabilityConfig|null); + /** * Creates a new MonitoringConfig instance using the specified properties. * @param [properties] Properties to set @@ -19736,6 +19984,120 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an AdvancedDatapathObservabilityConfig. */ + interface IAdvancedDatapathObservabilityConfig { + + /** AdvancedDatapathObservabilityConfig enableMetrics */ + enableMetrics?: (boolean|null); + + /** AdvancedDatapathObservabilityConfig relayMode */ + relayMode?: (google.container.v1.AdvancedDatapathObservabilityConfig.RelayMode|keyof typeof google.container.v1.AdvancedDatapathObservabilityConfig.RelayMode|null); + } + + /** Represents an AdvancedDatapathObservabilityConfig. */ + class AdvancedDatapathObservabilityConfig implements IAdvancedDatapathObservabilityConfig { + + /** + * Constructs a new AdvancedDatapathObservabilityConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.container.v1.IAdvancedDatapathObservabilityConfig); + + /** AdvancedDatapathObservabilityConfig enableMetrics. */ + public enableMetrics: boolean; + + /** AdvancedDatapathObservabilityConfig relayMode. */ + public relayMode: (google.container.v1.AdvancedDatapathObservabilityConfig.RelayMode|keyof typeof google.container.v1.AdvancedDatapathObservabilityConfig.RelayMode); + + /** + * Creates a new AdvancedDatapathObservabilityConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AdvancedDatapathObservabilityConfig instance + */ + public static create(properties?: google.container.v1.IAdvancedDatapathObservabilityConfig): google.container.v1.AdvancedDatapathObservabilityConfig; + + /** + * Encodes the specified AdvancedDatapathObservabilityConfig message. Does not implicitly {@link google.container.v1.AdvancedDatapathObservabilityConfig.verify|verify} messages. + * @param message AdvancedDatapathObservabilityConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.container.v1.IAdvancedDatapathObservabilityConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AdvancedDatapathObservabilityConfig message, length delimited. Does not implicitly {@link google.container.v1.AdvancedDatapathObservabilityConfig.verify|verify} messages. + * @param message AdvancedDatapathObservabilityConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.container.v1.IAdvancedDatapathObservabilityConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AdvancedDatapathObservabilityConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AdvancedDatapathObservabilityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.container.v1.AdvancedDatapathObservabilityConfig; + + /** + * Decodes an AdvancedDatapathObservabilityConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AdvancedDatapathObservabilityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.container.v1.AdvancedDatapathObservabilityConfig; + + /** + * Verifies an AdvancedDatapathObservabilityConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AdvancedDatapathObservabilityConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AdvancedDatapathObservabilityConfig + */ + public static fromObject(object: { [k: string]: any }): google.container.v1.AdvancedDatapathObservabilityConfig; + + /** + * Creates a plain object from an AdvancedDatapathObservabilityConfig message. Also converts values to other types if specified. + * @param message AdvancedDatapathObservabilityConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.container.v1.AdvancedDatapathObservabilityConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AdvancedDatapathObservabilityConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AdvancedDatapathObservabilityConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AdvancedDatapathObservabilityConfig { + + /** RelayMode enum. */ + enum RelayMode { + RELAY_MODE_UNSPECIFIED = 0, + DISABLED = 1, + INTERNAL_VPC_LB = 3, + EXTERNAL_LB = 4 + } + } + /** Properties of a NodePoolLoggingConfig. */ interface INodePoolLoggingConfig { diff --git a/packages/google-container/protos/protos.js b/packages/google-container/protos/protos.js index 6b7a659810d..69f3cadd9fe 100644 --- a/packages/google-container/protos/protos.js +++ b/packages/google-container/protos/protos.js @@ -1769,6 +1769,7 @@ * @property {google.protobuf.IBoolValue|null} [cpuCfsQuota] NodeKubeletConfig cpuCfsQuota * @property {string|null} [cpuCfsQuotaPeriod] NodeKubeletConfig cpuCfsQuotaPeriod * @property {number|Long|null} [podPidsLimit] NodeKubeletConfig podPidsLimit + * @property {boolean|null} [insecureKubeletReadonlyPortEnabled] NodeKubeletConfig insecureKubeletReadonlyPortEnabled */ /** @@ -1818,6 +1819,28 @@ */ NodeKubeletConfig.prototype.podPidsLimit = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * NodeKubeletConfig insecureKubeletReadonlyPortEnabled. + * @member {boolean|null|undefined} insecureKubeletReadonlyPortEnabled + * @memberof google.container.v1.NodeKubeletConfig + * @instance + */ + NodeKubeletConfig.prototype.insecureKubeletReadonlyPortEnabled = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NodeKubeletConfig _insecureKubeletReadonlyPortEnabled. + * @member {"insecureKubeletReadonlyPortEnabled"|undefined} _insecureKubeletReadonlyPortEnabled + * @memberof google.container.v1.NodeKubeletConfig + * @instance + */ + Object.defineProperty(NodeKubeletConfig.prototype, "_insecureKubeletReadonlyPortEnabled", { + get: $util.oneOfGetter($oneOfFields = ["insecureKubeletReadonlyPortEnabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new NodeKubeletConfig instance using the specified properties. * @function create @@ -1850,6 +1873,8 @@ writer.uint32(/* id 3, wireType 2 =*/26).string(message.cpuCfsQuotaPeriod); if (message.podPidsLimit != null && Object.hasOwnProperty.call(message, "podPidsLimit")) writer.uint32(/* id 4, wireType 0 =*/32).int64(message.podPidsLimit); + if (message.insecureKubeletReadonlyPortEnabled != null && Object.hasOwnProperty.call(message, "insecureKubeletReadonlyPortEnabled")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.insecureKubeletReadonlyPortEnabled); return writer; }; @@ -1900,6 +1925,10 @@ message.podPidsLimit = reader.int64(); break; } + case 7: { + message.insecureKubeletReadonlyPortEnabled = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -1935,6 +1964,7 @@ NodeKubeletConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.cpuManagerPolicy != null && message.hasOwnProperty("cpuManagerPolicy")) if (!$util.isString(message.cpuManagerPolicy)) return "cpuManagerPolicy: string expected"; @@ -1949,6 +1979,11 @@ if (message.podPidsLimit != null && message.hasOwnProperty("podPidsLimit")) if (!$util.isInteger(message.podPidsLimit) && !(message.podPidsLimit && $util.isInteger(message.podPidsLimit.low) && $util.isInteger(message.podPidsLimit.high))) return "podPidsLimit: integer|Long expected"; + if (message.insecureKubeletReadonlyPortEnabled != null && message.hasOwnProperty("insecureKubeletReadonlyPortEnabled")) { + properties._insecureKubeletReadonlyPortEnabled = 1; + if (typeof message.insecureKubeletReadonlyPortEnabled !== "boolean") + return "insecureKubeletReadonlyPortEnabled: boolean expected"; + } return null; }; @@ -1982,6 +2017,8 @@ message.podPidsLimit = object.podPidsLimit; else if (typeof object.podPidsLimit === "object") message.podPidsLimit = new $util.LongBits(object.podPidsLimit.low >>> 0, object.podPidsLimit.high >>> 0).toNumber(); + if (object.insecureKubeletReadonlyPortEnabled != null) + message.insecureKubeletReadonlyPortEnabled = Boolean(object.insecureKubeletReadonlyPortEnabled); return message; }; @@ -2019,6 +2056,11 @@ object.podPidsLimit = options.longs === String ? String(message.podPidsLimit) : message.podPidsLimit; else object.podPidsLimit = options.longs === String ? $util.Long.prototype.toString.call(message.podPidsLimit) : options.longs === Number ? new $util.LongBits(message.podPidsLimit.low >>> 0, message.podPidsLimit.high >>> 0).toNumber() : message.podPidsLimit; + if (message.insecureKubeletReadonlyPortEnabled != null && message.hasOwnProperty("insecureKubeletReadonlyPortEnabled")) { + object.insecureKubeletReadonlyPortEnabled = message.insecureKubeletReadonlyPortEnabled; + if (options.oneofs) + object._insecureKubeletReadonlyPortEnabled = "insecureKubeletReadonlyPortEnabled"; + } return object; }; @@ -3538,6 +3580,7 @@ * @property {boolean|null} [enablePrivateNodes] NodeNetworkConfig enablePrivateNodes * @property {google.container.v1.NodeNetworkConfig.INetworkPerformanceConfig|null} [networkPerformanceConfig] NodeNetworkConfig networkPerformanceConfig * @property {google.container.v1.IPodCIDROverprovisionConfig|null} [podCidrOverprovisionConfig] NodeNetworkConfig podCidrOverprovisionConfig + * @property {number|null} [podIpv4RangeUtilization] NodeNetworkConfig podIpv4RangeUtilization */ /** @@ -3603,6 +3646,14 @@ */ NodeNetworkConfig.prototype.podCidrOverprovisionConfig = null; + /** + * NodeNetworkConfig podIpv4RangeUtilization. + * @member {number} podIpv4RangeUtilization + * @memberof google.container.v1.NodeNetworkConfig + * @instance + */ + NodeNetworkConfig.prototype.podIpv4RangeUtilization = 0; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -3664,6 +3715,8 @@ $root.google.container.v1.NodeNetworkConfig.NetworkPerformanceConfig.encode(message.networkPerformanceConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); if (message.podCidrOverprovisionConfig != null && Object.hasOwnProperty.call(message, "podCidrOverprovisionConfig")) $root.google.container.v1.PodCIDROverprovisionConfig.encode(message.podCidrOverprovisionConfig, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.podIpv4RangeUtilization != null && Object.hasOwnProperty.call(message, "podIpv4RangeUtilization")) + writer.uint32(/* id 16, wireType 1 =*/129).double(message.podIpv4RangeUtilization); return writer; }; @@ -3722,6 +3775,10 @@ message.podCidrOverprovisionConfig = $root.google.container.v1.PodCIDROverprovisionConfig.decode(reader, reader.uint32()); break; } + case 16: { + message.podIpv4RangeUtilization = reader.double(); + break; + } default: reader.skipType(tag & 7); break; @@ -3785,6 +3842,9 @@ if (error) return "podCidrOverprovisionConfig." + error; } + if (message.podIpv4RangeUtilization != null && message.hasOwnProperty("podIpv4RangeUtilization")) + if (typeof message.podIpv4RangeUtilization !== "number") + return "podIpv4RangeUtilization: number expected"; return null; }; @@ -3818,6 +3878,8 @@ throw TypeError(".google.container.v1.NodeNetworkConfig.podCidrOverprovisionConfig: object expected"); message.podCidrOverprovisionConfig = $root.google.container.v1.PodCIDROverprovisionConfig.fromObject(object.podCidrOverprovisionConfig); } + if (object.podIpv4RangeUtilization != null) + message.podIpv4RangeUtilization = Number(object.podIpv4RangeUtilization); return message; }; @@ -3839,6 +3901,7 @@ object.podRange = ""; object.podIpv4CidrBlock = ""; object.podCidrOverprovisionConfig = null; + object.podIpv4RangeUtilization = 0; } if (message.createPodRange != null && message.hasOwnProperty("createPodRange")) object.createPodRange = message.createPodRange; @@ -3858,6 +3921,8 @@ } if (message.podCidrOverprovisionConfig != null && message.hasOwnProperty("podCidrOverprovisionConfig")) object.podCidrOverprovisionConfig = $root.google.container.v1.PodCIDROverprovisionConfig.toObject(message.podCidrOverprovisionConfig, options); + if (message.podIpv4RangeUtilization != null && message.hasOwnProperty("podIpv4RangeUtilization")) + object.podIpv4RangeUtilization = options.json && !isFinite(message.podIpv4RangeUtilization) ? String(message.podIpv4RangeUtilization) : message.podIpv4RangeUtilization; return object; }; @@ -7414,6 +7479,7 @@ * @property {google.container.v1.IGcePersistentDiskCsiDriverConfig|null} [gcePersistentDiskCsiDriverConfig] AddonsConfig gcePersistentDiskCsiDriverConfig * @property {google.container.v1.IGcpFilestoreCsiDriverConfig|null} [gcpFilestoreCsiDriverConfig] AddonsConfig gcpFilestoreCsiDriverConfig * @property {google.container.v1.IGkeBackupAgentConfig|null} [gkeBackupAgentConfig] AddonsConfig gkeBackupAgentConfig + * @property {google.container.v1.IGcsFuseCsiDriverConfig|null} [gcsFuseCsiDriverConfig] AddonsConfig gcsFuseCsiDriverConfig */ /** @@ -7511,6 +7577,14 @@ */ AddonsConfig.prototype.gkeBackupAgentConfig = null; + /** + * AddonsConfig gcsFuseCsiDriverConfig. + * @member {google.container.v1.IGcsFuseCsiDriverConfig|null|undefined} gcsFuseCsiDriverConfig + * @memberof google.container.v1.AddonsConfig + * @instance + */ + AddonsConfig.prototype.gcsFuseCsiDriverConfig = null; + /** * Creates a new AddonsConfig instance using the specified properties. * @function create @@ -7555,6 +7629,8 @@ $root.google.container.v1.GcpFilestoreCsiDriverConfig.encode(message.gcpFilestoreCsiDriverConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); if (message.gkeBackupAgentConfig != null && Object.hasOwnProperty.call(message, "gkeBackupAgentConfig")) $root.google.container.v1.GkeBackupAgentConfig.encode(message.gkeBackupAgentConfig, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.gcsFuseCsiDriverConfig != null && Object.hasOwnProperty.call(message, "gcsFuseCsiDriverConfig")) + $root.google.container.v1.GcsFuseCsiDriverConfig.encode(message.gcsFuseCsiDriverConfig, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); return writer; }; @@ -7629,6 +7705,10 @@ message.gkeBackupAgentConfig = $root.google.container.v1.GkeBackupAgentConfig.decode(reader, reader.uint32()); break; } + case 17: { + message.gcsFuseCsiDriverConfig = $root.google.container.v1.GcsFuseCsiDriverConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -7714,6 +7794,11 @@ if (error) return "gkeBackupAgentConfig." + error; } + if (message.gcsFuseCsiDriverConfig != null && message.hasOwnProperty("gcsFuseCsiDriverConfig")) { + var error = $root.google.container.v1.GcsFuseCsiDriverConfig.verify(message.gcsFuseCsiDriverConfig); + if (error) + return "gcsFuseCsiDriverConfig." + error; + } return null; }; @@ -7779,6 +7864,11 @@ throw TypeError(".google.container.v1.AddonsConfig.gkeBackupAgentConfig: object expected"); message.gkeBackupAgentConfig = $root.google.container.v1.GkeBackupAgentConfig.fromObject(object.gkeBackupAgentConfig); } + if (object.gcsFuseCsiDriverConfig != null) { + if (typeof object.gcsFuseCsiDriverConfig !== "object") + throw TypeError(".google.container.v1.AddonsConfig.gcsFuseCsiDriverConfig: object expected"); + message.gcsFuseCsiDriverConfig = $root.google.container.v1.GcsFuseCsiDriverConfig.fromObject(object.gcsFuseCsiDriverConfig); + } return message; }; @@ -7806,6 +7896,7 @@ object.gcePersistentDiskCsiDriverConfig = null; object.gcpFilestoreCsiDriverConfig = null; object.gkeBackupAgentConfig = null; + object.gcsFuseCsiDriverConfig = null; } if (message.httpLoadBalancing != null && message.hasOwnProperty("httpLoadBalancing")) object.httpLoadBalancing = $root.google.container.v1.HttpLoadBalancing.toObject(message.httpLoadBalancing, options); @@ -7827,6 +7918,8 @@ object.gcpFilestoreCsiDriverConfig = $root.google.container.v1.GcpFilestoreCsiDriverConfig.toObject(message.gcpFilestoreCsiDriverConfig, options); if (message.gkeBackupAgentConfig != null && message.hasOwnProperty("gkeBackupAgentConfig")) object.gkeBackupAgentConfig = $root.google.container.v1.GkeBackupAgentConfig.toObject(message.gkeBackupAgentConfig, options); + if (message.gcsFuseCsiDriverConfig != null && message.hasOwnProperty("gcsFuseCsiDriverConfig")) + object.gcsFuseCsiDriverConfig = $root.google.container.v1.GcsFuseCsiDriverConfig.toObject(message.gcsFuseCsiDriverConfig, options); return object; }; @@ -10550,6 +10643,209 @@ return GcpFilestoreCsiDriverConfig; })(); + v1.GcsFuseCsiDriverConfig = (function() { + + /** + * Properties of a GcsFuseCsiDriverConfig. + * @memberof google.container.v1 + * @interface IGcsFuseCsiDriverConfig + * @property {boolean|null} [enabled] GcsFuseCsiDriverConfig enabled + */ + + /** + * Constructs a new GcsFuseCsiDriverConfig. + * @memberof google.container.v1 + * @classdesc Represents a GcsFuseCsiDriverConfig. + * @implements IGcsFuseCsiDriverConfig + * @constructor + * @param {google.container.v1.IGcsFuseCsiDriverConfig=} [properties] Properties to set + */ + function GcsFuseCsiDriverConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsFuseCsiDriverConfig enabled. + * @member {boolean} enabled + * @memberof google.container.v1.GcsFuseCsiDriverConfig + * @instance + */ + GcsFuseCsiDriverConfig.prototype.enabled = false; + + /** + * Creates a new GcsFuseCsiDriverConfig instance using the specified properties. + * @function create + * @memberof google.container.v1.GcsFuseCsiDriverConfig + * @static + * @param {google.container.v1.IGcsFuseCsiDriverConfig=} [properties] Properties to set + * @returns {google.container.v1.GcsFuseCsiDriverConfig} GcsFuseCsiDriverConfig instance + */ + GcsFuseCsiDriverConfig.create = function create(properties) { + return new GcsFuseCsiDriverConfig(properties); + }; + + /** + * Encodes the specified GcsFuseCsiDriverConfig message. Does not implicitly {@link google.container.v1.GcsFuseCsiDriverConfig.verify|verify} messages. + * @function encode + * @memberof google.container.v1.GcsFuseCsiDriverConfig + * @static + * @param {google.container.v1.IGcsFuseCsiDriverConfig} message GcsFuseCsiDriverConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsFuseCsiDriverConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + return writer; + }; + + /** + * Encodes the specified GcsFuseCsiDriverConfig message, length delimited. Does not implicitly {@link google.container.v1.GcsFuseCsiDriverConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.container.v1.GcsFuseCsiDriverConfig + * @static + * @param {google.container.v1.IGcsFuseCsiDriverConfig} message GcsFuseCsiDriverConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsFuseCsiDriverConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsFuseCsiDriverConfig message from the specified reader or buffer. + * @function decode + * @memberof google.container.v1.GcsFuseCsiDriverConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.container.v1.GcsFuseCsiDriverConfig} GcsFuseCsiDriverConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsFuseCsiDriverConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.container.v1.GcsFuseCsiDriverConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsFuseCsiDriverConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.container.v1.GcsFuseCsiDriverConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.container.v1.GcsFuseCsiDriverConfig} GcsFuseCsiDriverConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsFuseCsiDriverConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsFuseCsiDriverConfig message. + * @function verify + * @memberof google.container.v1.GcsFuseCsiDriverConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsFuseCsiDriverConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + return null; + }; + + /** + * Creates a GcsFuseCsiDriverConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.container.v1.GcsFuseCsiDriverConfig + * @static + * @param {Object.} object Plain object + * @returns {google.container.v1.GcsFuseCsiDriverConfig} GcsFuseCsiDriverConfig + */ + GcsFuseCsiDriverConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.container.v1.GcsFuseCsiDriverConfig) + return object; + var message = new $root.google.container.v1.GcsFuseCsiDriverConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + return message; + }; + + /** + * Creates a plain object from a GcsFuseCsiDriverConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.container.v1.GcsFuseCsiDriverConfig + * @static + * @param {google.container.v1.GcsFuseCsiDriverConfig} message GcsFuseCsiDriverConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsFuseCsiDriverConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enabled = false; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + return object; + }; + + /** + * Converts this GcsFuseCsiDriverConfig to JSON. + * @function toJSON + * @memberof google.container.v1.GcsFuseCsiDriverConfig + * @instance + * @returns {Object.} JSON object + */ + GcsFuseCsiDriverConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsFuseCsiDriverConfig + * @function getTypeUrl + * @memberof google.container.v1.GcsFuseCsiDriverConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsFuseCsiDriverConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.container.v1.GcsFuseCsiDriverConfig"; + }; + + return GcsFuseCsiDriverConfig; + })(); + v1.GkeBackupAgentConfig = (function() { /** @@ -12228,6 +12524,7 @@ * @property {string|null} [subnetIpv6CidrBlock] IPAllocationPolicy subnetIpv6CidrBlock * @property {string|null} [servicesIpv6CidrBlock] IPAllocationPolicy servicesIpv6CidrBlock * @property {google.container.v1.IAdditionalPodRangesConfig|null} [additionalPodRangesConfig] IPAllocationPolicy additionalPodRangesConfig + * @property {number|null} [defaultPodIpv4RangeUtilization] IPAllocationPolicy defaultPodIpv4RangeUtilization */ /** @@ -12397,6 +12694,14 @@ */ IPAllocationPolicy.prototype.additionalPodRangesConfig = null; + /** + * IPAllocationPolicy defaultPodIpv4RangeUtilization. + * @member {number} defaultPodIpv4RangeUtilization + * @memberof google.container.v1.IPAllocationPolicy + * @instance + */ + IPAllocationPolicy.prototype.defaultPodIpv4RangeUtilization = 0; + /** * Creates a new IPAllocationPolicy instance using the specified properties. * @function create @@ -12459,6 +12764,8 @@ writer.uint32(/* id 23, wireType 2 =*/186).string(message.servicesIpv6CidrBlock); if (message.additionalPodRangesConfig != null && Object.hasOwnProperty.call(message, "additionalPodRangesConfig")) $root.google.container.v1.AdditionalPodRangesConfig.encode(message.additionalPodRangesConfig, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.defaultPodIpv4RangeUtilization != null && Object.hasOwnProperty.call(message, "defaultPodIpv4RangeUtilization")) + writer.uint32(/* id 25, wireType 1 =*/201).double(message.defaultPodIpv4RangeUtilization); return writer; }; @@ -12569,6 +12876,10 @@ message.additionalPodRangesConfig = $root.google.container.v1.AdditionalPodRangesConfig.decode(reader, reader.uint32()); break; } + case 25: { + message.defaultPodIpv4RangeUtilization = reader.double(); + break; + } default: reader.skipType(tag & 7); break; @@ -12677,6 +12988,9 @@ if (error) return "additionalPodRangesConfig." + error; } + if (message.defaultPodIpv4RangeUtilization != null && message.hasOwnProperty("defaultPodIpv4RangeUtilization")) + if (typeof message.defaultPodIpv4RangeUtilization !== "number") + return "defaultPodIpv4RangeUtilization: number expected"; return null; }; @@ -12772,6 +13086,8 @@ throw TypeError(".google.container.v1.IPAllocationPolicy.additionalPodRangesConfig: object expected"); message.additionalPodRangesConfig = $root.google.container.v1.AdditionalPodRangesConfig.fromObject(object.additionalPodRangesConfig); } + if (object.defaultPodIpv4RangeUtilization != null) + message.defaultPodIpv4RangeUtilization = Number(object.defaultPodIpv4RangeUtilization); return message; }; @@ -12808,6 +13124,7 @@ object.subnetIpv6CidrBlock = ""; object.servicesIpv6CidrBlock = ""; object.additionalPodRangesConfig = null; + object.defaultPodIpv4RangeUtilization = 0; } if (message.useIpAliases != null && message.hasOwnProperty("useIpAliases")) object.useIpAliases = message.useIpAliases; @@ -12847,6 +13164,8 @@ object.servicesIpv6CidrBlock = message.servicesIpv6CidrBlock; if (message.additionalPodRangesConfig != null && message.hasOwnProperty("additionalPodRangesConfig")) object.additionalPodRangesConfig = $root.google.container.v1.AdditionalPodRangesConfig.toObject(message.additionalPodRangesConfig, options); + if (message.defaultPodIpv4RangeUtilization != null && message.hasOwnProperty("defaultPodIpv4RangeUtilization")) + object.defaultPodIpv4RangeUtilization = options.json && !isFinite(message.defaultPodIpv4RangeUtilization) ? String(message.defaultPodIpv4RangeUtilization) : message.defaultPodIpv4RangeUtilization; return object; }; @@ -17777,6 +18096,7 @@ * @memberof google.container.v1 * @interface IAdditionalPodRangesConfig * @property {Array.|null} [podRangeNames] AdditionalPodRangesConfig podRangeNames + * @property {Array.|null} [podRangeInfo] AdditionalPodRangesConfig podRangeInfo */ /** @@ -17789,6 +18109,7 @@ */ function AdditionalPodRangesConfig(properties) { this.podRangeNames = []; + this.podRangeInfo = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17803,6 +18124,14 @@ */ AdditionalPodRangesConfig.prototype.podRangeNames = $util.emptyArray; + /** + * AdditionalPodRangesConfig podRangeInfo. + * @member {Array.} podRangeInfo + * @memberof google.container.v1.AdditionalPodRangesConfig + * @instance + */ + AdditionalPodRangesConfig.prototype.podRangeInfo = $util.emptyArray; + /** * Creates a new AdditionalPodRangesConfig instance using the specified properties. * @function create @@ -17830,6 +18159,9 @@ if (message.podRangeNames != null && message.podRangeNames.length) for (var i = 0; i < message.podRangeNames.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.podRangeNames[i]); + if (message.podRangeInfo != null && message.podRangeInfo.length) + for (var i = 0; i < message.podRangeInfo.length; ++i) + $root.google.container.v1.RangeInfo.encode(message.podRangeInfo[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -17870,6 +18202,12 @@ message.podRangeNames.push(reader.string()); break; } + case 2: { + if (!(message.podRangeInfo && message.podRangeInfo.length)) + message.podRangeInfo = []; + message.podRangeInfo.push($root.google.container.v1.RangeInfo.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -17912,6 +18250,15 @@ if (!$util.isString(message.podRangeNames[i])) return "podRangeNames: string[] expected"; } + if (message.podRangeInfo != null && message.hasOwnProperty("podRangeInfo")) { + if (!Array.isArray(message.podRangeInfo)) + return "podRangeInfo: array expected"; + for (var i = 0; i < message.podRangeInfo.length; ++i) { + var error = $root.google.container.v1.RangeInfo.verify(message.podRangeInfo[i]); + if (error) + return "podRangeInfo." + error; + } + } return null; }; @@ -17934,6 +18281,16 @@ for (var i = 0; i < object.podRangeNames.length; ++i) message.podRangeNames[i] = String(object.podRangeNames[i]); } + if (object.podRangeInfo) { + if (!Array.isArray(object.podRangeInfo)) + throw TypeError(".google.container.v1.AdditionalPodRangesConfig.podRangeInfo: array expected"); + message.podRangeInfo = []; + for (var i = 0; i < object.podRangeInfo.length; ++i) { + if (typeof object.podRangeInfo[i] !== "object") + throw TypeError(".google.container.v1.AdditionalPodRangesConfig.podRangeInfo: object expected"); + message.podRangeInfo[i] = $root.google.container.v1.RangeInfo.fromObject(object.podRangeInfo[i]); + } + } return message; }; @@ -17950,13 +18307,20 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.podRangeNames = []; + object.podRangeInfo = []; + } if (message.podRangeNames && message.podRangeNames.length) { object.podRangeNames = []; for (var j = 0; j < message.podRangeNames.length; ++j) object.podRangeNames[j] = message.podRangeNames[j]; } + if (message.podRangeInfo && message.podRangeInfo.length) { + object.podRangeInfo = []; + for (var j = 0; j < message.podRangeInfo.length; ++j) + object.podRangeInfo[j] = $root.google.container.v1.RangeInfo.toObject(message.podRangeInfo[j], options); + } return object; }; @@ -17989,6 +18353,233 @@ return AdditionalPodRangesConfig; })(); + v1.RangeInfo = (function() { + + /** + * Properties of a RangeInfo. + * @memberof google.container.v1 + * @interface IRangeInfo + * @property {string|null} [rangeName] RangeInfo rangeName + * @property {number|null} [utilization] RangeInfo utilization + */ + + /** + * Constructs a new RangeInfo. + * @memberof google.container.v1 + * @classdesc Represents a RangeInfo. + * @implements IRangeInfo + * @constructor + * @param {google.container.v1.IRangeInfo=} [properties] Properties to set + */ + function RangeInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RangeInfo rangeName. + * @member {string} rangeName + * @memberof google.container.v1.RangeInfo + * @instance + */ + RangeInfo.prototype.rangeName = ""; + + /** + * RangeInfo utilization. + * @member {number} utilization + * @memberof google.container.v1.RangeInfo + * @instance + */ + RangeInfo.prototype.utilization = 0; + + /** + * Creates a new RangeInfo instance using the specified properties. + * @function create + * @memberof google.container.v1.RangeInfo + * @static + * @param {google.container.v1.IRangeInfo=} [properties] Properties to set + * @returns {google.container.v1.RangeInfo} RangeInfo instance + */ + RangeInfo.create = function create(properties) { + return new RangeInfo(properties); + }; + + /** + * Encodes the specified RangeInfo message. Does not implicitly {@link google.container.v1.RangeInfo.verify|verify} messages. + * @function encode + * @memberof google.container.v1.RangeInfo + * @static + * @param {google.container.v1.IRangeInfo} message RangeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RangeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rangeName != null && Object.hasOwnProperty.call(message, "rangeName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.rangeName); + if (message.utilization != null && Object.hasOwnProperty.call(message, "utilization")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.utilization); + return writer; + }; + + /** + * Encodes the specified RangeInfo message, length delimited. Does not implicitly {@link google.container.v1.RangeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.container.v1.RangeInfo + * @static + * @param {google.container.v1.IRangeInfo} message RangeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RangeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RangeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.container.v1.RangeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.container.v1.RangeInfo} RangeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RangeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.container.v1.RangeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rangeName = reader.string(); + break; + } + case 2: { + message.utilization = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RangeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.container.v1.RangeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.container.v1.RangeInfo} RangeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RangeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RangeInfo message. + * @function verify + * @memberof google.container.v1.RangeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RangeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rangeName != null && message.hasOwnProperty("rangeName")) + if (!$util.isString(message.rangeName)) + return "rangeName: string expected"; + if (message.utilization != null && message.hasOwnProperty("utilization")) + if (typeof message.utilization !== "number") + return "utilization: number expected"; + return null; + }; + + /** + * Creates a RangeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.container.v1.RangeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.container.v1.RangeInfo} RangeInfo + */ + RangeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.container.v1.RangeInfo) + return object; + var message = new $root.google.container.v1.RangeInfo(); + if (object.rangeName != null) + message.rangeName = String(object.rangeName); + if (object.utilization != null) + message.utilization = Number(object.utilization); + return message; + }; + + /** + * Creates a plain object from a RangeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.container.v1.RangeInfo + * @static + * @param {google.container.v1.RangeInfo} message RangeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RangeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rangeName = ""; + object.utilization = 0; + } + if (message.rangeName != null && message.hasOwnProperty("rangeName")) + object.rangeName = message.rangeName; + if (message.utilization != null && message.hasOwnProperty("utilization")) + object.utilization = options.json && !isFinite(message.utilization) ? String(message.utilization) : message.utilization; + return object; + }; + + /** + * Converts this RangeInfo to JSON. + * @function toJSON + * @memberof google.container.v1.RangeInfo + * @instance + * @returns {Object.} JSON object + */ + RangeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RangeInfo + * @function getTypeUrl + * @memberof google.container.v1.RangeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RangeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.container.v1.RangeInfo"; + }; + + return RangeInfo; + })(); + v1.Operation = (function() { /** @@ -33856,6 +34447,7 @@ * @property {google.container.v1.IShieldedInstanceConfig|null} [shieldedInstanceConfig] AutoprovisioningNodePoolDefaults shieldedInstanceConfig * @property {string|null} [bootDiskKmsKey] AutoprovisioningNodePoolDefaults bootDiskKmsKey * @property {string|null} [imageType] AutoprovisioningNodePoolDefaults imageType + * @property {boolean|null} [insecureKubeletReadonlyPortEnabled] AutoprovisioningNodePoolDefaults insecureKubeletReadonlyPortEnabled */ /** @@ -33954,6 +34546,28 @@ */ AutoprovisioningNodePoolDefaults.prototype.imageType = ""; + /** + * AutoprovisioningNodePoolDefaults insecureKubeletReadonlyPortEnabled. + * @member {boolean|null|undefined} insecureKubeletReadonlyPortEnabled + * @memberof google.container.v1.AutoprovisioningNodePoolDefaults + * @instance + */ + AutoprovisioningNodePoolDefaults.prototype.insecureKubeletReadonlyPortEnabled = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AutoprovisioningNodePoolDefaults _insecureKubeletReadonlyPortEnabled. + * @member {"insecureKubeletReadonlyPortEnabled"|undefined} _insecureKubeletReadonlyPortEnabled + * @memberof google.container.v1.AutoprovisioningNodePoolDefaults + * @instance + */ + Object.defineProperty(AutoprovisioningNodePoolDefaults.prototype, "_insecureKubeletReadonlyPortEnabled", { + get: $util.oneOfGetter($oneOfFields = ["insecureKubeletReadonlyPortEnabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new AutoprovisioningNodePoolDefaults instance using the specified properties. * @function create @@ -33999,6 +34613,8 @@ writer.uint32(/* id 9, wireType 2 =*/74).string(message.bootDiskKmsKey); if (message.imageType != null && Object.hasOwnProperty.call(message, "imageType")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.imageType); + if (message.insecureKubeletReadonlyPortEnabled != null && Object.hasOwnProperty.call(message, "insecureKubeletReadonlyPortEnabled")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.insecureKubeletReadonlyPortEnabled); return writer; }; @@ -34075,6 +34691,10 @@ message.imageType = reader.string(); break; } + case 13: { + message.insecureKubeletReadonlyPortEnabled = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -34110,6 +34730,7 @@ AutoprovisioningNodePoolDefaults.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.oauthScopes != null && message.hasOwnProperty("oauthScopes")) { if (!Array.isArray(message.oauthScopes)) return "oauthScopes: array expected"; @@ -34150,6 +34771,11 @@ if (message.imageType != null && message.hasOwnProperty("imageType")) if (!$util.isString(message.imageType)) return "imageType: string expected"; + if (message.insecureKubeletReadonlyPortEnabled != null && message.hasOwnProperty("insecureKubeletReadonlyPortEnabled")) { + properties._insecureKubeletReadonlyPortEnabled = 1; + if (typeof message.insecureKubeletReadonlyPortEnabled !== "boolean") + return "insecureKubeletReadonlyPortEnabled: boolean expected"; + } return null; }; @@ -34199,6 +34825,8 @@ message.bootDiskKmsKey = String(object.bootDiskKmsKey); if (object.imageType != null) message.imageType = String(object.imageType); + if (object.insecureKubeletReadonlyPortEnabled != null) + message.insecureKubeletReadonlyPortEnabled = Boolean(object.insecureKubeletReadonlyPortEnabled); return message; }; @@ -34251,6 +34879,11 @@ object.bootDiskKmsKey = message.bootDiskKmsKey; if (message.imageType != null && message.hasOwnProperty("imageType")) object.imageType = message.imageType; + if (message.insecureKubeletReadonlyPortEnabled != null && message.hasOwnProperty("insecureKubeletReadonlyPortEnabled")) { + object.insecureKubeletReadonlyPortEnabled = message.insecureKubeletReadonlyPortEnabled; + if (options.oneofs) + object._insecureKubeletReadonlyPortEnabled = "insecureKubeletReadonlyPortEnabled"; + } return object; }; @@ -50038,6 +50671,7 @@ * @interface IMonitoringConfig * @property {google.container.v1.IMonitoringComponentConfig|null} [componentConfig] MonitoringConfig componentConfig * @property {google.container.v1.IManagedPrometheusConfig|null} [managedPrometheusConfig] MonitoringConfig managedPrometheusConfig + * @property {google.container.v1.IAdvancedDatapathObservabilityConfig|null} [advancedDatapathObservabilityConfig] MonitoringConfig advancedDatapathObservabilityConfig */ /** @@ -50071,6 +50705,14 @@ */ MonitoringConfig.prototype.managedPrometheusConfig = null; + /** + * MonitoringConfig advancedDatapathObservabilityConfig. + * @member {google.container.v1.IAdvancedDatapathObservabilityConfig|null|undefined} advancedDatapathObservabilityConfig + * @memberof google.container.v1.MonitoringConfig + * @instance + */ + MonitoringConfig.prototype.advancedDatapathObservabilityConfig = null; + /** * Creates a new MonitoringConfig instance using the specified properties. * @function create @@ -50099,6 +50741,8 @@ $root.google.container.v1.MonitoringComponentConfig.encode(message.componentConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.managedPrometheusConfig != null && Object.hasOwnProperty.call(message, "managedPrometheusConfig")) $root.google.container.v1.ManagedPrometheusConfig.encode(message.managedPrometheusConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.advancedDatapathObservabilityConfig != null && Object.hasOwnProperty.call(message, "advancedDatapathObservabilityConfig")) + $root.google.container.v1.AdvancedDatapathObservabilityConfig.encode(message.advancedDatapathObservabilityConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -50141,6 +50785,10 @@ message.managedPrometheusConfig = $root.google.container.v1.ManagedPrometheusConfig.decode(reader, reader.uint32()); break; } + case 3: { + message.advancedDatapathObservabilityConfig = $root.google.container.v1.AdvancedDatapathObservabilityConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -50186,6 +50834,11 @@ if (error) return "managedPrometheusConfig." + error; } + if (message.advancedDatapathObservabilityConfig != null && message.hasOwnProperty("advancedDatapathObservabilityConfig")) { + var error = $root.google.container.v1.AdvancedDatapathObservabilityConfig.verify(message.advancedDatapathObservabilityConfig); + if (error) + return "advancedDatapathObservabilityConfig." + error; + } return null; }; @@ -50211,6 +50864,11 @@ throw TypeError(".google.container.v1.MonitoringConfig.managedPrometheusConfig: object expected"); message.managedPrometheusConfig = $root.google.container.v1.ManagedPrometheusConfig.fromObject(object.managedPrometheusConfig); } + if (object.advancedDatapathObservabilityConfig != null) { + if (typeof object.advancedDatapathObservabilityConfig !== "object") + throw TypeError(".google.container.v1.MonitoringConfig.advancedDatapathObservabilityConfig: object expected"); + message.advancedDatapathObservabilityConfig = $root.google.container.v1.AdvancedDatapathObservabilityConfig.fromObject(object.advancedDatapathObservabilityConfig); + } return message; }; @@ -50230,11 +50888,14 @@ if (options.defaults) { object.componentConfig = null; object.managedPrometheusConfig = null; + object.advancedDatapathObservabilityConfig = null; } if (message.componentConfig != null && message.hasOwnProperty("componentConfig")) object.componentConfig = $root.google.container.v1.MonitoringComponentConfig.toObject(message.componentConfig, options); if (message.managedPrometheusConfig != null && message.hasOwnProperty("managedPrometheusConfig")) object.managedPrometheusConfig = $root.google.container.v1.ManagedPrometheusConfig.toObject(message.managedPrometheusConfig, options); + if (message.advancedDatapathObservabilityConfig != null && message.hasOwnProperty("advancedDatapathObservabilityConfig")) + object.advancedDatapathObservabilityConfig = $root.google.container.v1.AdvancedDatapathObservabilityConfig.toObject(message.advancedDatapathObservabilityConfig, options); return object; }; @@ -50267,6 +50928,280 @@ return MonitoringConfig; })(); + v1.AdvancedDatapathObservabilityConfig = (function() { + + /** + * Properties of an AdvancedDatapathObservabilityConfig. + * @memberof google.container.v1 + * @interface IAdvancedDatapathObservabilityConfig + * @property {boolean|null} [enableMetrics] AdvancedDatapathObservabilityConfig enableMetrics + * @property {google.container.v1.AdvancedDatapathObservabilityConfig.RelayMode|null} [relayMode] AdvancedDatapathObservabilityConfig relayMode + */ + + /** + * Constructs a new AdvancedDatapathObservabilityConfig. + * @memberof google.container.v1 + * @classdesc Represents an AdvancedDatapathObservabilityConfig. + * @implements IAdvancedDatapathObservabilityConfig + * @constructor + * @param {google.container.v1.IAdvancedDatapathObservabilityConfig=} [properties] Properties to set + */ + function AdvancedDatapathObservabilityConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AdvancedDatapathObservabilityConfig enableMetrics. + * @member {boolean} enableMetrics + * @memberof google.container.v1.AdvancedDatapathObservabilityConfig + * @instance + */ + AdvancedDatapathObservabilityConfig.prototype.enableMetrics = false; + + /** + * AdvancedDatapathObservabilityConfig relayMode. + * @member {google.container.v1.AdvancedDatapathObservabilityConfig.RelayMode} relayMode + * @memberof google.container.v1.AdvancedDatapathObservabilityConfig + * @instance + */ + AdvancedDatapathObservabilityConfig.prototype.relayMode = 0; + + /** + * Creates a new AdvancedDatapathObservabilityConfig instance using the specified properties. + * @function create + * @memberof google.container.v1.AdvancedDatapathObservabilityConfig + * @static + * @param {google.container.v1.IAdvancedDatapathObservabilityConfig=} [properties] Properties to set + * @returns {google.container.v1.AdvancedDatapathObservabilityConfig} AdvancedDatapathObservabilityConfig instance + */ + AdvancedDatapathObservabilityConfig.create = function create(properties) { + return new AdvancedDatapathObservabilityConfig(properties); + }; + + /** + * Encodes the specified AdvancedDatapathObservabilityConfig message. Does not implicitly {@link google.container.v1.AdvancedDatapathObservabilityConfig.verify|verify} messages. + * @function encode + * @memberof google.container.v1.AdvancedDatapathObservabilityConfig + * @static + * @param {google.container.v1.IAdvancedDatapathObservabilityConfig} message AdvancedDatapathObservabilityConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdvancedDatapathObservabilityConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableMetrics != null && Object.hasOwnProperty.call(message, "enableMetrics")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableMetrics); + if (message.relayMode != null && Object.hasOwnProperty.call(message, "relayMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.relayMode); + return writer; + }; + + /** + * Encodes the specified AdvancedDatapathObservabilityConfig message, length delimited. Does not implicitly {@link google.container.v1.AdvancedDatapathObservabilityConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.container.v1.AdvancedDatapathObservabilityConfig + * @static + * @param {google.container.v1.IAdvancedDatapathObservabilityConfig} message AdvancedDatapathObservabilityConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdvancedDatapathObservabilityConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AdvancedDatapathObservabilityConfig message from the specified reader or buffer. + * @function decode + * @memberof google.container.v1.AdvancedDatapathObservabilityConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.container.v1.AdvancedDatapathObservabilityConfig} AdvancedDatapathObservabilityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdvancedDatapathObservabilityConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.container.v1.AdvancedDatapathObservabilityConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enableMetrics = reader.bool(); + break; + } + case 2: { + message.relayMode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AdvancedDatapathObservabilityConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.container.v1.AdvancedDatapathObservabilityConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.container.v1.AdvancedDatapathObservabilityConfig} AdvancedDatapathObservabilityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdvancedDatapathObservabilityConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AdvancedDatapathObservabilityConfig message. + * @function verify + * @memberof google.container.v1.AdvancedDatapathObservabilityConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AdvancedDatapathObservabilityConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableMetrics != null && message.hasOwnProperty("enableMetrics")) + if (typeof message.enableMetrics !== "boolean") + return "enableMetrics: boolean expected"; + if (message.relayMode != null && message.hasOwnProperty("relayMode")) + switch (message.relayMode) { + default: + return "relayMode: enum value expected"; + case 0: + case 1: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates an AdvancedDatapathObservabilityConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.container.v1.AdvancedDatapathObservabilityConfig + * @static + * @param {Object.} object Plain object + * @returns {google.container.v1.AdvancedDatapathObservabilityConfig} AdvancedDatapathObservabilityConfig + */ + AdvancedDatapathObservabilityConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.container.v1.AdvancedDatapathObservabilityConfig) + return object; + var message = new $root.google.container.v1.AdvancedDatapathObservabilityConfig(); + if (object.enableMetrics != null) + message.enableMetrics = Boolean(object.enableMetrics); + switch (object.relayMode) { + default: + if (typeof object.relayMode === "number") { + message.relayMode = object.relayMode; + break; + } + break; + case "RELAY_MODE_UNSPECIFIED": + case 0: + message.relayMode = 0; + break; + case "DISABLED": + case 1: + message.relayMode = 1; + break; + case "INTERNAL_VPC_LB": + case 3: + message.relayMode = 3; + break; + case "EXTERNAL_LB": + case 4: + message.relayMode = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from an AdvancedDatapathObservabilityConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.container.v1.AdvancedDatapathObservabilityConfig + * @static + * @param {google.container.v1.AdvancedDatapathObservabilityConfig} message AdvancedDatapathObservabilityConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AdvancedDatapathObservabilityConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enableMetrics = false; + object.relayMode = options.enums === String ? "RELAY_MODE_UNSPECIFIED" : 0; + } + if (message.enableMetrics != null && message.hasOwnProperty("enableMetrics")) + object.enableMetrics = message.enableMetrics; + if (message.relayMode != null && message.hasOwnProperty("relayMode")) + object.relayMode = options.enums === String ? $root.google.container.v1.AdvancedDatapathObservabilityConfig.RelayMode[message.relayMode] === undefined ? message.relayMode : $root.google.container.v1.AdvancedDatapathObservabilityConfig.RelayMode[message.relayMode] : message.relayMode; + return object; + }; + + /** + * Converts this AdvancedDatapathObservabilityConfig to JSON. + * @function toJSON + * @memberof google.container.v1.AdvancedDatapathObservabilityConfig + * @instance + * @returns {Object.} JSON object + */ + AdvancedDatapathObservabilityConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AdvancedDatapathObservabilityConfig + * @function getTypeUrl + * @memberof google.container.v1.AdvancedDatapathObservabilityConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AdvancedDatapathObservabilityConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.container.v1.AdvancedDatapathObservabilityConfig"; + }; + + /** + * RelayMode enum. + * @name google.container.v1.AdvancedDatapathObservabilityConfig.RelayMode + * @enum {number} + * @property {number} RELAY_MODE_UNSPECIFIED=0 RELAY_MODE_UNSPECIFIED value + * @property {number} DISABLED=1 DISABLED value + * @property {number} INTERNAL_VPC_LB=3 INTERNAL_VPC_LB value + * @property {number} EXTERNAL_LB=4 EXTERNAL_LB value + */ + AdvancedDatapathObservabilityConfig.RelayMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RELAY_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DISABLED"] = 1; + values[valuesById[3] = "INTERNAL_VPC_LB"] = 3; + values[valuesById[4] = "EXTERNAL_LB"] = 4; + return values; + })(); + + return AdvancedDatapathObservabilityConfig; + })(); + v1.NodePoolLoggingConfig = (function() { /** diff --git a/packages/google-container/protos/protos.json b/packages/google-container/protos/protos.json index d6ee74fba57..b8a209de200 100644 --- a/packages/google-container/protos/protos.json +++ b/packages/google-container/protos/protos.json @@ -916,6 +916,13 @@ } }, "NodeKubeletConfig": { + "oneofs": { + "_insecureKubeletReadonlyPortEnabled": { + "oneof": [ + "insecureKubeletReadonlyPortEnabled" + ] + } + }, "fields": { "cpuManagerPolicy": { "type": "string", @@ -932,6 +939,13 @@ "podPidsLimit": { "type": "int64", "id": 4 + }, + "insecureKubeletReadonlyPortEnabled": { + "type": "bool", + "id": 7, + "options": { + "proto3_optional": true + } } } }, @@ -1156,6 +1170,13 @@ "podCidrOverprovisionConfig": { "type": "PodCIDROverprovisionConfig", "id": 13 + }, + "podIpv4RangeUtilization": { + "type": "double", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -1435,6 +1456,10 @@ "gkeBackupAgentConfig": { "type": "GkeBackupAgentConfig", "id": 16 + }, + "gcsFuseCsiDriverConfig": { + "type": "GcsFuseCsiDriverConfig", + "id": 17 } } }, @@ -1579,6 +1604,14 @@ } } }, + "GcsFuseCsiDriverConfig": { + "fields": { + "enabled": { + "type": "bool", + "id": 1 + } + } + }, "GkeBackupAgentConfig": { "fields": { "enabled": { @@ -1783,6 +1816,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "defaultPodIpv4RangeUtilization": { + "type": "double", + "id": 25, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -2414,6 +2454,32 @@ "rule": "repeated", "type": "string", "id": 1 + }, + "podRangeInfo": { + "rule": "repeated", + "type": "RangeInfo", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "RangeInfo": { + "fields": { + "rangeName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "utilization": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -4055,6 +4121,13 @@ } }, "AutoprovisioningNodePoolDefaults": { + "oneofs": { + "_insecureKubeletReadonlyPortEnabled": { + "oneof": [ + "insecureKubeletReadonlyPortEnabled" + ] + } + }, "fields": { "oauthScopes": { "rule": "repeated", @@ -4099,6 +4172,13 @@ "imageType": { "type": "string", "id": 10 + }, + "insecureKubeletReadonlyPortEnabled": { + "type": "bool", + "id": 13, + "options": { + "proto3_optional": true + } } } }, @@ -5319,6 +5399,32 @@ "managedPrometheusConfig": { "type": "ManagedPrometheusConfig", "id": 2 + }, + "advancedDatapathObservabilityConfig": { + "type": "AdvancedDatapathObservabilityConfig", + "id": 3 + } + } + }, + "AdvancedDatapathObservabilityConfig": { + "fields": { + "enableMetrics": { + "type": "bool", + "id": 1 + }, + "relayMode": { + "type": "RelayMode", + "id": 2 + } + }, + "nested": { + "RelayMode": { + "values": { + "RELAY_MODE_UNSPECIFIED": 0, + "DISABLED": 1, + "INTERNAL_VPC_LB": 3, + "EXTERNAL_LB": 4 + } } } },