google-cloud-container 0.11.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +2 -1
  3. data/AUTHENTICATION.md +51 -54
  4. data/LICENSE.md +203 -0
  5. data/MIGRATING.md +231 -0
  6. data/README.md +34 -34
  7. data/lib/{google/cloud/container/v1/doc/google/protobuf/empty.rb → google-cloud-container.rb} +4 -14
  8. data/lib/google/cloud/container.rb +81 -128
  9. data/lib/google/cloud/container/version.rb +6 -2
  10. metadata +98 -56
  11. data/LICENSE +0 -201
  12. data/lib/google/cloud/container/v1.rb +0 -157
  13. data/lib/google/cloud/container/v1/cluster_manager_client.rb +0 -2197
  14. data/lib/google/cloud/container/v1/cluster_manager_client_config.json +0 -181
  15. data/lib/google/cloud/container/v1/credentials.rb +0 -41
  16. data/lib/google/cloud/container/v1/doc/google/container/v1/cluster_service.rb +0 -2358
  17. data/lib/google/cloud/container/v1/doc/google/protobuf/timestamp.rb +0 -113
  18. data/lib/google/cloud/container/v1beta1.rb +0 -157
  19. data/lib/google/cloud/container/v1beta1/cluster_manager_client.rb +0 -2515
  20. data/lib/google/cloud/container/v1beta1/cluster_manager_client_config.json +0 -186
  21. data/lib/google/cloud/container/v1beta1/credentials.rb +0 -41
  22. data/lib/google/cloud/container/v1beta1/doc/google/container/v1beta1/cluster_service.rb +0 -2533
  23. data/lib/google/cloud/container/v1beta1/doc/google/protobuf/empty.rb +0 -29
  24. data/lib/google/cloud/container/v1beta1/doc/google/protobuf/timestamp.rb +0 -113
  25. data/lib/google/container/v1/cluster_service_pb.rb +0 -729
  26. data/lib/google/container/v1/cluster_service_services_pb.rb +0 -132
  27. data/lib/google/container/v1beta1/cluster_service_pb.rb +0 -798
  28. data/lib/google/container/v1beta1/cluster_service_services_pb.rb +0 -134
data/LICENSE DELETED
@@ -1,201 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- https://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright [yyyy] [name of copyright owner]
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- https://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.
@@ -1,157 +0,0 @@
1
- # Copyright 2020 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
-
16
- require "google/cloud/container/v1/cluster_manager_client"
17
-
18
- module Google
19
- module Cloud
20
- module Container
21
- # rubocop:disable LineLength
22
-
23
- ##
24
- # # Ruby Client for Kubernetes Engine API
25
- #
26
- # [Kubernetes Engine API][Product Documentation]:
27
- # Builds and manages container-based applications, powered by the open source
28
- # Kubernetes technology.
29
- # - [Product Documentation][]
30
- #
31
- # ## Quick Start
32
- # In order to use this library, you first need to go through the following
33
- # steps:
34
- #
35
- # 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
36
- # 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
37
- # 3. [Enable the Kubernetes Engine API.](https://console.cloud.google.com/apis/library/container.googleapis.com)
38
- # 4. [Setup Authentication.](https://googleapis.dev/ruby/google-cloud-container/latest/file.AUTHENTICATION.html)
39
- #
40
- # ### Installation
41
- # ```
42
- # $ gem install google-cloud-container
43
- # ```
44
- #
45
- # ### Preview
46
- # #### ClusterManagerClient
47
- # ```rb
48
- # require "google/cloud/container"
49
- #
50
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
51
- # project_id_2 = project_id
52
- # zone = "us-central1-a"
53
- # response = cluster_manager_client.list_clusters(project_id: project_id_2, zone: zone)
54
- # ```
55
- #
56
- # ### Next Steps
57
- # - Read the [Kubernetes Engine API Product documentation][Product Documentation]
58
- # to learn more about the product and see How-to Guides.
59
- # - View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
60
- # to see the full list of Cloud APIs that we cover.
61
- #
62
- # [Product Documentation]: https://cloud.google.com/kubernetes-engine
63
- #
64
- # ## Enabling Logging
65
- #
66
- # To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
67
- # The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
68
- # or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
69
- # that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
70
- # and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
71
- #
72
- # Configuring a Ruby stdlib logger:
73
- #
74
- # ```ruby
75
- # require "logger"
76
- #
77
- # module MyLogger
78
- # LOGGER = Logger.new $stderr, level: Logger::WARN
79
- # def logger
80
- # LOGGER
81
- # end
82
- # end
83
- #
84
- # # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
85
- # module GRPC
86
- # extend MyLogger
87
- # end
88
- # ```
89
- #
90
- module V1
91
- # rubocop:enable LineLength
92
-
93
- ##
94
- # Google Kubernetes Engine Cluster Manager v1
95
- #
96
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
97
- # Provides the means for authenticating requests made by the client. This parameter can
98
- # be many types.
99
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
100
- # authenticating requests made by this client.
101
- # A `String` will be treated as the path to the keyfile to be used for the construction of
102
- # credentials for this client.
103
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
104
- # credentials for this client.
105
- # A `GRPC::Core::Channel` will be used to make calls through.
106
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
107
- # should already be composed with a `GRPC::Core::CallCredentials` object.
108
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
109
- # metadata for requests, generally, to give OAuth credentials.
110
- # @param scopes [Array<String>]
111
- # The OAuth scopes for this service. This parameter is ignored if
112
- # an updater_proc is supplied.
113
- # @param client_config [Hash]
114
- # A Hash for call options for each method. See
115
- # Google::Gax#construct_settings for the structure of
116
- # this data. Falls back to the default config if not specified
117
- # or the specified config is missing data points.
118
- # @param timeout [Numeric]
119
- # The default timeout, in seconds, for calls made through this client.
120
- # @param metadata [Hash]
121
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
122
- # @param service_address [String]
123
- # Override for the service hostname, or `nil` to leave as the default.
124
- # @param service_port [Integer]
125
- # Override for the service port, or `nil` to leave as the default.
126
- # @param exception_transformer [Proc]
127
- # An optional proc that intercepts any exceptions raised during an API call to inject
128
- # custom error handling.
129
- def self.new \
130
- credentials: nil,
131
- scopes: nil,
132
- client_config: nil,
133
- timeout: nil,
134
- metadata: nil,
135
- service_address: nil,
136
- service_port: nil,
137
- exception_transformer: nil,
138
- lib_name: nil,
139
- lib_version: nil
140
- kwargs = {
141
- credentials: credentials,
142
- scopes: scopes,
143
- client_config: client_config,
144
- timeout: timeout,
145
- metadata: metadata,
146
- exception_transformer: exception_transformer,
147
- lib_name: lib_name,
148
- service_address: service_address,
149
- service_port: service_port,
150
- lib_version: lib_version
151
- }.select { |_, v| v != nil }
152
- Google::Cloud::Container::V1::ClusterManagerClient.new(**kwargs)
153
- end
154
- end
155
- end
156
- end
157
- end
@@ -1,2197 +0,0 @@
1
- # Copyright 2020 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
- #
15
- # EDITING INSTRUCTIONS
16
- # This file was generated from the file
17
- # https://github.com/googleapis/googleapis/blob/master/google/container/v1/cluster_service.proto,
18
- # and updates to that file get reflected here through a refresh process.
19
- # For the short term, the refresh process will only be runnable by Google
20
- # engineers.
21
-
22
-
23
- require "json"
24
- require "pathname"
25
-
26
- require "google/gax"
27
-
28
- require "google/container/v1/cluster_service_pb"
29
- require "google/cloud/container/v1/credentials"
30
- require "google/cloud/container/version"
31
-
32
- module Google
33
- module Cloud
34
- module Container
35
- module V1
36
- # Google Kubernetes Engine Cluster Manager v1
37
- #
38
- # @!attribute [r] cluster_manager_stub
39
- # @return [Google::Container::V1::ClusterManager::Stub]
40
- class ClusterManagerClient
41
- # @private
42
- attr_reader :cluster_manager_stub
43
-
44
- # The default address of the service.
45
- SERVICE_ADDRESS = "container.googleapis.com".freeze
46
-
47
- # The default port of the service.
48
- DEFAULT_SERVICE_PORT = 443
49
-
50
- # The default set of gRPC interceptors.
51
- GRPC_INTERCEPTORS = []
52
-
53
- DEFAULT_TIMEOUT = 30
54
-
55
- PAGE_DESCRIPTORS = {
56
- "list_usable_subnetworks" => Google::Gax::PageDescriptor.new(
57
- "page_token",
58
- "next_page_token",
59
- "subnetworks")
60
- }.freeze
61
-
62
- private_constant :PAGE_DESCRIPTORS
63
-
64
- # The scopes needed to make gRPC calls to all of the methods defined in
65
- # this service.
66
- ALL_SCOPES = [
67
- "https://www.googleapis.com/auth/cloud-platform"
68
- ].freeze
69
-
70
-
71
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
72
- # Provides the means for authenticating requests made by the client. This parameter can
73
- # be many types.
74
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
75
- # authenticating requests made by this client.
76
- # A `String` will be treated as the path to the keyfile to be used for the construction of
77
- # credentials for this client.
78
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
79
- # credentials for this client.
80
- # A `GRPC::Core::Channel` will be used to make calls through.
81
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
82
- # should already be composed with a `GRPC::Core::CallCredentials` object.
83
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
84
- # metadata for requests, generally, to give OAuth credentials.
85
- # @param scopes [Array<String>]
86
- # The OAuth scopes for this service. This parameter is ignored if
87
- # an updater_proc is supplied.
88
- # @param client_config [Hash]
89
- # A Hash for call options for each method. See
90
- # Google::Gax#construct_settings for the structure of
91
- # this data. Falls back to the default config if not specified
92
- # or the specified config is missing data points.
93
- # @param timeout [Numeric]
94
- # The default timeout, in seconds, for calls made through this client.
95
- # @param metadata [Hash]
96
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
97
- # @param service_address [String]
98
- # Override for the service hostname, or `nil` to leave as the default.
99
- # @param service_port [Integer]
100
- # Override for the service port, or `nil` to leave as the default.
101
- # @param exception_transformer [Proc]
102
- # An optional proc that intercepts any exceptions raised during an API call to inject
103
- # custom error handling.
104
- def initialize \
105
- credentials: nil,
106
- scopes: ALL_SCOPES,
107
- client_config: {},
108
- timeout: DEFAULT_TIMEOUT,
109
- metadata: nil,
110
- service_address: nil,
111
- service_port: nil,
112
- exception_transformer: nil,
113
- lib_name: nil,
114
- lib_version: ""
115
- # These require statements are intentionally placed here to initialize
116
- # the gRPC module only when it's required.
117
- # See https://github.com/googleapis/toolkit/issues/446
118
- require "google/gax/grpc"
119
- require "google/container/v1/cluster_service_services_pb"
120
-
121
- credentials ||= Google::Cloud::Container::V1::Credentials.default
122
-
123
- if credentials.is_a?(String) || credentials.is_a?(Hash)
124
- updater_proc = Google::Cloud::Container::V1::Credentials.new(credentials).updater_proc
125
- end
126
- if credentials.is_a?(GRPC::Core::Channel)
127
- channel = credentials
128
- end
129
- if credentials.is_a?(GRPC::Core::ChannelCredentials)
130
- chan_creds = credentials
131
- end
132
- if credentials.is_a?(Proc)
133
- updater_proc = credentials
134
- end
135
- if credentials.is_a?(Google::Auth::Credentials)
136
- updater_proc = credentials.updater_proc
137
- end
138
-
139
- package_version = Google::Cloud::Container::VERSION
140
-
141
- google_api_client = "gl-ruby/#{RUBY_VERSION}"
142
- google_api_client << " #{lib_name}/#{lib_version}" if lib_name
143
- google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
144
- google_api_client << " grpc/#{GRPC::VERSION}"
145
- google_api_client.freeze
146
-
147
- headers = { :"x-goog-api-client" => google_api_client }
148
- if credentials.respond_to?(:quota_project_id) && credentials.quota_project_id
149
- headers[:"x-goog-user-project"] = credentials.quota_project_id
150
- end
151
- headers.merge!(metadata) unless metadata.nil?
152
- client_config_file = Pathname.new(__dir__).join(
153
- "cluster_manager_client_config.json"
154
- )
155
- defaults = client_config_file.open do |f|
156
- Google::Gax.construct_settings(
157
- "google.container.v1.ClusterManager",
158
- JSON.parse(f.read),
159
- client_config,
160
- Google::Gax::Grpc::STATUS_CODE_NAMES,
161
- timeout,
162
- page_descriptors: PAGE_DESCRIPTORS,
163
- errors: Google::Gax::Grpc::API_ERRORS,
164
- metadata: headers
165
- )
166
- end
167
-
168
- # Allow overriding the service path/port in subclasses.
169
- service_path = service_address || self.class::SERVICE_ADDRESS
170
- port = service_port || self.class::DEFAULT_SERVICE_PORT
171
- interceptors = self.class::GRPC_INTERCEPTORS
172
- @cluster_manager_stub = Google::Gax::Grpc.create_stub(
173
- service_path,
174
- port,
175
- chan_creds: chan_creds,
176
- channel: channel,
177
- updater_proc: updater_proc,
178
- scopes: scopes,
179
- interceptors: interceptors,
180
- &Google::Container::V1::ClusterManager::Stub.method(:new)
181
- )
182
-
183
- @list_clusters = Google::Gax.create_api_call(
184
- @cluster_manager_stub.method(:list_clusters),
185
- defaults["list_clusters"],
186
- exception_transformer: exception_transformer,
187
- params_extractor: proc do |request|
188
- {'parent' => request.parent}
189
- end
190
- )
191
- @get_cluster = Google::Gax.create_api_call(
192
- @cluster_manager_stub.method(:get_cluster),
193
- defaults["get_cluster"],
194
- exception_transformer: exception_transformer,
195
- params_extractor: proc do |request|
196
- {'name' => request.name}
197
- end
198
- )
199
- @create_cluster = Google::Gax.create_api_call(
200
- @cluster_manager_stub.method(:create_cluster),
201
- defaults["create_cluster"],
202
- exception_transformer: exception_transformer,
203
- params_extractor: proc do |request|
204
- {'parent' => request.parent}
205
- end
206
- )
207
- @update_cluster = Google::Gax.create_api_call(
208
- @cluster_manager_stub.method(:update_cluster),
209
- defaults["update_cluster"],
210
- exception_transformer: exception_transformer,
211
- params_extractor: proc do |request|
212
- {'name' => request.name}
213
- end
214
- )
215
- @update_node_pool = Google::Gax.create_api_call(
216
- @cluster_manager_stub.method(:update_node_pool),
217
- defaults["update_node_pool"],
218
- exception_transformer: exception_transformer,
219
- params_extractor: proc do |request|
220
- {'name' => request.name}
221
- end
222
- )
223
- @set_node_pool_autoscaling = Google::Gax.create_api_call(
224
- @cluster_manager_stub.method(:set_node_pool_autoscaling),
225
- defaults["set_node_pool_autoscaling"],
226
- exception_transformer: exception_transformer,
227
- params_extractor: proc do |request|
228
- {'name' => request.name}
229
- end
230
- )
231
- @set_logging_service = Google::Gax.create_api_call(
232
- @cluster_manager_stub.method(:set_logging_service),
233
- defaults["set_logging_service"],
234
- exception_transformer: exception_transformer,
235
- params_extractor: proc do |request|
236
- {'name' => request.name}
237
- end
238
- )
239
- @set_monitoring_service = Google::Gax.create_api_call(
240
- @cluster_manager_stub.method(:set_monitoring_service),
241
- defaults["set_monitoring_service"],
242
- exception_transformer: exception_transformer,
243
- params_extractor: proc do |request|
244
- {'name' => request.name}
245
- end
246
- )
247
- @set_addons_config = Google::Gax.create_api_call(
248
- @cluster_manager_stub.method(:set_addons_config),
249
- defaults["set_addons_config"],
250
- exception_transformer: exception_transformer,
251
- params_extractor: proc do |request|
252
- {'name' => request.name}
253
- end
254
- )
255
- @set_locations = Google::Gax.create_api_call(
256
- @cluster_manager_stub.method(:set_locations),
257
- defaults["set_locations"],
258
- exception_transformer: exception_transformer,
259
- params_extractor: proc do |request|
260
- {'name' => request.name}
261
- end
262
- )
263
- @update_master = Google::Gax.create_api_call(
264
- @cluster_manager_stub.method(:update_master),
265
- defaults["update_master"],
266
- exception_transformer: exception_transformer,
267
- params_extractor: proc do |request|
268
- {'name' => request.name}
269
- end
270
- )
271
- @set_master_auth = Google::Gax.create_api_call(
272
- @cluster_manager_stub.method(:set_master_auth),
273
- defaults["set_master_auth"],
274
- exception_transformer: exception_transformer,
275
- params_extractor: proc do |request|
276
- {'name' => request.name}
277
- end
278
- )
279
- @delete_cluster = Google::Gax.create_api_call(
280
- @cluster_manager_stub.method(:delete_cluster),
281
- defaults["delete_cluster"],
282
- exception_transformer: exception_transformer,
283
- params_extractor: proc do |request|
284
- {'name' => request.name}
285
- end
286
- )
287
- @list_operations = Google::Gax.create_api_call(
288
- @cluster_manager_stub.method(:list_operations),
289
- defaults["list_operations"],
290
- exception_transformer: exception_transformer,
291
- params_extractor: proc do |request|
292
- {'parent' => request.parent}
293
- end
294
- )
295
- @get_operation = Google::Gax.create_api_call(
296
- @cluster_manager_stub.method(:get_operation),
297
- defaults["get_operation"],
298
- exception_transformer: exception_transformer,
299
- params_extractor: proc do |request|
300
- {'name' => request.name}
301
- end
302
- )
303
- @cancel_operation = Google::Gax.create_api_call(
304
- @cluster_manager_stub.method(:cancel_operation),
305
- defaults["cancel_operation"],
306
- exception_transformer: exception_transformer,
307
- params_extractor: proc do |request|
308
- {'name' => request.name}
309
- end
310
- )
311
- @get_server_config = Google::Gax.create_api_call(
312
- @cluster_manager_stub.method(:get_server_config),
313
- defaults["get_server_config"],
314
- exception_transformer: exception_transformer,
315
- params_extractor: proc do |request|
316
- {'name' => request.name}
317
- end
318
- )
319
- @list_node_pools = Google::Gax.create_api_call(
320
- @cluster_manager_stub.method(:list_node_pools),
321
- defaults["list_node_pools"],
322
- exception_transformer: exception_transformer,
323
- params_extractor: proc do |request|
324
- {'parent' => request.parent}
325
- end
326
- )
327
- @get_node_pool = Google::Gax.create_api_call(
328
- @cluster_manager_stub.method(:get_node_pool),
329
- defaults["get_node_pool"],
330
- exception_transformer: exception_transformer,
331
- params_extractor: proc do |request|
332
- {'name' => request.name}
333
- end
334
- )
335
- @create_node_pool = Google::Gax.create_api_call(
336
- @cluster_manager_stub.method(:create_node_pool),
337
- defaults["create_node_pool"],
338
- exception_transformer: exception_transformer,
339
- params_extractor: proc do |request|
340
- {'parent' => request.parent}
341
- end
342
- )
343
- @delete_node_pool = Google::Gax.create_api_call(
344
- @cluster_manager_stub.method(:delete_node_pool),
345
- defaults["delete_node_pool"],
346
- exception_transformer: exception_transformer,
347
- params_extractor: proc do |request|
348
- {'name' => request.name}
349
- end
350
- )
351
- @rollback_node_pool_upgrade = Google::Gax.create_api_call(
352
- @cluster_manager_stub.method(:rollback_node_pool_upgrade),
353
- defaults["rollback_node_pool_upgrade"],
354
- exception_transformer: exception_transformer,
355
- params_extractor: proc do |request|
356
- {'name' => request.name}
357
- end
358
- )
359
- @set_node_pool_management = Google::Gax.create_api_call(
360
- @cluster_manager_stub.method(:set_node_pool_management),
361
- defaults["set_node_pool_management"],
362
- exception_transformer: exception_transformer,
363
- params_extractor: proc do |request|
364
- {'name' => request.name}
365
- end
366
- )
367
- @set_labels = Google::Gax.create_api_call(
368
- @cluster_manager_stub.method(:set_labels),
369
- defaults["set_labels"],
370
- exception_transformer: exception_transformer,
371
- params_extractor: proc do |request|
372
- {'name' => request.name}
373
- end
374
- )
375
- @set_legacy_abac = Google::Gax.create_api_call(
376
- @cluster_manager_stub.method(:set_legacy_abac),
377
- defaults["set_legacy_abac"],
378
- exception_transformer: exception_transformer,
379
- params_extractor: proc do |request|
380
- {'name' => request.name}
381
- end
382
- )
383
- @start_ip_rotation = Google::Gax.create_api_call(
384
- @cluster_manager_stub.method(:start_ip_rotation),
385
- defaults["start_ip_rotation"],
386
- exception_transformer: exception_transformer,
387
- params_extractor: proc do |request|
388
- {'name' => request.name}
389
- end
390
- )
391
- @complete_ip_rotation = Google::Gax.create_api_call(
392
- @cluster_manager_stub.method(:complete_ip_rotation),
393
- defaults["complete_ip_rotation"],
394
- exception_transformer: exception_transformer,
395
- params_extractor: proc do |request|
396
- {'name' => request.name}
397
- end
398
- )
399
- @set_node_pool_size = Google::Gax.create_api_call(
400
- @cluster_manager_stub.method(:set_node_pool_size),
401
- defaults["set_node_pool_size"],
402
- exception_transformer: exception_transformer,
403
- params_extractor: proc do |request|
404
- {'name' => request.name}
405
- end
406
- )
407
- @set_network_policy = Google::Gax.create_api_call(
408
- @cluster_manager_stub.method(:set_network_policy),
409
- defaults["set_network_policy"],
410
- exception_transformer: exception_transformer,
411
- params_extractor: proc do |request|
412
- {'name' => request.name}
413
- end
414
- )
415
- @set_maintenance_policy = Google::Gax.create_api_call(
416
- @cluster_manager_stub.method(:set_maintenance_policy),
417
- defaults["set_maintenance_policy"],
418
- exception_transformer: exception_transformer,
419
- params_extractor: proc do |request|
420
- {'name' => request.name}
421
- end
422
- )
423
- @list_usable_subnetworks = Google::Gax.create_api_call(
424
- @cluster_manager_stub.method(:list_usable_subnetworks),
425
- defaults["list_usable_subnetworks"],
426
- exception_transformer: exception_transformer,
427
- params_extractor: proc do |request|
428
- {'parent' => request.parent}
429
- end
430
- )
431
- end
432
-
433
- # Service calls
434
-
435
- # Lists all clusters owned by a project in either the specified zone or all
436
- # zones.
437
- #
438
- # @param project_id [String]
439
- # Deprecated. The Google Developers Console [project ID or project
440
- # number](https://support.google.com/cloud/answer/6158840).
441
- # This field has been deprecated and replaced by the parent field.
442
- # @param zone [String]
443
- # Deprecated. The name of the Google Compute Engine
444
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
445
- # resides, or "-" for all zones.
446
- # This field has been deprecated and replaced by the parent field.
447
- # @param parent [String]
448
- # The parent (project and location) where the clusters will be listed.
449
- # Specified in the format `projects/*/locations/*`.
450
- # Location "-" matches all zones and all regions.
451
- # @param options [Google::Gax::CallOptions]
452
- # Overrides the default settings for this call, e.g, timeout,
453
- # retries, etc.
454
- # @yield [result, operation] Access the result along with the RPC operation
455
- # @yieldparam result [Google::Container::V1::ListClustersResponse]
456
- # @yieldparam operation [GRPC::ActiveCall::Operation]
457
- # @return [Google::Container::V1::ListClustersResponse]
458
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
459
- # @example
460
- # require "google/cloud/container"
461
- #
462
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
463
- # response = cluster_manager_client.list_clusters
464
-
465
- def list_clusters \
466
- project_id: nil,
467
- zone: nil,
468
- parent: nil,
469
- options: nil,
470
- &block
471
- req = {
472
- project_id: project_id,
473
- zone: zone,
474
- parent: parent
475
- }.delete_if { |_, v| v.nil? }
476
- req = Google::Gax::to_proto(req, Google::Container::V1::ListClustersRequest)
477
- @list_clusters.call(req, options, &block)
478
- end
479
-
480
- # Gets the details of a specific cluster.
481
- #
482
- # @param project_id [String]
483
- # Deprecated. The Google Developers Console [project ID or project
484
- # number](https://support.google.com/cloud/answer/6158840).
485
- # This field has been deprecated and replaced by the name field.
486
- # @param zone [String]
487
- # Deprecated. The name of the Google Compute Engine
488
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
489
- # resides.
490
- # This field has been deprecated and replaced by the name field.
491
- # @param cluster_id [String]
492
- # Deprecated. The name of the cluster to retrieve.
493
- # This field has been deprecated and replaced by the name field.
494
- # @param name [String]
495
- # The name (project, location, cluster) of the cluster to retrieve.
496
- # Specified in the format `projects/*/locations/*/clusters/*`.
497
- # @param options [Google::Gax::CallOptions]
498
- # Overrides the default settings for this call, e.g, timeout,
499
- # retries, etc.
500
- # @yield [result, operation] Access the result along with the RPC operation
501
- # @yieldparam result [Google::Container::V1::Cluster]
502
- # @yieldparam operation [GRPC::ActiveCall::Operation]
503
- # @return [Google::Container::V1::Cluster]
504
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
505
- # @example
506
- # require "google/cloud/container"
507
- #
508
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
509
- # response = cluster_manager_client.get_cluster
510
-
511
- def get_cluster \
512
- project_id: nil,
513
- zone: nil,
514
- cluster_id: nil,
515
- name: nil,
516
- options: nil,
517
- &block
518
- req = {
519
- project_id: project_id,
520
- zone: zone,
521
- cluster_id: cluster_id,
522
- name: name
523
- }.delete_if { |_, v| v.nil? }
524
- req = Google::Gax::to_proto(req, Google::Container::V1::GetClusterRequest)
525
- @get_cluster.call(req, options, &block)
526
- end
527
-
528
- # Creates a cluster, consisting of the specified number and type of Google
529
- # Compute Engine instances.
530
- #
531
- # By default, the cluster is created in the project's
532
- # [default network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks).
533
- #
534
- # One firewall is added for the cluster. After cluster creation,
535
- # the Kubelet creates routes for each node to allow the containers
536
- # on that node to communicate with all other instances in the
537
- # cluster.
538
- #
539
- # Finally, an entry is added to the project's global metadata indicating
540
- # which CIDR range the cluster is using.
541
- #
542
- # @param cluster [Google::Container::V1::Cluster | Hash]
543
- # Required. A [cluster
544
- # resource](https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters)
545
- # A hash of the same form as `Google::Container::V1::Cluster`
546
- # can also be provided.
547
- # @param project_id [String]
548
- # Deprecated. The Google Developers Console [project ID or project
549
- # number](https://support.google.com/cloud/answer/6158840).
550
- # This field has been deprecated and replaced by the parent field.
551
- # @param zone [String]
552
- # Deprecated. The name of the Google Compute Engine
553
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
554
- # resides.
555
- # This field has been deprecated and replaced by the parent field.
556
- # @param parent [String]
557
- # The parent (project and location) where the cluster will be created.
558
- # Specified in the format `projects/*/locations/*`.
559
- # @param options [Google::Gax::CallOptions]
560
- # Overrides the default settings for this call, e.g, timeout,
561
- # retries, etc.
562
- # @yield [result, operation] Access the result along with the RPC operation
563
- # @yieldparam result [Google::Container::V1::Operation]
564
- # @yieldparam operation [GRPC::ActiveCall::Operation]
565
- # @return [Google::Container::V1::Operation]
566
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
567
- # @example
568
- # require "google/cloud/container"
569
- #
570
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
571
- #
572
- # # TODO: Initialize `cluster`:
573
- # cluster = {}
574
- # response = cluster_manager_client.create_cluster(cluster)
575
-
576
- def create_cluster \
577
- cluster,
578
- project_id: nil,
579
- zone: nil,
580
- parent: nil,
581
- options: nil,
582
- &block
583
- req = {
584
- cluster: cluster,
585
- project_id: project_id,
586
- zone: zone,
587
- parent: parent
588
- }.delete_if { |_, v| v.nil? }
589
- req = Google::Gax::to_proto(req, Google::Container::V1::CreateClusterRequest)
590
- @create_cluster.call(req, options, &block)
591
- end
592
-
593
- # Updates the settings of a specific cluster.
594
- #
595
- # @param update [Google::Container::V1::ClusterUpdate | Hash]
596
- # Required. A description of the update.
597
- # A hash of the same form as `Google::Container::V1::ClusterUpdate`
598
- # can also be provided.
599
- # @param project_id [String]
600
- # Deprecated. The Google Developers Console [project ID or project
601
- # number](https://support.google.com/cloud/answer/6158840).
602
- # This field has been deprecated and replaced by the name field.
603
- # @param zone [String]
604
- # Deprecated. The name of the Google Compute Engine
605
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
606
- # resides.
607
- # This field has been deprecated and replaced by the name field.
608
- # @param cluster_id [String]
609
- # Deprecated. The name of the cluster to upgrade.
610
- # This field has been deprecated and replaced by the name field.
611
- # @param name [String]
612
- # The name (project, location, cluster) of the cluster to update.
613
- # Specified in the format `projects/*/locations/*/clusters/*`.
614
- # @param options [Google::Gax::CallOptions]
615
- # Overrides the default settings for this call, e.g, timeout,
616
- # retries, etc.
617
- # @yield [result, operation] Access the result along with the RPC operation
618
- # @yieldparam result [Google::Container::V1::Operation]
619
- # @yieldparam operation [GRPC::ActiveCall::Operation]
620
- # @return [Google::Container::V1::Operation]
621
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
622
- # @example
623
- # require "google/cloud/container"
624
- #
625
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
626
- #
627
- # # TODO: Initialize `update`:
628
- # update = {}
629
- # response = cluster_manager_client.update_cluster(update)
630
-
631
- def update_cluster \
632
- update,
633
- project_id: nil,
634
- zone: nil,
635
- cluster_id: nil,
636
- name: nil,
637
- options: nil,
638
- &block
639
- req = {
640
- update: update,
641
- project_id: project_id,
642
- zone: zone,
643
- cluster_id: cluster_id,
644
- name: name
645
- }.delete_if { |_, v| v.nil? }
646
- req = Google::Gax::to_proto(req, Google::Container::V1::UpdateClusterRequest)
647
- @update_cluster.call(req, options, &block)
648
- end
649
-
650
- # Updates the version and/or image type for the specified node pool.
651
- #
652
- # @param node_version [String]
653
- # Required. The Kubernetes version to change the nodes to (typically an
654
- # upgrade).
655
- #
656
- # Users may specify either explicit versions offered by Kubernetes Engine or
657
- # version aliases, which have the following behavior:
658
- #
659
- # * "latest": picks the highest valid Kubernetes version
660
- # * "1.X": picks the highest valid patch+gke.N patch in the 1.X version
661
- # * "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
662
- # * "1.X.Y-gke.N": picks an explicit Kubernetes version
663
- # * "-": picks the Kubernetes master version
664
- # @param image_type [String]
665
- # Required. The desired image type for the node pool.
666
- # @param project_id [String]
667
- # Deprecated. The Google Developers Console [project ID or project
668
- # number](https://support.google.com/cloud/answer/6158840).
669
- # This field has been deprecated and replaced by the name field.
670
- # @param zone [String]
671
- # Deprecated. The name of the Google Compute Engine
672
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
673
- # resides.
674
- # This field has been deprecated and replaced by the name field.
675
- # @param cluster_id [String]
676
- # Deprecated. The name of the cluster to upgrade.
677
- # This field has been deprecated and replaced by the name field.
678
- # @param node_pool_id [String]
679
- # Deprecated. The name of the node pool to upgrade.
680
- # This field has been deprecated and replaced by the name field.
681
- # @param name [String]
682
- # The name (project, location, cluster, node pool) of the node pool to
683
- # update. Specified in the format
684
- # `projects/*/locations/*/clusters/*/nodePools/*`.
685
- # @param options [Google::Gax::CallOptions]
686
- # Overrides the default settings for this call, e.g, timeout,
687
- # retries, etc.
688
- # @yield [result, operation] Access the result along with the RPC operation
689
- # @yieldparam result [Google::Container::V1::Operation]
690
- # @yieldparam operation [GRPC::ActiveCall::Operation]
691
- # @return [Google::Container::V1::Operation]
692
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
693
- # @example
694
- # require "google/cloud/container"
695
- #
696
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
697
- #
698
- # # TODO: Initialize `node_version`:
699
- # node_version = ''
700
- #
701
- # # TODO: Initialize `image_type`:
702
- # image_type = ''
703
- # response = cluster_manager_client.update_node_pool(node_version, image_type)
704
-
705
- def update_node_pool \
706
- node_version,
707
- image_type,
708
- project_id: nil,
709
- zone: nil,
710
- cluster_id: nil,
711
- node_pool_id: nil,
712
- name: nil,
713
- options: nil,
714
- &block
715
- req = {
716
- node_version: node_version,
717
- image_type: image_type,
718
- project_id: project_id,
719
- zone: zone,
720
- cluster_id: cluster_id,
721
- node_pool_id: node_pool_id,
722
- name: name
723
- }.delete_if { |_, v| v.nil? }
724
- req = Google::Gax::to_proto(req, Google::Container::V1::UpdateNodePoolRequest)
725
- @update_node_pool.call(req, options, &block)
726
- end
727
-
728
- # Sets the autoscaling settings for the specified node pool.
729
- #
730
- # @param autoscaling [Google::Container::V1::NodePoolAutoscaling | Hash]
731
- # Required. Autoscaling configuration for the node pool.
732
- # A hash of the same form as `Google::Container::V1::NodePoolAutoscaling`
733
- # can also be provided.
734
- # @param project_id [String]
735
- # Deprecated. The Google Developers Console [project ID or project
736
- # number](https://support.google.com/cloud/answer/6158840).
737
- # This field has been deprecated and replaced by the name field.
738
- # @param zone [String]
739
- # Deprecated. The name of the Google Compute Engine
740
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
741
- # resides.
742
- # This field has been deprecated and replaced by the name field.
743
- # @param cluster_id [String]
744
- # Deprecated. The name of the cluster to upgrade.
745
- # This field has been deprecated and replaced by the name field.
746
- # @param node_pool_id [String]
747
- # Deprecated. The name of the node pool to upgrade.
748
- # This field has been deprecated and replaced by the name field.
749
- # @param name [String]
750
- # The name (project, location, cluster, node pool) of the node pool to set
751
- # autoscaler settings. Specified in the format
752
- # `projects/*/locations/*/clusters/*/nodePools/*`.
753
- # @param options [Google::Gax::CallOptions]
754
- # Overrides the default settings for this call, e.g, timeout,
755
- # retries, etc.
756
- # @yield [result, operation] Access the result along with the RPC operation
757
- # @yieldparam result [Google::Container::V1::Operation]
758
- # @yieldparam operation [GRPC::ActiveCall::Operation]
759
- # @return [Google::Container::V1::Operation]
760
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
761
- # @example
762
- # require "google/cloud/container"
763
- #
764
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
765
- #
766
- # # TODO: Initialize `autoscaling`:
767
- # autoscaling = {}
768
- # response = cluster_manager_client.set_node_pool_autoscaling(autoscaling)
769
-
770
- def set_node_pool_autoscaling \
771
- autoscaling,
772
- project_id: nil,
773
- zone: nil,
774
- cluster_id: nil,
775
- node_pool_id: nil,
776
- name: nil,
777
- options: nil,
778
- &block
779
- req = {
780
- autoscaling: autoscaling,
781
- project_id: project_id,
782
- zone: zone,
783
- cluster_id: cluster_id,
784
- node_pool_id: node_pool_id,
785
- name: name
786
- }.delete_if { |_, v| v.nil? }
787
- req = Google::Gax::to_proto(req, Google::Container::V1::SetNodePoolAutoscalingRequest)
788
- @set_node_pool_autoscaling.call(req, options, &block)
789
- end
790
-
791
- # Sets the logging service for a specific cluster.
792
- #
793
- # @param logging_service [String]
794
- # Required. The logging service the cluster should use to write metrics.
795
- # Currently available options:
796
- #
797
- # * "logging.googleapis.com" - the Google Cloud Logging service
798
- # * "none" - no metrics will be exported from the cluster
799
- # @param project_id [String]
800
- # Deprecated. The Google Developers Console [project ID or project
801
- # number](https://support.google.com/cloud/answer/6158840).
802
- # This field has been deprecated and replaced by the name field.
803
- # @param zone [String]
804
- # Deprecated. The name of the Google Compute Engine
805
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
806
- # resides.
807
- # This field has been deprecated and replaced by the name field.
808
- # @param cluster_id [String]
809
- # Deprecated. The name of the cluster to upgrade.
810
- # This field has been deprecated and replaced by the name field.
811
- # @param name [String]
812
- # The name (project, location, cluster) of the cluster to set logging.
813
- # Specified in the format `projects/*/locations/*/clusters/*`.
814
- # @param options [Google::Gax::CallOptions]
815
- # Overrides the default settings for this call, e.g, timeout,
816
- # retries, etc.
817
- # @yield [result, operation] Access the result along with the RPC operation
818
- # @yieldparam result [Google::Container::V1::Operation]
819
- # @yieldparam operation [GRPC::ActiveCall::Operation]
820
- # @return [Google::Container::V1::Operation]
821
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
822
- # @example
823
- # require "google/cloud/container"
824
- #
825
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
826
- #
827
- # # TODO: Initialize `logging_service`:
828
- # logging_service = ''
829
- # response = cluster_manager_client.set_logging_service(logging_service)
830
-
831
- def set_logging_service \
832
- logging_service,
833
- project_id: nil,
834
- zone: nil,
835
- cluster_id: nil,
836
- name: nil,
837
- options: nil,
838
- &block
839
- req = {
840
- logging_service: logging_service,
841
- project_id: project_id,
842
- zone: zone,
843
- cluster_id: cluster_id,
844
- name: name
845
- }.delete_if { |_, v| v.nil? }
846
- req = Google::Gax::to_proto(req, Google::Container::V1::SetLoggingServiceRequest)
847
- @set_logging_service.call(req, options, &block)
848
- end
849
-
850
- # Sets the monitoring service for a specific cluster.
851
- #
852
- # @param monitoring_service [String]
853
- # Required. The monitoring service the cluster should use to write metrics.
854
- # Currently available options:
855
- #
856
- # * "monitoring.googleapis.com/kubernetes" - the Google Cloud Monitoring
857
- # service with Kubernetes-native resource model
858
- # * "monitoring.googleapis.com" - the Google Cloud Monitoring service
859
- # * "none" - no metrics will be exported from the cluster
860
- # @param project_id [String]
861
- # Deprecated. The Google Developers Console [project ID or project
862
- # number](https://support.google.com/cloud/answer/6158840).
863
- # This field has been deprecated and replaced by the name field.
864
- # @param zone [String]
865
- # Deprecated. The name of the Google Compute Engine
866
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
867
- # resides.
868
- # This field has been deprecated and replaced by the name field.
869
- # @param cluster_id [String]
870
- # Deprecated. The name of the cluster to upgrade.
871
- # This field has been deprecated and replaced by the name field.
872
- # @param name [String]
873
- # The name (project, location, cluster) of the cluster to set monitoring.
874
- # Specified in the format `projects/*/locations/*/clusters/*`.
875
- # @param options [Google::Gax::CallOptions]
876
- # Overrides the default settings for this call, e.g, timeout,
877
- # retries, etc.
878
- # @yield [result, operation] Access the result along with the RPC operation
879
- # @yieldparam result [Google::Container::V1::Operation]
880
- # @yieldparam operation [GRPC::ActiveCall::Operation]
881
- # @return [Google::Container::V1::Operation]
882
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
883
- # @example
884
- # require "google/cloud/container"
885
- #
886
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
887
- #
888
- # # TODO: Initialize `monitoring_service`:
889
- # monitoring_service = ''
890
- # response = cluster_manager_client.set_monitoring_service(monitoring_service)
891
-
892
- def set_monitoring_service \
893
- monitoring_service,
894
- project_id: nil,
895
- zone: nil,
896
- cluster_id: nil,
897
- name: nil,
898
- options: nil,
899
- &block
900
- req = {
901
- monitoring_service: monitoring_service,
902
- project_id: project_id,
903
- zone: zone,
904
- cluster_id: cluster_id,
905
- name: name
906
- }.delete_if { |_, v| v.nil? }
907
- req = Google::Gax::to_proto(req, Google::Container::V1::SetMonitoringServiceRequest)
908
- @set_monitoring_service.call(req, options, &block)
909
- end
910
-
911
- # Sets the addons for a specific cluster.
912
- #
913
- # @param addons_config [Google::Container::V1::AddonsConfig | Hash]
914
- # Required. The desired configurations for the various addons available to run in the
915
- # cluster.
916
- # A hash of the same form as `Google::Container::V1::AddonsConfig`
917
- # can also be provided.
918
- # @param project_id [String]
919
- # Deprecated. The Google Developers Console [project ID or project
920
- # number](https://support.google.com/cloud/answer/6158840).
921
- # This field has been deprecated and replaced by the name field.
922
- # @param zone [String]
923
- # Deprecated. The name of the Google Compute Engine
924
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
925
- # resides.
926
- # This field has been deprecated and replaced by the name field.
927
- # @param cluster_id [String]
928
- # Deprecated. The name of the cluster to upgrade.
929
- # This field has been deprecated and replaced by the name field.
930
- # @param name [String]
931
- # The name (project, location, cluster) of the cluster to set addons.
932
- # Specified in the format `projects/*/locations/*/clusters/*`.
933
- # @param options [Google::Gax::CallOptions]
934
- # Overrides the default settings for this call, e.g, timeout,
935
- # retries, etc.
936
- # @yield [result, operation] Access the result along with the RPC operation
937
- # @yieldparam result [Google::Container::V1::Operation]
938
- # @yieldparam operation [GRPC::ActiveCall::Operation]
939
- # @return [Google::Container::V1::Operation]
940
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
941
- # @example
942
- # require "google/cloud/container"
943
- #
944
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
945
- #
946
- # # TODO: Initialize `addons_config`:
947
- # addons_config = {}
948
- # response = cluster_manager_client.set_addons_config(addons_config)
949
-
950
- def set_addons_config \
951
- addons_config,
952
- project_id: nil,
953
- zone: nil,
954
- cluster_id: nil,
955
- name: nil,
956
- options: nil,
957
- &block
958
- req = {
959
- addons_config: addons_config,
960
- project_id: project_id,
961
- zone: zone,
962
- cluster_id: cluster_id,
963
- name: name
964
- }.delete_if { |_, v| v.nil? }
965
- req = Google::Gax::to_proto(req, Google::Container::V1::SetAddonsConfigRequest)
966
- @set_addons_config.call(req, options, &block)
967
- end
968
-
969
- # Sets the locations for a specific cluster.
970
- #
971
- # @param locations [Array<String>]
972
- # Required. The desired list of Google Compute Engine
973
- # [zones](https://cloud.google.com/compute/docs/zones#available) in which the cluster's nodes
974
- # should be located. Changing the locations a cluster is in will result
975
- # in nodes being either created or removed from the cluster, depending on
976
- # whether locations are being added or removed.
977
- #
978
- # This list must always include the cluster's primary zone.
979
- # @param project_id [String]
980
- # Deprecated. The Google Developers Console [project ID or project
981
- # number](https://support.google.com/cloud/answer/6158840).
982
- # This field has been deprecated and replaced by the name field.
983
- # @param zone [String]
984
- # Deprecated. The name of the Google Compute Engine
985
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
986
- # resides.
987
- # This field has been deprecated and replaced by the name field.
988
- # @param cluster_id [String]
989
- # Deprecated. The name of the cluster to upgrade.
990
- # This field has been deprecated and replaced by the name field.
991
- # @param name [String]
992
- # The name (project, location, cluster) of the cluster to set locations.
993
- # Specified in the format `projects/*/locations/*/clusters/*`.
994
- # @param options [Google::Gax::CallOptions]
995
- # Overrides the default settings for this call, e.g, timeout,
996
- # retries, etc.
997
- # @yield [result, operation] Access the result along with the RPC operation
998
- # @yieldparam result [Google::Container::V1::Operation]
999
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1000
- # @return [Google::Container::V1::Operation]
1001
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1002
- # @example
1003
- # require "google/cloud/container"
1004
- #
1005
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
1006
- #
1007
- # # TODO: Initialize `locations`:
1008
- # locations = []
1009
- # response = cluster_manager_client.set_locations(locations)
1010
-
1011
- def set_locations \
1012
- locations,
1013
- project_id: nil,
1014
- zone: nil,
1015
- cluster_id: nil,
1016
- name: nil,
1017
- options: nil,
1018
- &block
1019
- req = {
1020
- locations: locations,
1021
- project_id: project_id,
1022
- zone: zone,
1023
- cluster_id: cluster_id,
1024
- name: name
1025
- }.delete_if { |_, v| v.nil? }
1026
- req = Google::Gax::to_proto(req, Google::Container::V1::SetLocationsRequest)
1027
- @set_locations.call(req, options, &block)
1028
- end
1029
-
1030
- # Updates the master for a specific cluster.
1031
- #
1032
- # @param master_version [String]
1033
- # Required. The Kubernetes version to change the master to.
1034
- #
1035
- # Users may specify either explicit versions offered by Kubernetes Engine or
1036
- # version aliases, which have the following behavior:
1037
- #
1038
- # * "latest": picks the highest valid Kubernetes version
1039
- # * "1.X": picks the highest valid patch+gke.N patch in the 1.X version
1040
- # * "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
1041
- # * "1.X.Y-gke.N": picks an explicit Kubernetes version
1042
- # * "-": picks the default Kubernetes version
1043
- # @param project_id [String]
1044
- # Deprecated. The Google Developers Console [project ID or project
1045
- # number](https://support.google.com/cloud/answer/6158840).
1046
- # This field has been deprecated and replaced by the name field.
1047
- # @param zone [String]
1048
- # Deprecated. The name of the Google Compute Engine
1049
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
1050
- # resides.
1051
- # This field has been deprecated and replaced by the name field.
1052
- # @param cluster_id [String]
1053
- # Deprecated. The name of the cluster to upgrade.
1054
- # This field has been deprecated and replaced by the name field.
1055
- # @param name [String]
1056
- # The name (project, location, cluster) of the cluster to update.
1057
- # Specified in the format `projects/*/locations/*/clusters/*`.
1058
- # @param options [Google::Gax::CallOptions]
1059
- # Overrides the default settings for this call, e.g, timeout,
1060
- # retries, etc.
1061
- # @yield [result, operation] Access the result along with the RPC operation
1062
- # @yieldparam result [Google::Container::V1::Operation]
1063
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1064
- # @return [Google::Container::V1::Operation]
1065
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1066
- # @example
1067
- # require "google/cloud/container"
1068
- #
1069
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
1070
- #
1071
- # # TODO: Initialize `master_version`:
1072
- # master_version = ''
1073
- # response = cluster_manager_client.update_master(master_version)
1074
-
1075
- def update_master \
1076
- master_version,
1077
- project_id: nil,
1078
- zone: nil,
1079
- cluster_id: nil,
1080
- name: nil,
1081
- options: nil,
1082
- &block
1083
- req = {
1084
- master_version: master_version,
1085
- project_id: project_id,
1086
- zone: zone,
1087
- cluster_id: cluster_id,
1088
- name: name
1089
- }.delete_if { |_, v| v.nil? }
1090
- req = Google::Gax::to_proto(req, Google::Container::V1::UpdateMasterRequest)
1091
- @update_master.call(req, options, &block)
1092
- end
1093
-
1094
- # Sets master auth materials. Currently supports changing the admin password
1095
- # or a specific cluster, either via password generation or explicitly setting
1096
- # the password.
1097
- #
1098
- # @param action [Google::Container::V1::SetMasterAuthRequest::Action]
1099
- # Required. The exact form of action to be taken on the master auth.
1100
- # @param update [Google::Container::V1::MasterAuth | Hash]
1101
- # Required. A description of the update.
1102
- # A hash of the same form as `Google::Container::V1::MasterAuth`
1103
- # can also be provided.
1104
- # @param project_id [String]
1105
- # Deprecated. The Google Developers Console [project ID or project
1106
- # number](https://support.google.com/cloud/answer/6158840).
1107
- # This field has been deprecated and replaced by the name field.
1108
- # @param zone [String]
1109
- # Deprecated. The name of the Google Compute Engine
1110
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
1111
- # resides.
1112
- # This field has been deprecated and replaced by the name field.
1113
- # @param cluster_id [String]
1114
- # Deprecated. The name of the cluster to upgrade.
1115
- # This field has been deprecated and replaced by the name field.
1116
- # @param name [String]
1117
- # The name (project, location, cluster) of the cluster to set auth.
1118
- # Specified in the format `projects/*/locations/*/clusters/*`.
1119
- # @param options [Google::Gax::CallOptions]
1120
- # Overrides the default settings for this call, e.g, timeout,
1121
- # retries, etc.
1122
- # @yield [result, operation] Access the result along with the RPC operation
1123
- # @yieldparam result [Google::Container::V1::Operation]
1124
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1125
- # @return [Google::Container::V1::Operation]
1126
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1127
- # @example
1128
- # require "google/cloud/container"
1129
- #
1130
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
1131
- #
1132
- # # TODO: Initialize `action`:
1133
- # action = :UNKNOWN
1134
- #
1135
- # # TODO: Initialize `update`:
1136
- # update = {}
1137
- # response = cluster_manager_client.set_master_auth(action, update)
1138
-
1139
- def set_master_auth \
1140
- action,
1141
- update,
1142
- project_id: nil,
1143
- zone: nil,
1144
- cluster_id: nil,
1145
- name: nil,
1146
- options: nil,
1147
- &block
1148
- req = {
1149
- action: action,
1150
- update: update,
1151
- project_id: project_id,
1152
- zone: zone,
1153
- cluster_id: cluster_id,
1154
- name: name
1155
- }.delete_if { |_, v| v.nil? }
1156
- req = Google::Gax::to_proto(req, Google::Container::V1::SetMasterAuthRequest)
1157
- @set_master_auth.call(req, options, &block)
1158
- end
1159
-
1160
- # Deletes the cluster, including the Kubernetes endpoint and all worker
1161
- # nodes.
1162
- #
1163
- # Firewalls and routes that were configured during cluster creation
1164
- # are also deleted.
1165
- #
1166
- # Other Google Compute Engine resources that might be in use by the cluster,
1167
- # such as load balancer resources, are not deleted if they weren't present
1168
- # when the cluster was initially created.
1169
- #
1170
- # @param project_id [String]
1171
- # Deprecated. The Google Developers Console [project ID or project
1172
- # number](https://support.google.com/cloud/answer/6158840).
1173
- # This field has been deprecated and replaced by the name field.
1174
- # @param zone [String]
1175
- # Deprecated. The name of the Google Compute Engine
1176
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
1177
- # resides.
1178
- # This field has been deprecated and replaced by the name field.
1179
- # @param cluster_id [String]
1180
- # Deprecated. The name of the cluster to delete.
1181
- # This field has been deprecated and replaced by the name field.
1182
- # @param name [String]
1183
- # The name (project, location, cluster) of the cluster to delete.
1184
- # Specified in the format `projects/*/locations/*/clusters/*`.
1185
- # @param options [Google::Gax::CallOptions]
1186
- # Overrides the default settings for this call, e.g, timeout,
1187
- # retries, etc.
1188
- # @yield [result, operation] Access the result along with the RPC operation
1189
- # @yieldparam result [Google::Container::V1::Operation]
1190
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1191
- # @return [Google::Container::V1::Operation]
1192
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1193
- # @example
1194
- # require "google/cloud/container"
1195
- #
1196
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
1197
- # response = cluster_manager_client.delete_cluster
1198
-
1199
- def delete_cluster \
1200
- project_id: nil,
1201
- zone: nil,
1202
- cluster_id: nil,
1203
- name: nil,
1204
- options: nil,
1205
- &block
1206
- req = {
1207
- project_id: project_id,
1208
- zone: zone,
1209
- cluster_id: cluster_id,
1210
- name: name
1211
- }.delete_if { |_, v| v.nil? }
1212
- req = Google::Gax::to_proto(req, Google::Container::V1::DeleteClusterRequest)
1213
- @delete_cluster.call(req, options, &block)
1214
- end
1215
-
1216
- # Lists all operations in a project in a specific zone or all zones.
1217
- #
1218
- # @param project_id [String]
1219
- # Deprecated. The Google Developers Console [project ID or project
1220
- # number](https://support.google.com/cloud/answer/6158840).
1221
- # This field has been deprecated and replaced by the parent field.
1222
- # @param zone [String]
1223
- # Deprecated. The name of the Google Compute Engine
1224
- # [zone](https://cloud.google.com/compute/docs/zones#available) to return operations for, or `-` for
1225
- # all zones. This field has been deprecated and replaced by the parent field.
1226
- # @param parent [String]
1227
- # The parent (project and location) where the operations will be listed.
1228
- # Specified in the format `projects/*/locations/*`.
1229
- # Location "-" matches all zones and all regions.
1230
- # @param options [Google::Gax::CallOptions]
1231
- # Overrides the default settings for this call, e.g, timeout,
1232
- # retries, etc.
1233
- # @yield [result, operation] Access the result along with the RPC operation
1234
- # @yieldparam result [Google::Container::V1::ListOperationsResponse]
1235
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1236
- # @return [Google::Container::V1::ListOperationsResponse]
1237
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1238
- # @example
1239
- # require "google/cloud/container"
1240
- #
1241
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
1242
- # response = cluster_manager_client.list_operations
1243
-
1244
- def list_operations \
1245
- project_id: nil,
1246
- zone: nil,
1247
- parent: nil,
1248
- options: nil,
1249
- &block
1250
- req = {
1251
- project_id: project_id,
1252
- zone: zone,
1253
- parent: parent
1254
- }.delete_if { |_, v| v.nil? }
1255
- req = Google::Gax::to_proto(req, Google::Container::V1::ListOperationsRequest)
1256
- @list_operations.call(req, options, &block)
1257
- end
1258
-
1259
- # Gets the specified operation.
1260
- #
1261
- # @param project_id [String]
1262
- # Deprecated. The Google Developers Console [project ID or project
1263
- # number](https://support.google.com/cloud/answer/6158840).
1264
- # This field has been deprecated and replaced by the name field.
1265
- # @param zone [String]
1266
- # Deprecated. The name of the Google Compute Engine
1267
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
1268
- # resides.
1269
- # This field has been deprecated and replaced by the name field.
1270
- # @param operation_id [String]
1271
- # Deprecated. The server-assigned `name` of the operation.
1272
- # This field has been deprecated and replaced by the name field.
1273
- # @param name [String]
1274
- # The name (project, location, operation id) of the operation to get.
1275
- # Specified in the format `projects/*/locations/*/operations/*`.
1276
- # @param options [Google::Gax::CallOptions]
1277
- # Overrides the default settings for this call, e.g, timeout,
1278
- # retries, etc.
1279
- # @yield [result, operation] Access the result along with the RPC operation
1280
- # @yieldparam result [Google::Container::V1::Operation]
1281
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1282
- # @return [Google::Container::V1::Operation]
1283
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1284
- # @example
1285
- # require "google/cloud/container"
1286
- #
1287
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
1288
- # response = cluster_manager_client.get_operation
1289
-
1290
- def get_operation \
1291
- project_id: nil,
1292
- zone: nil,
1293
- operation_id: nil,
1294
- name: nil,
1295
- options: nil,
1296
- &block
1297
- req = {
1298
- project_id: project_id,
1299
- zone: zone,
1300
- operation_id: operation_id,
1301
- name: name
1302
- }.delete_if { |_, v| v.nil? }
1303
- req = Google::Gax::to_proto(req, Google::Container::V1::GetOperationRequest)
1304
- @get_operation.call(req, options, &block)
1305
- end
1306
-
1307
- # Cancels the specified operation.
1308
- #
1309
- # @param project_id [String]
1310
- # Deprecated. The Google Developers Console [project ID or project
1311
- # number](https://support.google.com/cloud/answer/6158840).
1312
- # This field has been deprecated and replaced by the name field.
1313
- # @param zone [String]
1314
- # Deprecated. The name of the Google Compute Engine
1315
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the operation resides.
1316
- # This field has been deprecated and replaced by the name field.
1317
- # @param operation_id [String]
1318
- # Deprecated. The server-assigned `name` of the operation.
1319
- # This field has been deprecated and replaced by the name field.
1320
- # @param name [String]
1321
- # The name (project, location, operation id) of the operation to cancel.
1322
- # Specified in the format `projects/*/locations/*/operations/*`.
1323
- # @param options [Google::Gax::CallOptions]
1324
- # Overrides the default settings for this call, e.g, timeout,
1325
- # retries, etc.
1326
- # @yield [result, operation] Access the result along with the RPC operation
1327
- # @yieldparam result []
1328
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1329
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1330
- # @example
1331
- # require "google/cloud/container"
1332
- #
1333
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
1334
- # cluster_manager_client.cancel_operation
1335
-
1336
- def cancel_operation \
1337
- project_id: nil,
1338
- zone: nil,
1339
- operation_id: nil,
1340
- name: nil,
1341
- options: nil,
1342
- &block
1343
- req = {
1344
- project_id: project_id,
1345
- zone: zone,
1346
- operation_id: operation_id,
1347
- name: name
1348
- }.delete_if { |_, v| v.nil? }
1349
- req = Google::Gax::to_proto(req, Google::Container::V1::CancelOperationRequest)
1350
- @cancel_operation.call(req, options, &block)
1351
- nil
1352
- end
1353
-
1354
- # Returns configuration info about the Google Kubernetes Engine service.
1355
- #
1356
- # @param project_id [String]
1357
- # Deprecated. The Google Developers Console [project ID or project
1358
- # number](https://support.google.com/cloud/answer/6158840).
1359
- # This field has been deprecated and replaced by the name field.
1360
- # @param zone [String]
1361
- # Deprecated. The name of the Google Compute Engine
1362
- # [zone](https://cloud.google.com/compute/docs/zones#available) to return operations for.
1363
- # This field has been deprecated and replaced by the name field.
1364
- # @param name [String]
1365
- # The name (project and location) of the server config to get,
1366
- # specified in the format `projects/*/locations/*`.
1367
- # @param options [Google::Gax::CallOptions]
1368
- # Overrides the default settings for this call, e.g, timeout,
1369
- # retries, etc.
1370
- # @yield [result, operation] Access the result along with the RPC operation
1371
- # @yieldparam result [Google::Container::V1::ServerConfig]
1372
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1373
- # @return [Google::Container::V1::ServerConfig]
1374
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1375
- # @example
1376
- # require "google/cloud/container"
1377
- #
1378
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
1379
- # response = cluster_manager_client.get_server_config
1380
-
1381
- def get_server_config \
1382
- project_id: nil,
1383
- zone: nil,
1384
- name: nil,
1385
- options: nil,
1386
- &block
1387
- req = {
1388
- project_id: project_id,
1389
- zone: zone,
1390
- name: name
1391
- }.delete_if { |_, v| v.nil? }
1392
- req = Google::Gax::to_proto(req, Google::Container::V1::GetServerConfigRequest)
1393
- @get_server_config.call(req, options, &block)
1394
- end
1395
-
1396
- # Lists the node pools for a cluster.
1397
- #
1398
- # @param project_id [String]
1399
- # Deprecated. The Google Developers Console [project ID or project
1400
- # number](https://developers.google.com/console/help/new/#projectnumber).
1401
- # This field has been deprecated and replaced by the parent field.
1402
- # @param zone [String]
1403
- # Deprecated. The name of the Google Compute Engine
1404
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
1405
- # resides.
1406
- # This field has been deprecated and replaced by the parent field.
1407
- # @param cluster_id [String]
1408
- # Deprecated. The name of the cluster.
1409
- # This field has been deprecated and replaced by the parent field.
1410
- # @param parent [String]
1411
- # The parent (project, location, cluster id) where the node pools will be
1412
- # listed. Specified in the format `projects/*/locations/*/clusters/*`.
1413
- # @param options [Google::Gax::CallOptions]
1414
- # Overrides the default settings for this call, e.g, timeout,
1415
- # retries, etc.
1416
- # @yield [result, operation] Access the result along with the RPC operation
1417
- # @yieldparam result [Google::Container::V1::ListNodePoolsResponse]
1418
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1419
- # @return [Google::Container::V1::ListNodePoolsResponse]
1420
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1421
- # @example
1422
- # require "google/cloud/container"
1423
- #
1424
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
1425
- # response = cluster_manager_client.list_node_pools
1426
-
1427
- def list_node_pools \
1428
- project_id: nil,
1429
- zone: nil,
1430
- cluster_id: nil,
1431
- parent: nil,
1432
- options: nil,
1433
- &block
1434
- req = {
1435
- project_id: project_id,
1436
- zone: zone,
1437
- cluster_id: cluster_id,
1438
- parent: parent
1439
- }.delete_if { |_, v| v.nil? }
1440
- req = Google::Gax::to_proto(req, Google::Container::V1::ListNodePoolsRequest)
1441
- @list_node_pools.call(req, options, &block)
1442
- end
1443
-
1444
- # Retrieves the requested node pool.
1445
- #
1446
- # @param project_id [String]
1447
- # Deprecated. The Google Developers Console [project ID or project
1448
- # number](https://developers.google.com/console/help/new/#projectnumber).
1449
- # This field has been deprecated and replaced by the name field.
1450
- # @param zone [String]
1451
- # Deprecated. The name of the Google Compute Engine
1452
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
1453
- # resides.
1454
- # This field has been deprecated and replaced by the name field.
1455
- # @param cluster_id [String]
1456
- # Deprecated. The name of the cluster.
1457
- # This field has been deprecated and replaced by the name field.
1458
- # @param node_pool_id [String]
1459
- # Deprecated. The name of the node pool.
1460
- # This field has been deprecated and replaced by the name field.
1461
- # @param name [String]
1462
- # The name (project, location, cluster, node pool id) of the node pool to
1463
- # get. Specified in the format
1464
- # `projects/*/locations/*/clusters/*/nodePools/*`.
1465
- # @param options [Google::Gax::CallOptions]
1466
- # Overrides the default settings for this call, e.g, timeout,
1467
- # retries, etc.
1468
- # @yield [result, operation] Access the result along with the RPC operation
1469
- # @yieldparam result [Google::Container::V1::NodePool]
1470
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1471
- # @return [Google::Container::V1::NodePool]
1472
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1473
- # @example
1474
- # require "google/cloud/container"
1475
- #
1476
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
1477
- # response = cluster_manager_client.get_node_pool
1478
-
1479
- def get_node_pool \
1480
- project_id: nil,
1481
- zone: nil,
1482
- cluster_id: nil,
1483
- node_pool_id: nil,
1484
- name: nil,
1485
- options: nil,
1486
- &block
1487
- req = {
1488
- project_id: project_id,
1489
- zone: zone,
1490
- cluster_id: cluster_id,
1491
- node_pool_id: node_pool_id,
1492
- name: name
1493
- }.delete_if { |_, v| v.nil? }
1494
- req = Google::Gax::to_proto(req, Google::Container::V1::GetNodePoolRequest)
1495
- @get_node_pool.call(req, options, &block)
1496
- end
1497
-
1498
- # Creates a node pool for a cluster.
1499
- #
1500
- # @param node_pool [Google::Container::V1::NodePool | Hash]
1501
- # Required. The node pool to create.
1502
- # A hash of the same form as `Google::Container::V1::NodePool`
1503
- # can also be provided.
1504
- # @param project_id [String]
1505
- # Deprecated. The Google Developers Console [project ID or project
1506
- # number](https://developers.google.com/console/help/new/#projectnumber).
1507
- # This field has been deprecated and replaced by the parent field.
1508
- # @param zone [String]
1509
- # Deprecated. The name of the Google Compute Engine
1510
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
1511
- # resides.
1512
- # This field has been deprecated and replaced by the parent field.
1513
- # @param cluster_id [String]
1514
- # Deprecated. The name of the cluster.
1515
- # This field has been deprecated and replaced by the parent field.
1516
- # @param parent [String]
1517
- # The parent (project, location, cluster id) where the node pool will be
1518
- # created. Specified in the format
1519
- # `projects/*/locations/*/clusters/*`.
1520
- # @param options [Google::Gax::CallOptions]
1521
- # Overrides the default settings for this call, e.g, timeout,
1522
- # retries, etc.
1523
- # @yield [result, operation] Access the result along with the RPC operation
1524
- # @yieldparam result [Google::Container::V1::Operation]
1525
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1526
- # @return [Google::Container::V1::Operation]
1527
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1528
- # @example
1529
- # require "google/cloud/container"
1530
- #
1531
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
1532
- #
1533
- # # TODO: Initialize `node_pool`:
1534
- # node_pool = {}
1535
- # response = cluster_manager_client.create_node_pool(node_pool)
1536
-
1537
- def create_node_pool \
1538
- node_pool,
1539
- project_id: nil,
1540
- zone: nil,
1541
- cluster_id: nil,
1542
- parent: nil,
1543
- options: nil,
1544
- &block
1545
- req = {
1546
- node_pool: node_pool,
1547
- project_id: project_id,
1548
- zone: zone,
1549
- cluster_id: cluster_id,
1550
- parent: parent
1551
- }.delete_if { |_, v| v.nil? }
1552
- req = Google::Gax::to_proto(req, Google::Container::V1::CreateNodePoolRequest)
1553
- @create_node_pool.call(req, options, &block)
1554
- end
1555
-
1556
- # Deletes a node pool from a cluster.
1557
- #
1558
- # @param project_id [String]
1559
- # Deprecated. The Google Developers Console [project ID or project
1560
- # number](https://developers.google.com/console/help/new/#projectnumber).
1561
- # This field has been deprecated and replaced by the name field.
1562
- # @param zone [String]
1563
- # Deprecated. The name of the Google Compute Engine
1564
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
1565
- # resides.
1566
- # This field has been deprecated and replaced by the name field.
1567
- # @param cluster_id [String]
1568
- # Deprecated. The name of the cluster.
1569
- # This field has been deprecated and replaced by the name field.
1570
- # @param node_pool_id [String]
1571
- # Deprecated. The name of the node pool to delete.
1572
- # This field has been deprecated and replaced by the name field.
1573
- # @param name [String]
1574
- # The name (project, location, cluster, node pool id) of the node pool to
1575
- # delete. Specified in the format
1576
- # `projects/*/locations/*/clusters/*/nodePools/*`.
1577
- # @param options [Google::Gax::CallOptions]
1578
- # Overrides the default settings for this call, e.g, timeout,
1579
- # retries, etc.
1580
- # @yield [result, operation] Access the result along with the RPC operation
1581
- # @yieldparam result [Google::Container::V1::Operation]
1582
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1583
- # @return [Google::Container::V1::Operation]
1584
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1585
- # @example
1586
- # require "google/cloud/container"
1587
- #
1588
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
1589
- # response = cluster_manager_client.delete_node_pool
1590
-
1591
- def delete_node_pool \
1592
- project_id: nil,
1593
- zone: nil,
1594
- cluster_id: nil,
1595
- node_pool_id: nil,
1596
- name: nil,
1597
- options: nil,
1598
- &block
1599
- req = {
1600
- project_id: project_id,
1601
- zone: zone,
1602
- cluster_id: cluster_id,
1603
- node_pool_id: node_pool_id,
1604
- name: name
1605
- }.delete_if { |_, v| v.nil? }
1606
- req = Google::Gax::to_proto(req, Google::Container::V1::DeleteNodePoolRequest)
1607
- @delete_node_pool.call(req, options, &block)
1608
- end
1609
-
1610
- # Rolls back a previously Aborted or Failed NodePool upgrade.
1611
- # This makes no changes if the last upgrade successfully completed.
1612
- #
1613
- # @param project_id [String]
1614
- # Deprecated. The Google Developers Console [project ID or project
1615
- # number](https://support.google.com/cloud/answer/6158840).
1616
- # This field has been deprecated and replaced by the name field.
1617
- # @param zone [String]
1618
- # Deprecated. The name of the Google Compute Engine
1619
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
1620
- # resides.
1621
- # This field has been deprecated and replaced by the name field.
1622
- # @param cluster_id [String]
1623
- # Deprecated. The name of the cluster to rollback.
1624
- # This field has been deprecated and replaced by the name field.
1625
- # @param node_pool_id [String]
1626
- # Deprecated. The name of the node pool to rollback.
1627
- # This field has been deprecated and replaced by the name field.
1628
- # @param name [String]
1629
- # The name (project, location, cluster, node pool id) of the node poll to
1630
- # rollback upgrade.
1631
- # Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`.
1632
- # @param options [Google::Gax::CallOptions]
1633
- # Overrides the default settings for this call, e.g, timeout,
1634
- # retries, etc.
1635
- # @yield [result, operation] Access the result along with the RPC operation
1636
- # @yieldparam result [Google::Container::V1::Operation]
1637
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1638
- # @return [Google::Container::V1::Operation]
1639
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1640
- # @example
1641
- # require "google/cloud/container"
1642
- #
1643
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
1644
- # response = cluster_manager_client.rollback_node_pool_upgrade
1645
-
1646
- def rollback_node_pool_upgrade \
1647
- project_id: nil,
1648
- zone: nil,
1649
- cluster_id: nil,
1650
- node_pool_id: nil,
1651
- name: nil,
1652
- options: nil,
1653
- &block
1654
- req = {
1655
- project_id: project_id,
1656
- zone: zone,
1657
- cluster_id: cluster_id,
1658
- node_pool_id: node_pool_id,
1659
- name: name
1660
- }.delete_if { |_, v| v.nil? }
1661
- req = Google::Gax::to_proto(req, Google::Container::V1::RollbackNodePoolUpgradeRequest)
1662
- @rollback_node_pool_upgrade.call(req, options, &block)
1663
- end
1664
-
1665
- # Sets the NodeManagement options for a node pool.
1666
- #
1667
- # @param management [Google::Container::V1::NodeManagement | Hash]
1668
- # Required. NodeManagement configuration for the node pool.
1669
- # A hash of the same form as `Google::Container::V1::NodeManagement`
1670
- # can also be provided.
1671
- # @param project_id [String]
1672
- # Deprecated. The Google Developers Console [project ID or project
1673
- # number](https://support.google.com/cloud/answer/6158840).
1674
- # This field has been deprecated and replaced by the name field.
1675
- # @param zone [String]
1676
- # Deprecated. The name of the Google Compute Engine
1677
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
1678
- # resides.
1679
- # This field has been deprecated and replaced by the name field.
1680
- # @param cluster_id [String]
1681
- # Deprecated. The name of the cluster to update.
1682
- # This field has been deprecated and replaced by the name field.
1683
- # @param node_pool_id [String]
1684
- # Deprecated. The name of the node pool to update.
1685
- # This field has been deprecated and replaced by the name field.
1686
- # @param name [String]
1687
- # The name (project, location, cluster, node pool id) of the node pool to set
1688
- # management properties. Specified in the format
1689
- # `projects/*/locations/*/clusters/*/nodePools/*`.
1690
- # @param options [Google::Gax::CallOptions]
1691
- # Overrides the default settings for this call, e.g, timeout,
1692
- # retries, etc.
1693
- # @yield [result, operation] Access the result along with the RPC operation
1694
- # @yieldparam result [Google::Container::V1::Operation]
1695
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1696
- # @return [Google::Container::V1::Operation]
1697
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1698
- # @example
1699
- # require "google/cloud/container"
1700
- #
1701
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
1702
- #
1703
- # # TODO: Initialize `management`:
1704
- # management = {}
1705
- # response = cluster_manager_client.set_node_pool_management(management)
1706
-
1707
- def set_node_pool_management \
1708
- management,
1709
- project_id: nil,
1710
- zone: nil,
1711
- cluster_id: nil,
1712
- node_pool_id: nil,
1713
- name: nil,
1714
- options: nil,
1715
- &block
1716
- req = {
1717
- management: management,
1718
- project_id: project_id,
1719
- zone: zone,
1720
- cluster_id: cluster_id,
1721
- node_pool_id: node_pool_id,
1722
- name: name
1723
- }.delete_if { |_, v| v.nil? }
1724
- req = Google::Gax::to_proto(req, Google::Container::V1::SetNodePoolManagementRequest)
1725
- @set_node_pool_management.call(req, options, &block)
1726
- end
1727
-
1728
- # Sets labels on a cluster.
1729
- #
1730
- # @param resource_labels [Hash{String => String}]
1731
- # Required. The labels to set for that cluster.
1732
- # @param label_fingerprint [String]
1733
- # Required. The fingerprint of the previous set of labels for this resource,
1734
- # used to detect conflicts. The fingerprint is initially generated by
1735
- # Kubernetes Engine and changes after every request to modify or update
1736
- # labels. You must always provide an up-to-date fingerprint hash when
1737
- # updating or changing labels. Make a <code>get()</code> request to the
1738
- # resource to get the latest fingerprint.
1739
- # @param project_id [String]
1740
- # Deprecated. The Google Developers Console [project ID or project
1741
- # number](https://developers.google.com/console/help/new/#projectnumber).
1742
- # This field has been deprecated and replaced by the name field.
1743
- # @param zone [String]
1744
- # Deprecated. The name of the Google Compute Engine
1745
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
1746
- # resides.
1747
- # This field has been deprecated and replaced by the name field.
1748
- # @param cluster_id [String]
1749
- # Deprecated. The name of the cluster.
1750
- # This field has been deprecated and replaced by the name field.
1751
- # @param name [String]
1752
- # The name (project, location, cluster id) of the cluster to set labels.
1753
- # Specified in the format `projects/*/locations/*/clusters/*`.
1754
- # @param options [Google::Gax::CallOptions]
1755
- # Overrides the default settings for this call, e.g, timeout,
1756
- # retries, etc.
1757
- # @yield [result, operation] Access the result along with the RPC operation
1758
- # @yieldparam result [Google::Container::V1::Operation]
1759
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1760
- # @return [Google::Container::V1::Operation]
1761
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1762
- # @example
1763
- # require "google/cloud/container"
1764
- #
1765
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
1766
- #
1767
- # # TODO: Initialize `resource_labels`:
1768
- # resource_labels = {}
1769
- #
1770
- # # TODO: Initialize `label_fingerprint`:
1771
- # label_fingerprint = ''
1772
- # response = cluster_manager_client.set_labels(resource_labels, label_fingerprint)
1773
-
1774
- def set_labels \
1775
- resource_labels,
1776
- label_fingerprint,
1777
- project_id: nil,
1778
- zone: nil,
1779
- cluster_id: nil,
1780
- name: nil,
1781
- options: nil,
1782
- &block
1783
- req = {
1784
- resource_labels: resource_labels,
1785
- label_fingerprint: label_fingerprint,
1786
- project_id: project_id,
1787
- zone: zone,
1788
- cluster_id: cluster_id,
1789
- name: name
1790
- }.delete_if { |_, v| v.nil? }
1791
- req = Google::Gax::to_proto(req, Google::Container::V1::SetLabelsRequest)
1792
- @set_labels.call(req, options, &block)
1793
- end
1794
-
1795
- # Enables or disables the ABAC authorization mechanism on a cluster.
1796
- #
1797
- # @param enabled [true, false]
1798
- # Required. Whether ABAC authorization will be enabled in the cluster.
1799
- # @param project_id [String]
1800
- # Deprecated. The Google Developers Console [project ID or project
1801
- # number](https://support.google.com/cloud/answer/6158840).
1802
- # This field has been deprecated and replaced by the name field.
1803
- # @param zone [String]
1804
- # Deprecated. The name of the Google Compute Engine
1805
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
1806
- # resides.
1807
- # This field has been deprecated and replaced by the name field.
1808
- # @param cluster_id [String]
1809
- # Deprecated. The name of the cluster to update.
1810
- # This field has been deprecated and replaced by the name field.
1811
- # @param name [String]
1812
- # The name (project, location, cluster id) of the cluster to set legacy abac.
1813
- # Specified in the format `projects/*/locations/*/clusters/*`.
1814
- # @param options [Google::Gax::CallOptions]
1815
- # Overrides the default settings for this call, e.g, timeout,
1816
- # retries, etc.
1817
- # @yield [result, operation] Access the result along with the RPC operation
1818
- # @yieldparam result [Google::Container::V1::Operation]
1819
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1820
- # @return [Google::Container::V1::Operation]
1821
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1822
- # @example
1823
- # require "google/cloud/container"
1824
- #
1825
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
1826
- #
1827
- # # TODO: Initialize `enabled`:
1828
- # enabled = false
1829
- # response = cluster_manager_client.set_legacy_abac(enabled)
1830
-
1831
- def set_legacy_abac \
1832
- enabled,
1833
- project_id: nil,
1834
- zone: nil,
1835
- cluster_id: nil,
1836
- name: nil,
1837
- options: nil,
1838
- &block
1839
- req = {
1840
- enabled: enabled,
1841
- project_id: project_id,
1842
- zone: zone,
1843
- cluster_id: cluster_id,
1844
- name: name
1845
- }.delete_if { |_, v| v.nil? }
1846
- req = Google::Gax::to_proto(req, Google::Container::V1::SetLegacyAbacRequest)
1847
- @set_legacy_abac.call(req, options, &block)
1848
- end
1849
-
1850
- # Starts master IP rotation.
1851
- #
1852
- # @param project_id [String]
1853
- # Deprecated. The Google Developers Console [project ID or project
1854
- # number](https://developers.google.com/console/help/new/#projectnumber).
1855
- # This field has been deprecated and replaced by the name field.
1856
- # @param zone [String]
1857
- # Deprecated. The name of the Google Compute Engine
1858
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
1859
- # resides.
1860
- # This field has been deprecated and replaced by the name field.
1861
- # @param cluster_id [String]
1862
- # Deprecated. The name of the cluster.
1863
- # This field has been deprecated and replaced by the name field.
1864
- # @param name [String]
1865
- # The name (project, location, cluster id) of the cluster to start IP
1866
- # rotation. Specified in the format `projects/*/locations/*/clusters/*`.
1867
- # @param rotate_credentials [true, false]
1868
- # Whether to rotate credentials during IP rotation.
1869
- # @param options [Google::Gax::CallOptions]
1870
- # Overrides the default settings for this call, e.g, timeout,
1871
- # retries, etc.
1872
- # @yield [result, operation] Access the result along with the RPC operation
1873
- # @yieldparam result [Google::Container::V1::Operation]
1874
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1875
- # @return [Google::Container::V1::Operation]
1876
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1877
- # @example
1878
- # require "google/cloud/container"
1879
- #
1880
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
1881
- # response = cluster_manager_client.start_ip_rotation
1882
-
1883
- def start_ip_rotation \
1884
- project_id: nil,
1885
- zone: nil,
1886
- cluster_id: nil,
1887
- name: nil,
1888
- rotate_credentials: nil,
1889
- options: nil,
1890
- &block
1891
- req = {
1892
- project_id: project_id,
1893
- zone: zone,
1894
- cluster_id: cluster_id,
1895
- name: name,
1896
- rotate_credentials: rotate_credentials
1897
- }.delete_if { |_, v| v.nil? }
1898
- req = Google::Gax::to_proto(req, Google::Container::V1::StartIPRotationRequest)
1899
- @start_ip_rotation.call(req, options, &block)
1900
- end
1901
-
1902
- # Completes master IP rotation.
1903
- #
1904
- # @param project_id [String]
1905
- # Deprecated. The Google Developers Console [project ID or project
1906
- # number](https://developers.google.com/console/help/new/#projectnumber).
1907
- # This field has been deprecated and replaced by the name field.
1908
- # @param zone [String]
1909
- # Deprecated. The name of the Google Compute Engine
1910
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
1911
- # resides.
1912
- # This field has been deprecated and replaced by the name field.
1913
- # @param cluster_id [String]
1914
- # Deprecated. The name of the cluster.
1915
- # This field has been deprecated and replaced by the name field.
1916
- # @param name [String]
1917
- # The name (project, location, cluster id) of the cluster to complete IP
1918
- # rotation. Specified in the format `projects/*/locations/*/clusters/*`.
1919
- # @param options [Google::Gax::CallOptions]
1920
- # Overrides the default settings for this call, e.g, timeout,
1921
- # retries, etc.
1922
- # @yield [result, operation] Access the result along with the RPC operation
1923
- # @yieldparam result [Google::Container::V1::Operation]
1924
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1925
- # @return [Google::Container::V1::Operation]
1926
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1927
- # @example
1928
- # require "google/cloud/container"
1929
- #
1930
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
1931
- # response = cluster_manager_client.complete_ip_rotation
1932
-
1933
- def complete_ip_rotation \
1934
- project_id: nil,
1935
- zone: nil,
1936
- cluster_id: nil,
1937
- name: nil,
1938
- options: nil,
1939
- &block
1940
- req = {
1941
- project_id: project_id,
1942
- zone: zone,
1943
- cluster_id: cluster_id,
1944
- name: name
1945
- }.delete_if { |_, v| v.nil? }
1946
- req = Google::Gax::to_proto(req, Google::Container::V1::CompleteIPRotationRequest)
1947
- @complete_ip_rotation.call(req, options, &block)
1948
- end
1949
-
1950
- # Sets the size for a specific node pool.
1951
- #
1952
- # @param node_count [Integer]
1953
- # Required. The desired node count for the pool.
1954
- # @param project_id [String]
1955
- # Deprecated. The Google Developers Console [project ID or project
1956
- # number](https://support.google.com/cloud/answer/6158840).
1957
- # This field has been deprecated and replaced by the name field.
1958
- # @param zone [String]
1959
- # Deprecated. The name of the Google Compute Engine
1960
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
1961
- # resides.
1962
- # This field has been deprecated and replaced by the name field.
1963
- # @param cluster_id [String]
1964
- # Deprecated. The name of the cluster to update.
1965
- # This field has been deprecated and replaced by the name field.
1966
- # @param node_pool_id [String]
1967
- # Deprecated. The name of the node pool to update.
1968
- # This field has been deprecated and replaced by the name field.
1969
- # @param name [String]
1970
- # The name (project, location, cluster, node pool id) of the node pool to set
1971
- # size.
1972
- # Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`.
1973
- # @param options [Google::Gax::CallOptions]
1974
- # Overrides the default settings for this call, e.g, timeout,
1975
- # retries, etc.
1976
- # @yield [result, operation] Access the result along with the RPC operation
1977
- # @yieldparam result [Google::Container::V1::Operation]
1978
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1979
- # @return [Google::Container::V1::Operation]
1980
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1981
- # @example
1982
- # require "google/cloud/container"
1983
- #
1984
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
1985
- #
1986
- # # TODO: Initialize `node_count`:
1987
- # node_count = 0
1988
- # response = cluster_manager_client.set_node_pool_size(node_count)
1989
-
1990
- def set_node_pool_size \
1991
- node_count,
1992
- project_id: nil,
1993
- zone: nil,
1994
- cluster_id: nil,
1995
- node_pool_id: nil,
1996
- name: nil,
1997
- options: nil,
1998
- &block
1999
- req = {
2000
- node_count: node_count,
2001
- project_id: project_id,
2002
- zone: zone,
2003
- cluster_id: cluster_id,
2004
- node_pool_id: node_pool_id,
2005
- name: name
2006
- }.delete_if { |_, v| v.nil? }
2007
- req = Google::Gax::to_proto(req, Google::Container::V1::SetNodePoolSizeRequest)
2008
- @set_node_pool_size.call(req, options, &block)
2009
- end
2010
-
2011
- # Enables or disables Network Policy for a cluster.
2012
- #
2013
- # @param network_policy [Google::Container::V1::NetworkPolicy | Hash]
2014
- # Required. Configuration options for the NetworkPolicy feature.
2015
- # A hash of the same form as `Google::Container::V1::NetworkPolicy`
2016
- # can also be provided.
2017
- # @param project_id [String]
2018
- # Deprecated. The Google Developers Console [project ID or project
2019
- # number](https://developers.google.com/console/help/new/#projectnumber).
2020
- # This field has been deprecated and replaced by the name field.
2021
- # @param zone [String]
2022
- # Deprecated. The name of the Google Compute Engine
2023
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
2024
- # resides.
2025
- # This field has been deprecated and replaced by the name field.
2026
- # @param cluster_id [String]
2027
- # Deprecated. The name of the cluster.
2028
- # This field has been deprecated and replaced by the name field.
2029
- # @param name [String]
2030
- # The name (project, location, cluster id) of the cluster to set networking
2031
- # policy. Specified in the format `projects/*/locations/*/clusters/*`.
2032
- # @param options [Google::Gax::CallOptions]
2033
- # Overrides the default settings for this call, e.g, timeout,
2034
- # retries, etc.
2035
- # @yield [result, operation] Access the result along with the RPC operation
2036
- # @yieldparam result [Google::Container::V1::Operation]
2037
- # @yieldparam operation [GRPC::ActiveCall::Operation]
2038
- # @return [Google::Container::V1::Operation]
2039
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
2040
- # @example
2041
- # require "google/cloud/container"
2042
- #
2043
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
2044
- #
2045
- # # TODO: Initialize `network_policy`:
2046
- # network_policy = {}
2047
- # response = cluster_manager_client.set_network_policy(network_policy)
2048
-
2049
- def set_network_policy \
2050
- network_policy,
2051
- project_id: nil,
2052
- zone: nil,
2053
- cluster_id: nil,
2054
- name: nil,
2055
- options: nil,
2056
- &block
2057
- req = {
2058
- network_policy: network_policy,
2059
- project_id: project_id,
2060
- zone: zone,
2061
- cluster_id: cluster_id,
2062
- name: name
2063
- }.delete_if { |_, v| v.nil? }
2064
- req = Google::Gax::to_proto(req, Google::Container::V1::SetNetworkPolicyRequest)
2065
- @set_network_policy.call(req, options, &block)
2066
- end
2067
-
2068
- # Sets the maintenance policy for a cluster.
2069
- #
2070
- # @param project_id [String]
2071
- # Required. The Google Developers Console [project ID or project
2072
- # number](https://support.google.com/cloud/answer/6158840).
2073
- # @param zone [String]
2074
- # Required. The name of the Google Compute Engine
2075
- # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
2076
- # resides.
2077
- # @param cluster_id [String]
2078
- # Required. The name of the cluster to update.
2079
- # @param maintenance_policy [Google::Container::V1::MaintenancePolicy | Hash]
2080
- # Required. The maintenance policy to be set for the cluster. An empty field
2081
- # clears the existing maintenance policy.
2082
- # A hash of the same form as `Google::Container::V1::MaintenancePolicy`
2083
- # can also be provided.
2084
- # @param name [String]
2085
- # The name (project, location, cluster id) of the cluster to set maintenance
2086
- # policy.
2087
- # Specified in the format `projects/*/locations/*/clusters/*`.
2088
- # @param options [Google::Gax::CallOptions]
2089
- # Overrides the default settings for this call, e.g, timeout,
2090
- # retries, etc.
2091
- # @yield [result, operation] Access the result along with the RPC operation
2092
- # @yieldparam result [Google::Container::V1::Operation]
2093
- # @yieldparam operation [GRPC::ActiveCall::Operation]
2094
- # @return [Google::Container::V1::Operation]
2095
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
2096
- # @example
2097
- # require "google/cloud/container"
2098
- #
2099
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
2100
- #
2101
- # # TODO: Initialize `project_id`:
2102
- # project_id = ''
2103
- #
2104
- # # TODO: Initialize `zone`:
2105
- # zone = ''
2106
- #
2107
- # # TODO: Initialize `cluster_id`:
2108
- # cluster_id = ''
2109
- #
2110
- # # TODO: Initialize `maintenance_policy`:
2111
- # maintenance_policy = {}
2112
- # response = cluster_manager_client.set_maintenance_policy(project_id, zone, cluster_id, maintenance_policy)
2113
-
2114
- def set_maintenance_policy \
2115
- project_id,
2116
- zone,
2117
- cluster_id,
2118
- maintenance_policy,
2119
- name: nil,
2120
- options: nil,
2121
- &block
2122
- req = {
2123
- project_id: project_id,
2124
- zone: zone,
2125
- cluster_id: cluster_id,
2126
- maintenance_policy: maintenance_policy,
2127
- name: name
2128
- }.delete_if { |_, v| v.nil? }
2129
- req = Google::Gax::to_proto(req, Google::Container::V1::SetMaintenancePolicyRequest)
2130
- @set_maintenance_policy.call(req, options, &block)
2131
- end
2132
-
2133
- # Lists subnetworks that are usable for creating clusters in a project.
2134
- #
2135
- # @param parent [String]
2136
- # The parent project where subnetworks are usable.
2137
- # Specified in the format `projects/*`.
2138
- # @param filter [String]
2139
- # Filtering currently only supports equality on the networkProjectId and must
2140
- # be in the form: "networkProjectId=[PROJECTID]", where `networkProjectId`
2141
- # is the project which owns the listed subnetworks. This defaults to the
2142
- # parent project ID.
2143
- # @param page_size [Integer]
2144
- # The maximum number of resources contained in the underlying API
2145
- # response. If page streaming is performed per-resource, this
2146
- # parameter does not affect the return value. If page streaming is
2147
- # performed per-page, this determines the maximum number of
2148
- # resources in a page.
2149
- # @param options [Google::Gax::CallOptions]
2150
- # Overrides the default settings for this call, e.g, timeout,
2151
- # retries, etc.
2152
- # @yield [result, operation] Access the result along with the RPC operation
2153
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Container::V1::UsableSubnetwork>]
2154
- # @yieldparam operation [GRPC::ActiveCall::Operation]
2155
- # @return [Google::Gax::PagedEnumerable<Google::Container::V1::UsableSubnetwork>]
2156
- # An enumerable of Google::Container::V1::UsableSubnetwork instances.
2157
- # See Google::Gax::PagedEnumerable documentation for other
2158
- # operations such as per-page iteration or access to the response
2159
- # object.
2160
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
2161
- # @example
2162
- # require "google/cloud/container"
2163
- #
2164
- # cluster_manager_client = Google::Cloud::Container.new(version: :v1)
2165
- #
2166
- # # Iterate over all results.
2167
- # cluster_manager_client.list_usable_subnetworks.each do |element|
2168
- # # Process element.
2169
- # end
2170
- #
2171
- # # Or iterate over results one page at a time.
2172
- # cluster_manager_client.list_usable_subnetworks.each_page do |page|
2173
- # # Process each page at a time.
2174
- # page.each do |element|
2175
- # # Process element.
2176
- # end
2177
- # end
2178
-
2179
- def list_usable_subnetworks \
2180
- parent: nil,
2181
- filter: nil,
2182
- page_size: nil,
2183
- options: nil,
2184
- &block
2185
- req = {
2186
- parent: parent,
2187
- filter: filter,
2188
- page_size: page_size
2189
- }.delete_if { |_, v| v.nil? }
2190
- req = Google::Gax::to_proto(req, Google::Container::V1::ListUsableSubnetworksRequest)
2191
- @list_usable_subnetworks.call(req, options, &block)
2192
- end
2193
- end
2194
- end
2195
- end
2196
- end
2197
- end