google-cloud-container-v1 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ # This gem does not autoload during Bundler.require. To load this gem,
20
+ # issue explicit require statements for the packages desired, e.g.:
21
+ # require "google/cloud/container/v1"
@@ -0,0 +1,15 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/common_resources.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/resource_pb'
7
+ Google::Protobuf::DescriptorPool.generated_pool.build do
8
+ add_file("google/cloud/common_resources.proto", :syntax => :proto3) do
9
+ end
10
+ end
11
+
12
+ module Google
13
+ module Cloud
14
+ end
15
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/container/v1/cluster_manager"
20
+ require "google/cloud/container/v1/version"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Container
25
+ ##
26
+ # To load this package, including all its services, and instantiate a client:
27
+ #
28
+ # require "google/cloud/container/v1"
29
+ # client = Google::Cloud::Container::V1::ClusterManager::Client.new
30
+ #
31
+ module V1
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/container/v1/version"
24
+
25
+ require "google/cloud/container/v1/cluster_manager/credentials"
26
+ require "google/cloud/container/v1/cluster_manager/client"
27
+
28
+ module Google
29
+ module Cloud
30
+ module Container
31
+ module V1
32
+ ##
33
+ # Google Kubernetes Engine Cluster Manager v1
34
+ #
35
+ # To load this service and instantiate a client:
36
+ #
37
+ # require "google/cloud/container/v1/cluster_manager"
38
+ # client = Google::Cloud::Container::V1::ClusterManager::Client.new
39
+ #
40
+ module ClusterManager
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+
47
+ helper_path = ::File.join __dir__, "cluster_manager", "helpers.rb"
48
+ require "google/cloud/container/v1/cluster_manager/helpers" if ::File.file? helper_path
@@ -0,0 +1,3194 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/container/v1/cluster_service_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Container
25
+ module V1
26
+ module ClusterManager
27
+ ##
28
+ # Client for the ClusterManager service.
29
+ #
30
+ # Google Kubernetes Engine Cluster Manager v1
31
+ #
32
+ class Client
33
+ # @private
34
+ attr_reader :cluster_manager_stub
35
+
36
+ ##
37
+ # Configure the ClusterManager Client class.
38
+ #
39
+ # See {Google::Cloud::Container::V1::ClusterManager::Client::Configuration}
40
+ # for a description of the configuration fields.
41
+ #
42
+ # ## Example
43
+ #
44
+ # To modify the configuration for all ClusterManager clients:
45
+ #
46
+ # Google::Cloud::Container::V1::ClusterManager::Client.configure do |config|
47
+ # config.timeout = 10_000
48
+ # end
49
+ #
50
+ # @yield [config] Configure the Client client.
51
+ # @yieldparam config [Client::Configuration]
52
+ #
53
+ # @return [Client::Configuration]
54
+ #
55
+ def self.configure
56
+ @configure ||= begin
57
+ namespace = ["Google", "Cloud", "Container", "V1"]
58
+ parent_config = while namespace.any?
59
+ parent_name = namespace.join "::"
60
+ parent_const = const_get parent_name
61
+ break parent_const.configure if parent_const&.respond_to? :configure
62
+ namespace.pop
63
+ end
64
+ default_config = Client::Configuration.new parent_config
65
+
66
+ default_config.rpcs.list_clusters.timeout = 20.0
67
+ default_config.rpcs.list_clusters.retry_policy = {
68
+ initial_delay: 0.1,
69
+ max_delay: 60.0,
70
+ multiplier: 1.3,
71
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
72
+ }
73
+
74
+ default_config.rpcs.get_cluster.timeout = 20.0
75
+ default_config.rpcs.get_cluster.retry_policy = {
76
+ initial_delay: 0.1,
77
+ max_delay: 60.0,
78
+ multiplier: 1.3,
79
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
80
+ }
81
+
82
+ default_config.rpcs.create_cluster.timeout = 45.0
83
+
84
+ default_config.rpcs.update_cluster.timeout = 45.0
85
+
86
+ default_config.rpcs.update_node_pool.timeout = 45.0
87
+
88
+ default_config.rpcs.set_node_pool_autoscaling.timeout = 45.0
89
+
90
+ default_config.rpcs.set_logging_service.timeout = 45.0
91
+
92
+ default_config.rpcs.set_monitoring_service.timeout = 45.0
93
+
94
+ default_config.rpcs.set_addons_config.timeout = 45.0
95
+
96
+ default_config.rpcs.set_locations.timeout = 45.0
97
+
98
+ default_config.rpcs.update_master.timeout = 45.0
99
+
100
+ default_config.rpcs.set_master_auth.timeout = 45.0
101
+
102
+ default_config.rpcs.delete_cluster.timeout = 20.0
103
+ default_config.rpcs.delete_cluster.retry_policy = {
104
+ initial_delay: 0.1,
105
+ max_delay: 60.0,
106
+ multiplier: 1.3,
107
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
108
+ }
109
+
110
+ default_config.rpcs.list_operations.timeout = 20.0
111
+ default_config.rpcs.list_operations.retry_policy = {
112
+ initial_delay: 0.1,
113
+ max_delay: 60.0,
114
+ multiplier: 1.3,
115
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
116
+ }
117
+
118
+ default_config.rpcs.get_operation.timeout = 20.0
119
+ default_config.rpcs.get_operation.retry_policy = {
120
+ initial_delay: 0.1,
121
+ max_delay: 60.0,
122
+ multiplier: 1.3,
123
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
124
+ }
125
+
126
+ default_config.rpcs.cancel_operation.timeout = 45.0
127
+
128
+ default_config.rpcs.get_server_config.timeout = 20.0
129
+ default_config.rpcs.get_server_config.retry_policy = {
130
+ initial_delay: 0.1,
131
+ max_delay: 60.0,
132
+ multiplier: 1.3,
133
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
134
+ }
135
+
136
+ default_config.rpcs.list_node_pools.timeout = 20.0
137
+ default_config.rpcs.list_node_pools.retry_policy = {
138
+ initial_delay: 0.1,
139
+ max_delay: 60.0,
140
+ multiplier: 1.3,
141
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
142
+ }
143
+
144
+ default_config.rpcs.get_node_pool.timeout = 20.0
145
+ default_config.rpcs.get_node_pool.retry_policy = {
146
+ initial_delay: 0.1,
147
+ max_delay: 60.0,
148
+ multiplier: 1.3,
149
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
150
+ }
151
+
152
+ default_config.rpcs.create_node_pool.timeout = 45.0
153
+
154
+ default_config.rpcs.delete_node_pool.timeout = 20.0
155
+ default_config.rpcs.delete_node_pool.retry_policy = {
156
+ initial_delay: 0.1,
157
+ max_delay: 60.0,
158
+ multiplier: 1.3,
159
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
160
+ }
161
+
162
+ default_config.rpcs.rollback_node_pool_upgrade.timeout = 45.0
163
+
164
+ default_config.rpcs.set_node_pool_management.timeout = 45.0
165
+
166
+ default_config.rpcs.set_labels.timeout = 45.0
167
+
168
+ default_config.rpcs.set_legacy_abac.timeout = 45.0
169
+
170
+ default_config.rpcs.start_ip_rotation.timeout = 45.0
171
+
172
+ default_config.rpcs.complete_ip_rotation.timeout = 45.0
173
+
174
+ default_config.rpcs.set_node_pool_size.timeout = 45.0
175
+
176
+ default_config.rpcs.set_network_policy.timeout = 45.0
177
+
178
+ default_config.rpcs.set_maintenance_policy.timeout = 45.0
179
+
180
+ default_config
181
+ end
182
+ yield @configure if block_given?
183
+ @configure
184
+ end
185
+
186
+ ##
187
+ # Configure the ClusterManager Client instance.
188
+ #
189
+ # The configuration is set to the derived mode, meaning that values can be changed,
190
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
191
+ # should be made on {Client.configure}.
192
+ #
193
+ # See {Google::Cloud::Container::V1::ClusterManager::Client::Configuration}
194
+ # for a description of the configuration fields.
195
+ #
196
+ # @yield [config] Configure the Client client.
197
+ # @yieldparam config [Client::Configuration]
198
+ #
199
+ # @return [Client::Configuration]
200
+ #
201
+ def configure
202
+ yield @config if block_given?
203
+ @config
204
+ end
205
+
206
+ ##
207
+ # Create a new ClusterManager client object.
208
+ #
209
+ # ## Examples
210
+ #
211
+ # To create a new ClusterManager client with the default
212
+ # configuration:
213
+ #
214
+ # client = Google::Cloud::Container::V1::ClusterManager::Client.new
215
+ #
216
+ # To create a new ClusterManager client with a custom
217
+ # configuration:
218
+ #
219
+ # client = Google::Cloud::Container::V1::ClusterManager::Client.new do |config|
220
+ # config.timeout = 10_000
221
+ # end
222
+ #
223
+ # @yield [config] Configure the ClusterManager client.
224
+ # @yieldparam config [Client::Configuration]
225
+ #
226
+ def initialize
227
+ # These require statements are intentionally placed here to initialize
228
+ # the gRPC module only when it's required.
229
+ # See https://github.com/googleapis/toolkit/issues/446
230
+ require "gapic/grpc"
231
+ require "google/container/v1/cluster_service_services_pb"
232
+
233
+ # Create the configuration object
234
+ @config = Configuration.new Client.configure
235
+
236
+ # Yield the configuration if needed
237
+ yield @config if block_given?
238
+
239
+ # Create credentials
240
+ credentials = @config.credentials
241
+ credentials ||= Credentials.default scope: @config.scope
242
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
243
+ credentials = Credentials.new credentials, scope: @config.scope
244
+ end
245
+ @quota_project_id = credentials.respond_to?(:quota_project_id) ? credentials.quota_project_id : nil
246
+
247
+ @cluster_manager_stub = Gapic::ServiceStub.new(
248
+ Google::Cloud::Container::V1::ClusterManager::Stub,
249
+ credentials: credentials,
250
+ endpoint: @config.endpoint,
251
+ channel_args: @config.channel_args,
252
+ interceptors: @config.interceptors
253
+ )
254
+ end
255
+
256
+ # Service calls
257
+
258
+ ##
259
+ # Lists all clusters owned by a project in either the specified zone or all
260
+ # zones.
261
+ #
262
+ # @overload list_clusters(request, options = nil)
263
+ # Pass arguments to `list_clusters` via a request object, either of type
264
+ # {Google::Cloud::Container::V1::ListClustersRequest} or an equivalent Hash.
265
+ #
266
+ # @param request [Google::Cloud::Container::V1::ListClustersRequest, Hash]
267
+ # A request object representing the call parameters. Required. To specify no
268
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
269
+ # @param options [Gapic::CallOptions, Hash]
270
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
271
+ #
272
+ # @overload list_clusters(project_id: nil, zone: nil, parent: nil)
273
+ # Pass arguments to `list_clusters` via keyword arguments. Note that at
274
+ # least one keyword argument is required. To specify no parameters, or to keep all
275
+ # the default parameter values, pass an empty Hash as a request object (see above).
276
+ #
277
+ # @param project_id [String]
278
+ # Deprecated. The Google Developers Console [project ID or project
279
+ # number](https://support.google.com/cloud/answer/6158840).
280
+ # This field has been deprecated and replaced by the parent field.
281
+ # @param zone [String]
282
+ # Deprecated. The name of the Google Compute Engine
283
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
284
+ # resides, or "-" for all zones.
285
+ # This field has been deprecated and replaced by the parent field.
286
+ # @param parent [String]
287
+ # The parent (project and location) where the clusters will be listed.
288
+ # Specified in the format `projects/*/locations/*`.
289
+ # Location "-" matches all zones and all regions.
290
+ #
291
+ # @yield [response, operation] Access the result along with the RPC operation
292
+ # @yieldparam response [Google::Cloud::Container::V1::ListClustersResponse]
293
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
294
+ #
295
+ # @return [Google::Cloud::Container::V1::ListClustersResponse]
296
+ #
297
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
298
+ #
299
+ def list_clusters request, options = nil
300
+ raise ArgumentError, "request must be provided" if request.nil?
301
+
302
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::ListClustersRequest
303
+
304
+ # Converts hash and nil to an options object
305
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
306
+
307
+ # Customize the options with defaults
308
+ metadata = @config.rpcs.list_clusters.metadata.to_h
309
+
310
+ # Set x-goog-api-client and x-goog-user-project headers
311
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
312
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
313
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
314
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
315
+
316
+ header_params = {
317
+ "parent" => request.parent
318
+ }
319
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
320
+ metadata[:"x-goog-request-params"] ||= request_params_header
321
+
322
+ options.apply_defaults timeout: @config.rpcs.list_clusters.timeout,
323
+ metadata: metadata,
324
+ retry_policy: @config.rpcs.list_clusters.retry_policy
325
+ options.apply_defaults metadata: @config.metadata,
326
+ retry_policy: @config.retry_policy
327
+
328
+ @cluster_manager_stub.call_rpc :list_clusters, request, options: options do |response, operation|
329
+ yield response, operation if block_given?
330
+ return response
331
+ end
332
+ rescue GRPC::BadStatus => e
333
+ raise Google::Cloud::Error.from_error(e)
334
+ end
335
+
336
+ ##
337
+ # Gets the details of a specific cluster.
338
+ #
339
+ # @overload get_cluster(request, options = nil)
340
+ # Pass arguments to `get_cluster` via a request object, either of type
341
+ # {Google::Cloud::Container::V1::GetClusterRequest} or an equivalent Hash.
342
+ #
343
+ # @param request [Google::Cloud::Container::V1::GetClusterRequest, Hash]
344
+ # A request object representing the call parameters. Required. To specify no
345
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
346
+ # @param options [Gapic::CallOptions, Hash]
347
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
348
+ #
349
+ # @overload get_cluster(project_id: nil, zone: nil, cluster_id: nil, name: nil)
350
+ # Pass arguments to `get_cluster` via keyword arguments. Note that at
351
+ # least one keyword argument is required. To specify no parameters, or to keep all
352
+ # the default parameter values, pass an empty Hash as a request object (see above).
353
+ #
354
+ # @param project_id [String]
355
+ # Deprecated. The Google Developers Console [project ID or project
356
+ # number](https://support.google.com/cloud/answer/6158840).
357
+ # This field has been deprecated and replaced by the name field.
358
+ # @param zone [String]
359
+ # Deprecated. The name of the Google Compute Engine
360
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
361
+ # resides.
362
+ # This field has been deprecated and replaced by the name field.
363
+ # @param cluster_id [String]
364
+ # Deprecated. The name of the cluster to retrieve.
365
+ # This field has been deprecated and replaced by the name field.
366
+ # @param name [String]
367
+ # The name (project, location, cluster) of the cluster to retrieve.
368
+ # Specified in the format `projects/*/locations/*/clusters/*`.
369
+ #
370
+ # @yield [response, operation] Access the result along with the RPC operation
371
+ # @yieldparam response [Google::Cloud::Container::V1::Cluster]
372
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
373
+ #
374
+ # @return [Google::Cloud::Container::V1::Cluster]
375
+ #
376
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
377
+ #
378
+ def get_cluster request, options = nil
379
+ raise ArgumentError, "request must be provided" if request.nil?
380
+
381
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::GetClusterRequest
382
+
383
+ # Converts hash and nil to an options object
384
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
385
+
386
+ # Customize the options with defaults
387
+ metadata = @config.rpcs.get_cluster.metadata.to_h
388
+
389
+ # Set x-goog-api-client and x-goog-user-project headers
390
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
391
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
392
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
393
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
394
+
395
+ header_params = {
396
+ "name" => request.name
397
+ }
398
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
399
+ metadata[:"x-goog-request-params"] ||= request_params_header
400
+
401
+ options.apply_defaults timeout: @config.rpcs.get_cluster.timeout,
402
+ metadata: metadata,
403
+ retry_policy: @config.rpcs.get_cluster.retry_policy
404
+ options.apply_defaults metadata: @config.metadata,
405
+ retry_policy: @config.retry_policy
406
+
407
+ @cluster_manager_stub.call_rpc :get_cluster, request, options: options do |response, operation|
408
+ yield response, operation if block_given?
409
+ return response
410
+ end
411
+ rescue GRPC::BadStatus => e
412
+ raise Google::Cloud::Error.from_error(e)
413
+ end
414
+
415
+ ##
416
+ # Creates a cluster, consisting of the specified number and type of Google
417
+ # Compute Engine instances.
418
+ #
419
+ # By default, the cluster is created in the project's
420
+ # [default network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks).
421
+ #
422
+ # One firewall is added for the cluster. After cluster creation,
423
+ # the Kubelet creates routes for each node to allow the containers
424
+ # on that node to communicate with all other instances in the
425
+ # cluster.
426
+ #
427
+ # Finally, an entry is added to the project's global metadata indicating
428
+ # which CIDR range the cluster is using.
429
+ #
430
+ # @overload create_cluster(request, options = nil)
431
+ # Pass arguments to `create_cluster` via a request object, either of type
432
+ # {Google::Cloud::Container::V1::CreateClusterRequest} or an equivalent Hash.
433
+ #
434
+ # @param request [Google::Cloud::Container::V1::CreateClusterRequest, Hash]
435
+ # A request object representing the call parameters. Required. To specify no
436
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
437
+ # @param options [Gapic::CallOptions, Hash]
438
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
439
+ #
440
+ # @overload create_cluster(project_id: nil, zone: nil, cluster: nil, parent: nil)
441
+ # Pass arguments to `create_cluster` via keyword arguments. Note that at
442
+ # least one keyword argument is required. To specify no parameters, or to keep all
443
+ # the default parameter values, pass an empty Hash as a request object (see above).
444
+ #
445
+ # @param project_id [String]
446
+ # Deprecated. The Google Developers Console [project ID or project
447
+ # number](https://support.google.com/cloud/answer/6158840).
448
+ # This field has been deprecated and replaced by the parent field.
449
+ # @param zone [String]
450
+ # Deprecated. The name of the Google Compute Engine
451
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
452
+ # resides.
453
+ # This field has been deprecated and replaced by the parent field.
454
+ # @param cluster [Google::Cloud::Container::V1::Cluster, Hash]
455
+ # Required. A [cluster
456
+ # resource](https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters)
457
+ # @param parent [String]
458
+ # The parent (project and location) where the cluster will be created.
459
+ # Specified in the format `projects/*/locations/*`.
460
+ #
461
+ # @yield [response, operation] Access the result along with the RPC operation
462
+ # @yieldparam response [Google::Cloud::Container::V1::Operation]
463
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
464
+ #
465
+ # @return [Google::Cloud::Container::V1::Operation]
466
+ #
467
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
468
+ #
469
+ def create_cluster request, options = nil
470
+ raise ArgumentError, "request must be provided" if request.nil?
471
+
472
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::CreateClusterRequest
473
+
474
+ # Converts hash and nil to an options object
475
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
476
+
477
+ # Customize the options with defaults
478
+ metadata = @config.rpcs.create_cluster.metadata.to_h
479
+
480
+ # Set x-goog-api-client and x-goog-user-project headers
481
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
482
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
483
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
484
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
485
+
486
+ header_params = {
487
+ "parent" => request.parent
488
+ }
489
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
490
+ metadata[:"x-goog-request-params"] ||= request_params_header
491
+
492
+ options.apply_defaults timeout: @config.rpcs.create_cluster.timeout,
493
+ metadata: metadata,
494
+ retry_policy: @config.rpcs.create_cluster.retry_policy
495
+ options.apply_defaults metadata: @config.metadata,
496
+ retry_policy: @config.retry_policy
497
+
498
+ @cluster_manager_stub.call_rpc :create_cluster, request, options: options do |response, operation|
499
+ yield response, operation if block_given?
500
+ return response
501
+ end
502
+ rescue GRPC::BadStatus => e
503
+ raise Google::Cloud::Error.from_error(e)
504
+ end
505
+
506
+ ##
507
+ # Updates the settings of a specific cluster.
508
+ #
509
+ # @overload update_cluster(request, options = nil)
510
+ # Pass arguments to `update_cluster` via a request object, either of type
511
+ # {Google::Cloud::Container::V1::UpdateClusterRequest} or an equivalent Hash.
512
+ #
513
+ # @param request [Google::Cloud::Container::V1::UpdateClusterRequest, Hash]
514
+ # A request object representing the call parameters. Required. To specify no
515
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
516
+ # @param options [Gapic::CallOptions, Hash]
517
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
518
+ #
519
+ # @overload update_cluster(project_id: nil, zone: nil, cluster_id: nil, update: nil, name: nil)
520
+ # Pass arguments to `update_cluster` via keyword arguments. Note that at
521
+ # least one keyword argument is required. To specify no parameters, or to keep all
522
+ # the default parameter values, pass an empty Hash as a request object (see above).
523
+ #
524
+ # @param project_id [String]
525
+ # Deprecated. The Google Developers Console [project ID or project
526
+ # number](https://support.google.com/cloud/answer/6158840).
527
+ # This field has been deprecated and replaced by the name field.
528
+ # @param zone [String]
529
+ # Deprecated. The name of the Google Compute Engine
530
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
531
+ # resides.
532
+ # This field has been deprecated and replaced by the name field.
533
+ # @param cluster_id [String]
534
+ # Deprecated. The name of the cluster to upgrade.
535
+ # This field has been deprecated and replaced by the name field.
536
+ # @param update [Google::Cloud::Container::V1::ClusterUpdate, Hash]
537
+ # Required. A description of the update.
538
+ # @param name [String]
539
+ # The name (project, location, cluster) of the cluster to update.
540
+ # Specified in the format `projects/*/locations/*/clusters/*`.
541
+ #
542
+ # @yield [response, operation] Access the result along with the RPC operation
543
+ # @yieldparam response [Google::Cloud::Container::V1::Operation]
544
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
545
+ #
546
+ # @return [Google::Cloud::Container::V1::Operation]
547
+ #
548
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
549
+ #
550
+ def update_cluster request, options = nil
551
+ raise ArgumentError, "request must be provided" if request.nil?
552
+
553
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::UpdateClusterRequest
554
+
555
+ # Converts hash and nil to an options object
556
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
557
+
558
+ # Customize the options with defaults
559
+ metadata = @config.rpcs.update_cluster.metadata.to_h
560
+
561
+ # Set x-goog-api-client and x-goog-user-project headers
562
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
563
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
564
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
565
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
566
+
567
+ header_params = {
568
+ "name" => request.name
569
+ }
570
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
571
+ metadata[:"x-goog-request-params"] ||= request_params_header
572
+
573
+ options.apply_defaults timeout: @config.rpcs.update_cluster.timeout,
574
+ metadata: metadata,
575
+ retry_policy: @config.rpcs.update_cluster.retry_policy
576
+ options.apply_defaults metadata: @config.metadata,
577
+ retry_policy: @config.retry_policy
578
+
579
+ @cluster_manager_stub.call_rpc :update_cluster, request, options: options do |response, operation|
580
+ yield response, operation if block_given?
581
+ return response
582
+ end
583
+ rescue GRPC::BadStatus => e
584
+ raise Google::Cloud::Error.from_error(e)
585
+ end
586
+
587
+ ##
588
+ # Updates the version and/or image type for the specified node pool.
589
+ #
590
+ # @overload update_node_pool(request, options = nil)
591
+ # Pass arguments to `update_node_pool` via a request object, either of type
592
+ # {Google::Cloud::Container::V1::UpdateNodePoolRequest} or an equivalent Hash.
593
+ #
594
+ # @param request [Google::Cloud::Container::V1::UpdateNodePoolRequest, Hash]
595
+ # A request object representing the call parameters. Required. To specify no
596
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
597
+ # @param options [Gapic::CallOptions, Hash]
598
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
599
+ #
600
+ # @overload update_node_pool(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, node_version: nil, image_type: nil, name: nil)
601
+ # Pass arguments to `update_node_pool` via keyword arguments. Note that at
602
+ # least one keyword argument is required. To specify no parameters, or to keep all
603
+ # the default parameter values, pass an empty Hash as a request object (see above).
604
+ #
605
+ # @param project_id [String]
606
+ # Deprecated. The Google Developers Console [project ID or project
607
+ # number](https://support.google.com/cloud/answer/6158840).
608
+ # This field has been deprecated and replaced by the name field.
609
+ # @param zone [String]
610
+ # Deprecated. The name of the Google Compute Engine
611
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
612
+ # resides.
613
+ # This field has been deprecated and replaced by the name field.
614
+ # @param cluster_id [String]
615
+ # Deprecated. The name of the cluster to upgrade.
616
+ # This field has been deprecated and replaced by the name field.
617
+ # @param node_pool_id [String]
618
+ # Deprecated. The name of the node pool to upgrade.
619
+ # This field has been deprecated and replaced by the name field.
620
+ # @param node_version [String]
621
+ # Required. The Kubernetes version to change the nodes to (typically an
622
+ # upgrade).
623
+ #
624
+ # Users may specify either explicit versions offered by Kubernetes Engine or
625
+ # version aliases, which have the following behavior:
626
+ #
627
+ # - "latest": picks the highest valid Kubernetes version
628
+ # - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
629
+ # - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
630
+ # - "1.X.Y-gke.N": picks an explicit Kubernetes version
631
+ # - "-": picks the Kubernetes master version
632
+ # @param image_type [String]
633
+ # Required. The desired image type for the node pool.
634
+ # @param name [String]
635
+ # The name (project, location, cluster, node pool) of the node pool to
636
+ # update. Specified in the format
637
+ # `projects/*/locations/*/clusters/*/nodePools/*`.
638
+ #
639
+ # @yield [response, operation] Access the result along with the RPC operation
640
+ # @yieldparam response [Google::Cloud::Container::V1::Operation]
641
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
642
+ #
643
+ # @return [Google::Cloud::Container::V1::Operation]
644
+ #
645
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
646
+ #
647
+ def update_node_pool request, options = nil
648
+ raise ArgumentError, "request must be provided" if request.nil?
649
+
650
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::UpdateNodePoolRequest
651
+
652
+ # Converts hash and nil to an options object
653
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
654
+
655
+ # Customize the options with defaults
656
+ metadata = @config.rpcs.update_node_pool.metadata.to_h
657
+
658
+ # Set x-goog-api-client and x-goog-user-project headers
659
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
660
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
661
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
662
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
663
+
664
+ header_params = {
665
+ "name" => request.name
666
+ }
667
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
668
+ metadata[:"x-goog-request-params"] ||= request_params_header
669
+
670
+ options.apply_defaults timeout: @config.rpcs.update_node_pool.timeout,
671
+ metadata: metadata,
672
+ retry_policy: @config.rpcs.update_node_pool.retry_policy
673
+ options.apply_defaults metadata: @config.metadata,
674
+ retry_policy: @config.retry_policy
675
+
676
+ @cluster_manager_stub.call_rpc :update_node_pool, request, options: options do |response, operation|
677
+ yield response, operation if block_given?
678
+ return response
679
+ end
680
+ rescue GRPC::BadStatus => e
681
+ raise Google::Cloud::Error.from_error(e)
682
+ end
683
+
684
+ ##
685
+ # Sets the autoscaling settings for the specified node pool.
686
+ #
687
+ # @overload set_node_pool_autoscaling(request, options = nil)
688
+ # Pass arguments to `set_node_pool_autoscaling` via a request object, either of type
689
+ # {Google::Cloud::Container::V1::SetNodePoolAutoscalingRequest} or an equivalent Hash.
690
+ #
691
+ # @param request [Google::Cloud::Container::V1::SetNodePoolAutoscalingRequest, Hash]
692
+ # A request object representing the call parameters. Required. To specify no
693
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
694
+ # @param options [Gapic::CallOptions, Hash]
695
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
696
+ #
697
+ # @overload set_node_pool_autoscaling(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, autoscaling: nil, name: nil)
698
+ # Pass arguments to `set_node_pool_autoscaling` via keyword arguments. Note that at
699
+ # least one keyword argument is required. To specify no parameters, or to keep all
700
+ # the default parameter values, pass an empty Hash as a request object (see above).
701
+ #
702
+ # @param project_id [String]
703
+ # Deprecated. The Google Developers Console [project ID or project
704
+ # number](https://support.google.com/cloud/answer/6158840).
705
+ # This field has been deprecated and replaced by the name field.
706
+ # @param zone [String]
707
+ # Deprecated. The name of the Google Compute Engine
708
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
709
+ # resides.
710
+ # This field has been deprecated and replaced by the name field.
711
+ # @param cluster_id [String]
712
+ # Deprecated. The name of the cluster to upgrade.
713
+ # This field has been deprecated and replaced by the name field.
714
+ # @param node_pool_id [String]
715
+ # Deprecated. The name of the node pool to upgrade.
716
+ # This field has been deprecated and replaced by the name field.
717
+ # @param autoscaling [Google::Cloud::Container::V1::NodePoolAutoscaling, Hash]
718
+ # Required. Autoscaling configuration for the node pool.
719
+ # @param name [String]
720
+ # The name (project, location, cluster, node pool) of the node pool to set
721
+ # autoscaler settings. Specified in the format
722
+ # `projects/*/locations/*/clusters/*/nodePools/*`.
723
+ #
724
+ # @yield [response, operation] Access the result along with the RPC operation
725
+ # @yieldparam response [Google::Cloud::Container::V1::Operation]
726
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
727
+ #
728
+ # @return [Google::Cloud::Container::V1::Operation]
729
+ #
730
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
731
+ #
732
+ def set_node_pool_autoscaling request, options = nil
733
+ raise ArgumentError, "request must be provided" if request.nil?
734
+
735
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::SetNodePoolAutoscalingRequest
736
+
737
+ # Converts hash and nil to an options object
738
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
739
+
740
+ # Customize the options with defaults
741
+ metadata = @config.rpcs.set_node_pool_autoscaling.metadata.to_h
742
+
743
+ # Set x-goog-api-client and x-goog-user-project headers
744
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
745
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
746
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
747
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
748
+
749
+ header_params = {
750
+ "name" => request.name
751
+ }
752
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
753
+ metadata[:"x-goog-request-params"] ||= request_params_header
754
+
755
+ options.apply_defaults timeout: @config.rpcs.set_node_pool_autoscaling.timeout,
756
+ metadata: metadata,
757
+ retry_policy: @config.rpcs.set_node_pool_autoscaling.retry_policy
758
+ options.apply_defaults metadata: @config.metadata,
759
+ retry_policy: @config.retry_policy
760
+
761
+ @cluster_manager_stub.call_rpc :set_node_pool_autoscaling, request, options: options do |response, operation|
762
+ yield response, operation if block_given?
763
+ return response
764
+ end
765
+ rescue GRPC::BadStatus => e
766
+ raise Google::Cloud::Error.from_error(e)
767
+ end
768
+
769
+ ##
770
+ # Sets the logging service for a specific cluster.
771
+ #
772
+ # @overload set_logging_service(request, options = nil)
773
+ # Pass arguments to `set_logging_service` via a request object, either of type
774
+ # {Google::Cloud::Container::V1::SetLoggingServiceRequest} or an equivalent Hash.
775
+ #
776
+ # @param request [Google::Cloud::Container::V1::SetLoggingServiceRequest, Hash]
777
+ # A request object representing the call parameters. Required. To specify no
778
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
779
+ # @param options [Gapic::CallOptions, Hash]
780
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
781
+ #
782
+ # @overload set_logging_service(project_id: nil, zone: nil, cluster_id: nil, logging_service: nil, name: nil)
783
+ # Pass arguments to `set_logging_service` via keyword arguments. Note that at
784
+ # least one keyword argument is required. To specify no parameters, or to keep all
785
+ # the default parameter values, pass an empty Hash as a request object (see above).
786
+ #
787
+ # @param project_id [String]
788
+ # Deprecated. The Google Developers Console [project ID or project
789
+ # number](https://support.google.com/cloud/answer/6158840).
790
+ # This field has been deprecated and replaced by the name field.
791
+ # @param zone [String]
792
+ # Deprecated. The name of the Google Compute Engine
793
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
794
+ # resides.
795
+ # This field has been deprecated and replaced by the name field.
796
+ # @param cluster_id [String]
797
+ # Deprecated. The name of the cluster to upgrade.
798
+ # This field has been deprecated and replaced by the name field.
799
+ # @param logging_service [String]
800
+ # Required. The logging service the cluster should use to write metrics.
801
+ # Currently available options:
802
+ #
803
+ # * "logging.googleapis.com" - the Google Cloud Logging service
804
+ # * "none" - no metrics will be exported from the cluster
805
+ # @param name [String]
806
+ # The name (project, location, cluster) of the cluster to set logging.
807
+ # Specified in the format `projects/*/locations/*/clusters/*`.
808
+ #
809
+ # @yield [response, operation] Access the result along with the RPC operation
810
+ # @yieldparam response [Google::Cloud::Container::V1::Operation]
811
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
812
+ #
813
+ # @return [Google::Cloud::Container::V1::Operation]
814
+ #
815
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
816
+ #
817
+ def set_logging_service request, options = nil
818
+ raise ArgumentError, "request must be provided" if request.nil?
819
+
820
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::SetLoggingServiceRequest
821
+
822
+ # Converts hash and nil to an options object
823
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
824
+
825
+ # Customize the options with defaults
826
+ metadata = @config.rpcs.set_logging_service.metadata.to_h
827
+
828
+ # Set x-goog-api-client and x-goog-user-project headers
829
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
830
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
831
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
832
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
833
+
834
+ header_params = {
835
+ "name" => request.name
836
+ }
837
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
838
+ metadata[:"x-goog-request-params"] ||= request_params_header
839
+
840
+ options.apply_defaults timeout: @config.rpcs.set_logging_service.timeout,
841
+ metadata: metadata,
842
+ retry_policy: @config.rpcs.set_logging_service.retry_policy
843
+ options.apply_defaults metadata: @config.metadata,
844
+ retry_policy: @config.retry_policy
845
+
846
+ @cluster_manager_stub.call_rpc :set_logging_service, request, options: options do |response, operation|
847
+ yield response, operation if block_given?
848
+ return response
849
+ end
850
+ rescue GRPC::BadStatus => e
851
+ raise Google::Cloud::Error.from_error(e)
852
+ end
853
+
854
+ ##
855
+ # Sets the monitoring service for a specific cluster.
856
+ #
857
+ # @overload set_monitoring_service(request, options = nil)
858
+ # Pass arguments to `set_monitoring_service` via a request object, either of type
859
+ # {Google::Cloud::Container::V1::SetMonitoringServiceRequest} or an equivalent Hash.
860
+ #
861
+ # @param request [Google::Cloud::Container::V1::SetMonitoringServiceRequest, Hash]
862
+ # A request object representing the call parameters. Required. To specify no
863
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
864
+ # @param options [Gapic::CallOptions, Hash]
865
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
866
+ #
867
+ # @overload set_monitoring_service(project_id: nil, zone: nil, cluster_id: nil, monitoring_service: nil, name: nil)
868
+ # Pass arguments to `set_monitoring_service` via keyword arguments. Note that at
869
+ # least one keyword argument is required. To specify no parameters, or to keep all
870
+ # the default parameter values, pass an empty Hash as a request object (see above).
871
+ #
872
+ # @param project_id [String]
873
+ # Deprecated. The Google Developers Console [project ID or project
874
+ # number](https://support.google.com/cloud/answer/6158840).
875
+ # This field has been deprecated and replaced by the name field.
876
+ # @param zone [String]
877
+ # Deprecated. The name of the Google Compute Engine
878
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
879
+ # resides.
880
+ # This field has been deprecated and replaced by the name field.
881
+ # @param cluster_id [String]
882
+ # Deprecated. The name of the cluster to upgrade.
883
+ # This field has been deprecated and replaced by the name field.
884
+ # @param monitoring_service [String]
885
+ # Required. The monitoring service the cluster should use to write metrics.
886
+ # Currently available options:
887
+ #
888
+ # * "monitoring.googleapis.com/kubernetes" - the Google Cloud Monitoring
889
+ # service with Kubernetes-native resource model
890
+ # * "monitoring.googleapis.com" - the Google Cloud Monitoring service
891
+ # * "none" - no metrics will be exported from the cluster
892
+ # @param name [String]
893
+ # The name (project, location, cluster) of the cluster to set monitoring.
894
+ # Specified in the format `projects/*/locations/*/clusters/*`.
895
+ #
896
+ # @yield [response, operation] Access the result along with the RPC operation
897
+ # @yieldparam response [Google::Cloud::Container::V1::Operation]
898
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
899
+ #
900
+ # @return [Google::Cloud::Container::V1::Operation]
901
+ #
902
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
903
+ #
904
+ def set_monitoring_service request, options = nil
905
+ raise ArgumentError, "request must be provided" if request.nil?
906
+
907
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::SetMonitoringServiceRequest
908
+
909
+ # Converts hash and nil to an options object
910
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
911
+
912
+ # Customize the options with defaults
913
+ metadata = @config.rpcs.set_monitoring_service.metadata.to_h
914
+
915
+ # Set x-goog-api-client and x-goog-user-project headers
916
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
917
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
918
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
919
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
920
+
921
+ header_params = {
922
+ "name" => request.name
923
+ }
924
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
925
+ metadata[:"x-goog-request-params"] ||= request_params_header
926
+
927
+ options.apply_defaults timeout: @config.rpcs.set_monitoring_service.timeout,
928
+ metadata: metadata,
929
+ retry_policy: @config.rpcs.set_monitoring_service.retry_policy
930
+ options.apply_defaults metadata: @config.metadata,
931
+ retry_policy: @config.retry_policy
932
+
933
+ @cluster_manager_stub.call_rpc :set_monitoring_service, request, options: options do |response, operation|
934
+ yield response, operation if block_given?
935
+ return response
936
+ end
937
+ rescue GRPC::BadStatus => e
938
+ raise Google::Cloud::Error.from_error(e)
939
+ end
940
+
941
+ ##
942
+ # Sets the addons for a specific cluster.
943
+ #
944
+ # @overload set_addons_config(request, options = nil)
945
+ # Pass arguments to `set_addons_config` via a request object, either of type
946
+ # {Google::Cloud::Container::V1::SetAddonsConfigRequest} or an equivalent Hash.
947
+ #
948
+ # @param request [Google::Cloud::Container::V1::SetAddonsConfigRequest, Hash]
949
+ # A request object representing the call parameters. Required. To specify no
950
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
951
+ # @param options [Gapic::CallOptions, Hash]
952
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
953
+ #
954
+ # @overload set_addons_config(project_id: nil, zone: nil, cluster_id: nil, addons_config: nil, name: nil)
955
+ # Pass arguments to `set_addons_config` via keyword arguments. Note that at
956
+ # least one keyword argument is required. To specify no parameters, or to keep all
957
+ # the default parameter values, pass an empty Hash as a request object (see above).
958
+ #
959
+ # @param project_id [String]
960
+ # Deprecated. The Google Developers Console [project ID or project
961
+ # number](https://support.google.com/cloud/answer/6158840).
962
+ # This field has been deprecated and replaced by the name field.
963
+ # @param zone [String]
964
+ # Deprecated. The name of the Google Compute Engine
965
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
966
+ # resides.
967
+ # This field has been deprecated and replaced by the name field.
968
+ # @param cluster_id [String]
969
+ # Deprecated. The name of the cluster to upgrade.
970
+ # This field has been deprecated and replaced by the name field.
971
+ # @param addons_config [Google::Cloud::Container::V1::AddonsConfig, Hash]
972
+ # Required. The desired configurations for the various addons available to run in the
973
+ # cluster.
974
+ # @param name [String]
975
+ # The name (project, location, cluster) of the cluster to set addons.
976
+ # Specified in the format `projects/*/locations/*/clusters/*`.
977
+ #
978
+ # @yield [response, operation] Access the result along with the RPC operation
979
+ # @yieldparam response [Google::Cloud::Container::V1::Operation]
980
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
981
+ #
982
+ # @return [Google::Cloud::Container::V1::Operation]
983
+ #
984
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
985
+ #
986
+ def set_addons_config request, options = nil
987
+ raise ArgumentError, "request must be provided" if request.nil?
988
+
989
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::SetAddonsConfigRequest
990
+
991
+ # Converts hash and nil to an options object
992
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
993
+
994
+ # Customize the options with defaults
995
+ metadata = @config.rpcs.set_addons_config.metadata.to_h
996
+
997
+ # Set x-goog-api-client and x-goog-user-project headers
998
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
999
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1000
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
1001
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1002
+
1003
+ header_params = {
1004
+ "name" => request.name
1005
+ }
1006
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1007
+ metadata[:"x-goog-request-params"] ||= request_params_header
1008
+
1009
+ options.apply_defaults timeout: @config.rpcs.set_addons_config.timeout,
1010
+ metadata: metadata,
1011
+ retry_policy: @config.rpcs.set_addons_config.retry_policy
1012
+ options.apply_defaults metadata: @config.metadata,
1013
+ retry_policy: @config.retry_policy
1014
+
1015
+ @cluster_manager_stub.call_rpc :set_addons_config, request, options: options do |response, operation|
1016
+ yield response, operation if block_given?
1017
+ return response
1018
+ end
1019
+ rescue GRPC::BadStatus => e
1020
+ raise Google::Cloud::Error.from_error(e)
1021
+ end
1022
+
1023
+ ##
1024
+ # Sets the locations for a specific cluster.
1025
+ #
1026
+ # @overload set_locations(request, options = nil)
1027
+ # Pass arguments to `set_locations` via a request object, either of type
1028
+ # {Google::Cloud::Container::V1::SetLocationsRequest} or an equivalent Hash.
1029
+ #
1030
+ # @param request [Google::Cloud::Container::V1::SetLocationsRequest, Hash]
1031
+ # A request object representing the call parameters. Required. To specify no
1032
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1033
+ # @param options [Gapic::CallOptions, Hash]
1034
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1035
+ #
1036
+ # @overload set_locations(project_id: nil, zone: nil, cluster_id: nil, locations: nil, name: nil)
1037
+ # Pass arguments to `set_locations` via keyword arguments. Note that at
1038
+ # least one keyword argument is required. To specify no parameters, or to keep all
1039
+ # the default parameter values, pass an empty Hash as a request object (see above).
1040
+ #
1041
+ # @param project_id [String]
1042
+ # Deprecated. The Google Developers Console [project ID or project
1043
+ # number](https://support.google.com/cloud/answer/6158840).
1044
+ # This field has been deprecated and replaced by the name field.
1045
+ # @param zone [String]
1046
+ # Deprecated. The name of the Google Compute Engine
1047
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
1048
+ # resides.
1049
+ # This field has been deprecated and replaced by the name field.
1050
+ # @param cluster_id [String]
1051
+ # Deprecated. The name of the cluster to upgrade.
1052
+ # This field has been deprecated and replaced by the name field.
1053
+ # @param locations [Array<String>]
1054
+ # Required. The desired list of Google Compute Engine
1055
+ # [zones](https://cloud.google.com/compute/docs/zones#available) in which the cluster's nodes
1056
+ # should be located. Changing the locations a cluster is in will result
1057
+ # in nodes being either created or removed from the cluster, depending on
1058
+ # whether locations are being added or removed.
1059
+ #
1060
+ # This list must always include the cluster's primary zone.
1061
+ # @param name [String]
1062
+ # The name (project, location, cluster) of the cluster to set locations.
1063
+ # Specified in the format `projects/*/locations/*/clusters/*`.
1064
+ #
1065
+ # @yield [response, operation] Access the result along with the RPC operation
1066
+ # @yieldparam response [Google::Cloud::Container::V1::Operation]
1067
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1068
+ #
1069
+ # @return [Google::Cloud::Container::V1::Operation]
1070
+ #
1071
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1072
+ #
1073
+ def set_locations request, options = nil
1074
+ raise ArgumentError, "request must be provided" if request.nil?
1075
+
1076
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::SetLocationsRequest
1077
+
1078
+ # Converts hash and nil to an options object
1079
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1080
+
1081
+ # Customize the options with defaults
1082
+ metadata = @config.rpcs.set_locations.metadata.to_h
1083
+
1084
+ # Set x-goog-api-client and x-goog-user-project headers
1085
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1086
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1087
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
1088
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1089
+
1090
+ header_params = {
1091
+ "name" => request.name
1092
+ }
1093
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1094
+ metadata[:"x-goog-request-params"] ||= request_params_header
1095
+
1096
+ options.apply_defaults timeout: @config.rpcs.set_locations.timeout,
1097
+ metadata: metadata,
1098
+ retry_policy: @config.rpcs.set_locations.retry_policy
1099
+ options.apply_defaults metadata: @config.metadata,
1100
+ retry_policy: @config.retry_policy
1101
+
1102
+ @cluster_manager_stub.call_rpc :set_locations, request, options: options do |response, operation|
1103
+ yield response, operation if block_given?
1104
+ return response
1105
+ end
1106
+ rescue GRPC::BadStatus => e
1107
+ raise Google::Cloud::Error.from_error(e)
1108
+ end
1109
+
1110
+ ##
1111
+ # Updates the master for a specific cluster.
1112
+ #
1113
+ # @overload update_master(request, options = nil)
1114
+ # Pass arguments to `update_master` via a request object, either of type
1115
+ # {Google::Cloud::Container::V1::UpdateMasterRequest} or an equivalent Hash.
1116
+ #
1117
+ # @param request [Google::Cloud::Container::V1::UpdateMasterRequest, Hash]
1118
+ # A request object representing the call parameters. Required. To specify no
1119
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1120
+ # @param options [Gapic::CallOptions, Hash]
1121
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1122
+ #
1123
+ # @overload update_master(project_id: nil, zone: nil, cluster_id: nil, master_version: nil, name: nil)
1124
+ # Pass arguments to `update_master` via keyword arguments. Note that at
1125
+ # least one keyword argument is required. To specify no parameters, or to keep all
1126
+ # the default parameter values, pass an empty Hash as a request object (see above).
1127
+ #
1128
+ # @param project_id [String]
1129
+ # Deprecated. The Google Developers Console [project ID or project
1130
+ # number](https://support.google.com/cloud/answer/6158840).
1131
+ # This field has been deprecated and replaced by the name field.
1132
+ # @param zone [String]
1133
+ # Deprecated. The name of the Google Compute Engine
1134
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
1135
+ # resides.
1136
+ # This field has been deprecated and replaced by the name field.
1137
+ # @param cluster_id [String]
1138
+ # Deprecated. The name of the cluster to upgrade.
1139
+ # This field has been deprecated and replaced by the name field.
1140
+ # @param master_version [String]
1141
+ # Required. The Kubernetes version to change the master to.
1142
+ #
1143
+ # Users may specify either explicit versions offered by Kubernetes Engine or
1144
+ # version aliases, which have the following behavior:
1145
+ #
1146
+ # - "latest": picks the highest valid Kubernetes version
1147
+ # - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
1148
+ # - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
1149
+ # - "1.X.Y-gke.N": picks an explicit Kubernetes version
1150
+ # - "-": picks the default Kubernetes version
1151
+ # @param name [String]
1152
+ # The name (project, location, cluster) of the cluster to update.
1153
+ # Specified in the format `projects/*/locations/*/clusters/*`.
1154
+ #
1155
+ # @yield [response, operation] Access the result along with the RPC operation
1156
+ # @yieldparam response [Google::Cloud::Container::V1::Operation]
1157
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1158
+ #
1159
+ # @return [Google::Cloud::Container::V1::Operation]
1160
+ #
1161
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1162
+ #
1163
+ def update_master request, options = nil
1164
+ raise ArgumentError, "request must be provided" if request.nil?
1165
+
1166
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::UpdateMasterRequest
1167
+
1168
+ # Converts hash and nil to an options object
1169
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1170
+
1171
+ # Customize the options with defaults
1172
+ metadata = @config.rpcs.update_master.metadata.to_h
1173
+
1174
+ # Set x-goog-api-client and x-goog-user-project headers
1175
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1176
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1177
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
1178
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1179
+
1180
+ header_params = {
1181
+ "name" => request.name
1182
+ }
1183
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1184
+ metadata[:"x-goog-request-params"] ||= request_params_header
1185
+
1186
+ options.apply_defaults timeout: @config.rpcs.update_master.timeout,
1187
+ metadata: metadata,
1188
+ retry_policy: @config.rpcs.update_master.retry_policy
1189
+ options.apply_defaults metadata: @config.metadata,
1190
+ retry_policy: @config.retry_policy
1191
+
1192
+ @cluster_manager_stub.call_rpc :update_master, request, options: options do |response, operation|
1193
+ yield response, operation if block_given?
1194
+ return response
1195
+ end
1196
+ rescue GRPC::BadStatus => e
1197
+ raise Google::Cloud::Error.from_error(e)
1198
+ end
1199
+
1200
+ ##
1201
+ # Sets master auth materials. Currently supports changing the admin password
1202
+ # or a specific cluster, either via password generation or explicitly setting
1203
+ # the password.
1204
+ #
1205
+ # @overload set_master_auth(request, options = nil)
1206
+ # Pass arguments to `set_master_auth` via a request object, either of type
1207
+ # {Google::Cloud::Container::V1::SetMasterAuthRequest} or an equivalent Hash.
1208
+ #
1209
+ # @param request [Google::Cloud::Container::V1::SetMasterAuthRequest, Hash]
1210
+ # A request object representing the call parameters. Required. To specify no
1211
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1212
+ # @param options [Gapic::CallOptions, Hash]
1213
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1214
+ #
1215
+ # @overload set_master_auth(project_id: nil, zone: nil, cluster_id: nil, action: nil, update: nil, name: nil)
1216
+ # Pass arguments to `set_master_auth` via keyword arguments. Note that at
1217
+ # least one keyword argument is required. To specify no parameters, or to keep all
1218
+ # the default parameter values, pass an empty Hash as a request object (see above).
1219
+ #
1220
+ # @param project_id [String]
1221
+ # Deprecated. The Google Developers Console [project ID or project
1222
+ # number](https://support.google.com/cloud/answer/6158840).
1223
+ # This field has been deprecated and replaced by the name field.
1224
+ # @param zone [String]
1225
+ # Deprecated. The name of the Google Compute Engine
1226
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
1227
+ # resides.
1228
+ # This field has been deprecated and replaced by the name field.
1229
+ # @param cluster_id [String]
1230
+ # Deprecated. The name of the cluster to upgrade.
1231
+ # This field has been deprecated and replaced by the name field.
1232
+ # @param action [Google::Cloud::Container::V1::SetMasterAuthRequest::Action]
1233
+ # Required. The exact form of action to be taken on the master auth.
1234
+ # @param update [Google::Cloud::Container::V1::MasterAuth, Hash]
1235
+ # Required. A description of the update.
1236
+ # @param name [String]
1237
+ # The name (project, location, cluster) of the cluster to set auth.
1238
+ # Specified in the format `projects/*/locations/*/clusters/*`.
1239
+ #
1240
+ # @yield [response, operation] Access the result along with the RPC operation
1241
+ # @yieldparam response [Google::Cloud::Container::V1::Operation]
1242
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1243
+ #
1244
+ # @return [Google::Cloud::Container::V1::Operation]
1245
+ #
1246
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1247
+ #
1248
+ def set_master_auth request, options = nil
1249
+ raise ArgumentError, "request must be provided" if request.nil?
1250
+
1251
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::SetMasterAuthRequest
1252
+
1253
+ # Converts hash and nil to an options object
1254
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1255
+
1256
+ # Customize the options with defaults
1257
+ metadata = @config.rpcs.set_master_auth.metadata.to_h
1258
+
1259
+ # Set x-goog-api-client and x-goog-user-project headers
1260
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1261
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1262
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
1263
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1264
+
1265
+ header_params = {
1266
+ "name" => request.name
1267
+ }
1268
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1269
+ metadata[:"x-goog-request-params"] ||= request_params_header
1270
+
1271
+ options.apply_defaults timeout: @config.rpcs.set_master_auth.timeout,
1272
+ metadata: metadata,
1273
+ retry_policy: @config.rpcs.set_master_auth.retry_policy
1274
+ options.apply_defaults metadata: @config.metadata,
1275
+ retry_policy: @config.retry_policy
1276
+
1277
+ @cluster_manager_stub.call_rpc :set_master_auth, request, options: options do |response, operation|
1278
+ yield response, operation if block_given?
1279
+ return response
1280
+ end
1281
+ rescue GRPC::BadStatus => e
1282
+ raise Google::Cloud::Error.from_error(e)
1283
+ end
1284
+
1285
+ ##
1286
+ # Deletes the cluster, including the Kubernetes endpoint and all worker
1287
+ # nodes.
1288
+ #
1289
+ # Firewalls and routes that were configured during cluster creation
1290
+ # are also deleted.
1291
+ #
1292
+ # Other Google Compute Engine resources that might be in use by the cluster,
1293
+ # such as load balancer resources, are not deleted if they weren't present
1294
+ # when the cluster was initially created.
1295
+ #
1296
+ # @overload delete_cluster(request, options = nil)
1297
+ # Pass arguments to `delete_cluster` via a request object, either of type
1298
+ # {Google::Cloud::Container::V1::DeleteClusterRequest} or an equivalent Hash.
1299
+ #
1300
+ # @param request [Google::Cloud::Container::V1::DeleteClusterRequest, Hash]
1301
+ # A request object representing the call parameters. Required. To specify no
1302
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1303
+ # @param options [Gapic::CallOptions, Hash]
1304
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1305
+ #
1306
+ # @overload delete_cluster(project_id: nil, zone: nil, cluster_id: nil, name: nil)
1307
+ # Pass arguments to `delete_cluster` via keyword arguments. Note that at
1308
+ # least one keyword argument is required. To specify no parameters, or to keep all
1309
+ # the default parameter values, pass an empty Hash as a request object (see above).
1310
+ #
1311
+ # @param project_id [String]
1312
+ # Deprecated. The Google Developers Console [project ID or project
1313
+ # number](https://support.google.com/cloud/answer/6158840).
1314
+ # This field has been deprecated and replaced by the name field.
1315
+ # @param zone [String]
1316
+ # Deprecated. The name of the Google Compute Engine
1317
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
1318
+ # resides.
1319
+ # This field has been deprecated and replaced by the name field.
1320
+ # @param cluster_id [String]
1321
+ # Deprecated. The name of the cluster to delete.
1322
+ # This field has been deprecated and replaced by the name field.
1323
+ # @param name [String]
1324
+ # The name (project, location, cluster) of the cluster to delete.
1325
+ # Specified in the format `projects/*/locations/*/clusters/*`.
1326
+ #
1327
+ # @yield [response, operation] Access the result along with the RPC operation
1328
+ # @yieldparam response [Google::Cloud::Container::V1::Operation]
1329
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1330
+ #
1331
+ # @return [Google::Cloud::Container::V1::Operation]
1332
+ #
1333
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1334
+ #
1335
+ def delete_cluster request, options = nil
1336
+ raise ArgumentError, "request must be provided" if request.nil?
1337
+
1338
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::DeleteClusterRequest
1339
+
1340
+ # Converts hash and nil to an options object
1341
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1342
+
1343
+ # Customize the options with defaults
1344
+ metadata = @config.rpcs.delete_cluster.metadata.to_h
1345
+
1346
+ # Set x-goog-api-client and x-goog-user-project headers
1347
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1348
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1349
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
1350
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1351
+
1352
+ header_params = {
1353
+ "name" => request.name
1354
+ }
1355
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1356
+ metadata[:"x-goog-request-params"] ||= request_params_header
1357
+
1358
+ options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout,
1359
+ metadata: metadata,
1360
+ retry_policy: @config.rpcs.delete_cluster.retry_policy
1361
+ options.apply_defaults metadata: @config.metadata,
1362
+ retry_policy: @config.retry_policy
1363
+
1364
+ @cluster_manager_stub.call_rpc :delete_cluster, request, options: options do |response, operation|
1365
+ yield response, operation if block_given?
1366
+ return response
1367
+ end
1368
+ rescue GRPC::BadStatus => e
1369
+ raise Google::Cloud::Error.from_error(e)
1370
+ end
1371
+
1372
+ ##
1373
+ # Lists all operations in a project in a specific zone or all zones.
1374
+ #
1375
+ # @overload list_operations(request, options = nil)
1376
+ # Pass arguments to `list_operations` via a request object, either of type
1377
+ # {Google::Cloud::Container::V1::ListOperationsRequest} or an equivalent Hash.
1378
+ #
1379
+ # @param request [Google::Cloud::Container::V1::ListOperationsRequest, Hash]
1380
+ # A request object representing the call parameters. Required. To specify no
1381
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1382
+ # @param options [Gapic::CallOptions, Hash]
1383
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1384
+ #
1385
+ # @overload list_operations(project_id: nil, zone: nil, parent: nil)
1386
+ # Pass arguments to `list_operations` via keyword arguments. Note that at
1387
+ # least one keyword argument is required. To specify no parameters, or to keep all
1388
+ # the default parameter values, pass an empty Hash as a request object (see above).
1389
+ #
1390
+ # @param project_id [String]
1391
+ # Deprecated. The Google Developers Console [project ID or project
1392
+ # number](https://support.google.com/cloud/answer/6158840).
1393
+ # This field has been deprecated and replaced by the parent field.
1394
+ # @param zone [String]
1395
+ # Deprecated. The name of the Google Compute Engine
1396
+ # [zone](https://cloud.google.com/compute/docs/zones#available) to return operations for, or `-` for
1397
+ # all zones. This field has been deprecated and replaced by the parent field.
1398
+ # @param parent [String]
1399
+ # The parent (project and location) where the operations will be listed.
1400
+ # Specified in the format `projects/*/locations/*`.
1401
+ # Location "-" matches all zones and all regions.
1402
+ #
1403
+ # @yield [response, operation] Access the result along with the RPC operation
1404
+ # @yieldparam response [Google::Cloud::Container::V1::ListOperationsResponse]
1405
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1406
+ #
1407
+ # @return [Google::Cloud::Container::V1::ListOperationsResponse]
1408
+ #
1409
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1410
+ #
1411
+ def list_operations request, options = nil
1412
+ raise ArgumentError, "request must be provided" if request.nil?
1413
+
1414
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::ListOperationsRequest
1415
+
1416
+ # Converts hash and nil to an options object
1417
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1418
+
1419
+ # Customize the options with defaults
1420
+ metadata = @config.rpcs.list_operations.metadata.to_h
1421
+
1422
+ # Set x-goog-api-client and x-goog-user-project headers
1423
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1424
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1425
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
1426
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1427
+
1428
+ header_params = {
1429
+ "parent" => request.parent
1430
+ }
1431
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1432
+ metadata[:"x-goog-request-params"] ||= request_params_header
1433
+
1434
+ options.apply_defaults timeout: @config.rpcs.list_operations.timeout,
1435
+ metadata: metadata,
1436
+ retry_policy: @config.rpcs.list_operations.retry_policy
1437
+ options.apply_defaults metadata: @config.metadata,
1438
+ retry_policy: @config.retry_policy
1439
+
1440
+ @cluster_manager_stub.call_rpc :list_operations, request, options: options do |response, operation|
1441
+ yield response, operation if block_given?
1442
+ return response
1443
+ end
1444
+ rescue GRPC::BadStatus => e
1445
+ raise Google::Cloud::Error.from_error(e)
1446
+ end
1447
+
1448
+ ##
1449
+ # Gets the specified operation.
1450
+ #
1451
+ # @overload get_operation(request, options = nil)
1452
+ # Pass arguments to `get_operation` via a request object, either of type
1453
+ # {Google::Cloud::Container::V1::GetOperationRequest} or an equivalent Hash.
1454
+ #
1455
+ # @param request [Google::Cloud::Container::V1::GetOperationRequest, Hash]
1456
+ # A request object representing the call parameters. Required. To specify no
1457
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1458
+ # @param options [Gapic::CallOptions, Hash]
1459
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1460
+ #
1461
+ # @overload get_operation(project_id: nil, zone: nil, operation_id: nil, name: nil)
1462
+ # Pass arguments to `get_operation` via keyword arguments. Note that at
1463
+ # least one keyword argument is required. To specify no parameters, or to keep all
1464
+ # the default parameter values, pass an empty Hash as a request object (see above).
1465
+ #
1466
+ # @param project_id [String]
1467
+ # Deprecated. The Google Developers Console [project ID or project
1468
+ # number](https://support.google.com/cloud/answer/6158840).
1469
+ # This field has been deprecated and replaced by the name field.
1470
+ # @param zone [String]
1471
+ # Deprecated. The name of the Google Compute Engine
1472
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
1473
+ # resides.
1474
+ # This field has been deprecated and replaced by the name field.
1475
+ # @param operation_id [String]
1476
+ # Deprecated. The server-assigned `name` of the operation.
1477
+ # This field has been deprecated and replaced by the name field.
1478
+ # @param name [String]
1479
+ # The name (project, location, operation id) of the operation to get.
1480
+ # Specified in the format `projects/*/locations/*/operations/*`.
1481
+ #
1482
+ # @yield [response, operation] Access the result along with the RPC operation
1483
+ # @yieldparam response [Google::Cloud::Container::V1::Operation]
1484
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1485
+ #
1486
+ # @return [Google::Cloud::Container::V1::Operation]
1487
+ #
1488
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1489
+ #
1490
+ def get_operation request, options = nil
1491
+ raise ArgumentError, "request must be provided" if request.nil?
1492
+
1493
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::GetOperationRequest
1494
+
1495
+ # Converts hash and nil to an options object
1496
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1497
+
1498
+ # Customize the options with defaults
1499
+ metadata = @config.rpcs.get_operation.metadata.to_h
1500
+
1501
+ # Set x-goog-api-client and x-goog-user-project headers
1502
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1503
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1504
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
1505
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1506
+
1507
+ header_params = {
1508
+ "name" => request.name
1509
+ }
1510
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1511
+ metadata[:"x-goog-request-params"] ||= request_params_header
1512
+
1513
+ options.apply_defaults timeout: @config.rpcs.get_operation.timeout,
1514
+ metadata: metadata,
1515
+ retry_policy: @config.rpcs.get_operation.retry_policy
1516
+ options.apply_defaults metadata: @config.metadata,
1517
+ retry_policy: @config.retry_policy
1518
+
1519
+ @cluster_manager_stub.call_rpc :get_operation, request, options: options do |response, operation|
1520
+ yield response, operation if block_given?
1521
+ return response
1522
+ end
1523
+ rescue GRPC::BadStatus => e
1524
+ raise Google::Cloud::Error.from_error(e)
1525
+ end
1526
+
1527
+ ##
1528
+ # Cancels the specified operation.
1529
+ #
1530
+ # @overload cancel_operation(request, options = nil)
1531
+ # Pass arguments to `cancel_operation` via a request object, either of type
1532
+ # {Google::Cloud::Container::V1::CancelOperationRequest} or an equivalent Hash.
1533
+ #
1534
+ # @param request [Google::Cloud::Container::V1::CancelOperationRequest, Hash]
1535
+ # A request object representing the call parameters. Required. To specify no
1536
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1537
+ # @param options [Gapic::CallOptions, Hash]
1538
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1539
+ #
1540
+ # @overload cancel_operation(project_id: nil, zone: nil, operation_id: nil, name: nil)
1541
+ # Pass arguments to `cancel_operation` via keyword arguments. Note that at
1542
+ # least one keyword argument is required. To specify no parameters, or to keep all
1543
+ # the default parameter values, pass an empty Hash as a request object (see above).
1544
+ #
1545
+ # @param project_id [String]
1546
+ # Deprecated. The Google Developers Console [project ID or project
1547
+ # number](https://support.google.com/cloud/answer/6158840).
1548
+ # This field has been deprecated and replaced by the name field.
1549
+ # @param zone [String]
1550
+ # Deprecated. The name of the Google Compute Engine
1551
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the operation resides.
1552
+ # This field has been deprecated and replaced by the name field.
1553
+ # @param operation_id [String]
1554
+ # Deprecated. The server-assigned `name` of the operation.
1555
+ # This field has been deprecated and replaced by the name field.
1556
+ # @param name [String]
1557
+ # The name (project, location, operation id) of the operation to cancel.
1558
+ # Specified in the format `projects/*/locations/*/operations/*`.
1559
+ #
1560
+ # @yield [response, operation] Access the result along with the RPC operation
1561
+ # @yieldparam response [Google::Protobuf::Empty]
1562
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1563
+ #
1564
+ # @return [Google::Protobuf::Empty]
1565
+ #
1566
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1567
+ #
1568
+ def cancel_operation request, options = nil
1569
+ raise ArgumentError, "request must be provided" if request.nil?
1570
+
1571
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::CancelOperationRequest
1572
+
1573
+ # Converts hash and nil to an options object
1574
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1575
+
1576
+ # Customize the options with defaults
1577
+ metadata = @config.rpcs.cancel_operation.metadata.to_h
1578
+
1579
+ # Set x-goog-api-client and x-goog-user-project headers
1580
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1581
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1582
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
1583
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1584
+
1585
+ header_params = {
1586
+ "name" => request.name
1587
+ }
1588
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1589
+ metadata[:"x-goog-request-params"] ||= request_params_header
1590
+
1591
+ options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout,
1592
+ metadata: metadata,
1593
+ retry_policy: @config.rpcs.cancel_operation.retry_policy
1594
+ options.apply_defaults metadata: @config.metadata,
1595
+ retry_policy: @config.retry_policy
1596
+
1597
+ @cluster_manager_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
1598
+ yield response, operation if block_given?
1599
+ return response
1600
+ end
1601
+ rescue GRPC::BadStatus => e
1602
+ raise Google::Cloud::Error.from_error(e)
1603
+ end
1604
+
1605
+ ##
1606
+ # Returns configuration info about the Google Kubernetes Engine service.
1607
+ #
1608
+ # @overload get_server_config(request, options = nil)
1609
+ # Pass arguments to `get_server_config` via a request object, either of type
1610
+ # {Google::Cloud::Container::V1::GetServerConfigRequest} or an equivalent Hash.
1611
+ #
1612
+ # @param request [Google::Cloud::Container::V1::GetServerConfigRequest, Hash]
1613
+ # A request object representing the call parameters. Required. To specify no
1614
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1615
+ # @param options [Gapic::CallOptions, Hash]
1616
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1617
+ #
1618
+ # @overload get_server_config(project_id: nil, zone: nil, name: nil)
1619
+ # Pass arguments to `get_server_config` via keyword arguments. Note that at
1620
+ # least one keyword argument is required. To specify no parameters, or to keep all
1621
+ # the default parameter values, pass an empty Hash as a request object (see above).
1622
+ #
1623
+ # @param project_id [String]
1624
+ # Deprecated. The Google Developers Console [project ID or project
1625
+ # number](https://support.google.com/cloud/answer/6158840).
1626
+ # This field has been deprecated and replaced by the name field.
1627
+ # @param zone [String]
1628
+ # Deprecated. The name of the Google Compute Engine
1629
+ # [zone](https://cloud.google.com/compute/docs/zones#available) to return operations for.
1630
+ # This field has been deprecated and replaced by the name field.
1631
+ # @param name [String]
1632
+ # The name (project and location) of the server config to get,
1633
+ # specified in the format `projects/*/locations/*`.
1634
+ #
1635
+ # @yield [response, operation] Access the result along with the RPC operation
1636
+ # @yieldparam response [Google::Cloud::Container::V1::ServerConfig]
1637
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1638
+ #
1639
+ # @return [Google::Cloud::Container::V1::ServerConfig]
1640
+ #
1641
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1642
+ #
1643
+ def get_server_config request, options = nil
1644
+ raise ArgumentError, "request must be provided" if request.nil?
1645
+
1646
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::GetServerConfigRequest
1647
+
1648
+ # Converts hash and nil to an options object
1649
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1650
+
1651
+ # Customize the options with defaults
1652
+ metadata = @config.rpcs.get_server_config.metadata.to_h
1653
+
1654
+ # Set x-goog-api-client and x-goog-user-project headers
1655
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1656
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1657
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
1658
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1659
+
1660
+ header_params = {
1661
+ "name" => request.name
1662
+ }
1663
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1664
+ metadata[:"x-goog-request-params"] ||= request_params_header
1665
+
1666
+ options.apply_defaults timeout: @config.rpcs.get_server_config.timeout,
1667
+ metadata: metadata,
1668
+ retry_policy: @config.rpcs.get_server_config.retry_policy
1669
+ options.apply_defaults metadata: @config.metadata,
1670
+ retry_policy: @config.retry_policy
1671
+
1672
+ @cluster_manager_stub.call_rpc :get_server_config, request, options: options do |response, operation|
1673
+ yield response, operation if block_given?
1674
+ return response
1675
+ end
1676
+ rescue GRPC::BadStatus => e
1677
+ raise Google::Cloud::Error.from_error(e)
1678
+ end
1679
+
1680
+ ##
1681
+ # Lists the node pools for a cluster.
1682
+ #
1683
+ # @overload list_node_pools(request, options = nil)
1684
+ # Pass arguments to `list_node_pools` via a request object, either of type
1685
+ # {Google::Cloud::Container::V1::ListNodePoolsRequest} or an equivalent Hash.
1686
+ #
1687
+ # @param request [Google::Cloud::Container::V1::ListNodePoolsRequest, Hash]
1688
+ # A request object representing the call parameters. Required. To specify no
1689
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1690
+ # @param options [Gapic::CallOptions, Hash]
1691
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1692
+ #
1693
+ # @overload list_node_pools(project_id: nil, zone: nil, cluster_id: nil, parent: nil)
1694
+ # Pass arguments to `list_node_pools` via keyword arguments. Note that at
1695
+ # least one keyword argument is required. To specify no parameters, or to keep all
1696
+ # the default parameter values, pass an empty Hash as a request object (see above).
1697
+ #
1698
+ # @param project_id [String]
1699
+ # Deprecated. The Google Developers Console [project ID or project
1700
+ # number](https://developers.google.com/console/help/new/#projectnumber).
1701
+ # This field has been deprecated and replaced by the parent field.
1702
+ # @param zone [String]
1703
+ # Deprecated. The name of the Google Compute Engine
1704
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
1705
+ # resides.
1706
+ # This field has been deprecated and replaced by the parent field.
1707
+ # @param cluster_id [String]
1708
+ # Deprecated. The name of the cluster.
1709
+ # This field has been deprecated and replaced by the parent field.
1710
+ # @param parent [String]
1711
+ # The parent (project, location, cluster id) where the node pools will be
1712
+ # listed. Specified in the format `projects/*/locations/*/clusters/*`.
1713
+ #
1714
+ # @yield [response, operation] Access the result along with the RPC operation
1715
+ # @yieldparam response [Google::Cloud::Container::V1::ListNodePoolsResponse]
1716
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1717
+ #
1718
+ # @return [Google::Cloud::Container::V1::ListNodePoolsResponse]
1719
+ #
1720
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1721
+ #
1722
+ def list_node_pools request, options = nil
1723
+ raise ArgumentError, "request must be provided" if request.nil?
1724
+
1725
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::ListNodePoolsRequest
1726
+
1727
+ # Converts hash and nil to an options object
1728
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1729
+
1730
+ # Customize the options with defaults
1731
+ metadata = @config.rpcs.list_node_pools.metadata.to_h
1732
+
1733
+ # Set x-goog-api-client and x-goog-user-project headers
1734
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1735
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1736
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
1737
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1738
+
1739
+ header_params = {
1740
+ "parent" => request.parent
1741
+ }
1742
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1743
+ metadata[:"x-goog-request-params"] ||= request_params_header
1744
+
1745
+ options.apply_defaults timeout: @config.rpcs.list_node_pools.timeout,
1746
+ metadata: metadata,
1747
+ retry_policy: @config.rpcs.list_node_pools.retry_policy
1748
+ options.apply_defaults metadata: @config.metadata,
1749
+ retry_policy: @config.retry_policy
1750
+
1751
+ @cluster_manager_stub.call_rpc :list_node_pools, request, options: options do |response, operation|
1752
+ yield response, operation if block_given?
1753
+ return response
1754
+ end
1755
+ rescue GRPC::BadStatus => e
1756
+ raise Google::Cloud::Error.from_error(e)
1757
+ end
1758
+
1759
+ ##
1760
+ # Retrieves the requested node pool.
1761
+ #
1762
+ # @overload get_node_pool(request, options = nil)
1763
+ # Pass arguments to `get_node_pool` via a request object, either of type
1764
+ # {Google::Cloud::Container::V1::GetNodePoolRequest} or an equivalent Hash.
1765
+ #
1766
+ # @param request [Google::Cloud::Container::V1::GetNodePoolRequest, Hash]
1767
+ # A request object representing the call parameters. Required. To specify no
1768
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1769
+ # @param options [Gapic::CallOptions, Hash]
1770
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1771
+ #
1772
+ # @overload get_node_pool(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, name: nil)
1773
+ # Pass arguments to `get_node_pool` via keyword arguments. Note that at
1774
+ # least one keyword argument is required. To specify no parameters, or to keep all
1775
+ # the default parameter values, pass an empty Hash as a request object (see above).
1776
+ #
1777
+ # @param project_id [String]
1778
+ # Deprecated. The Google Developers Console [project ID or project
1779
+ # number](https://developers.google.com/console/help/new/#projectnumber).
1780
+ # This field has been deprecated and replaced by the name field.
1781
+ # @param zone [String]
1782
+ # Deprecated. The name of the Google Compute Engine
1783
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
1784
+ # resides.
1785
+ # This field has been deprecated and replaced by the name field.
1786
+ # @param cluster_id [String]
1787
+ # Deprecated. The name of the cluster.
1788
+ # This field has been deprecated and replaced by the name field.
1789
+ # @param node_pool_id [String]
1790
+ # Deprecated. The name of the node pool.
1791
+ # This field has been deprecated and replaced by the name field.
1792
+ # @param name [String]
1793
+ # The name (project, location, cluster, node pool id) of the node pool to
1794
+ # get. Specified in the format
1795
+ # `projects/*/locations/*/clusters/*/nodePools/*`.
1796
+ #
1797
+ # @yield [response, operation] Access the result along with the RPC operation
1798
+ # @yieldparam response [Google::Cloud::Container::V1::NodePool]
1799
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1800
+ #
1801
+ # @return [Google::Cloud::Container::V1::NodePool]
1802
+ #
1803
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1804
+ #
1805
+ def get_node_pool request, options = nil
1806
+ raise ArgumentError, "request must be provided" if request.nil?
1807
+
1808
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::GetNodePoolRequest
1809
+
1810
+ # Converts hash and nil to an options object
1811
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1812
+
1813
+ # Customize the options with defaults
1814
+ metadata = @config.rpcs.get_node_pool.metadata.to_h
1815
+
1816
+ # Set x-goog-api-client and x-goog-user-project headers
1817
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1818
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1819
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
1820
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1821
+
1822
+ header_params = {
1823
+ "name" => request.name
1824
+ }
1825
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1826
+ metadata[:"x-goog-request-params"] ||= request_params_header
1827
+
1828
+ options.apply_defaults timeout: @config.rpcs.get_node_pool.timeout,
1829
+ metadata: metadata,
1830
+ retry_policy: @config.rpcs.get_node_pool.retry_policy
1831
+ options.apply_defaults metadata: @config.metadata,
1832
+ retry_policy: @config.retry_policy
1833
+
1834
+ @cluster_manager_stub.call_rpc :get_node_pool, request, options: options do |response, operation|
1835
+ yield response, operation if block_given?
1836
+ return response
1837
+ end
1838
+ rescue GRPC::BadStatus => e
1839
+ raise Google::Cloud::Error.from_error(e)
1840
+ end
1841
+
1842
+ ##
1843
+ # Creates a node pool for a cluster.
1844
+ #
1845
+ # @overload create_node_pool(request, options = nil)
1846
+ # Pass arguments to `create_node_pool` via a request object, either of type
1847
+ # {Google::Cloud::Container::V1::CreateNodePoolRequest} or an equivalent Hash.
1848
+ #
1849
+ # @param request [Google::Cloud::Container::V1::CreateNodePoolRequest, Hash]
1850
+ # A request object representing the call parameters. Required. To specify no
1851
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1852
+ # @param options [Gapic::CallOptions, Hash]
1853
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1854
+ #
1855
+ # @overload create_node_pool(project_id: nil, zone: nil, cluster_id: nil, node_pool: nil, parent: nil)
1856
+ # Pass arguments to `create_node_pool` via keyword arguments. Note that at
1857
+ # least one keyword argument is required. To specify no parameters, or to keep all
1858
+ # the default parameter values, pass an empty Hash as a request object (see above).
1859
+ #
1860
+ # @param project_id [String]
1861
+ # Deprecated. The Google Developers Console [project ID or project
1862
+ # number](https://developers.google.com/console/help/new/#projectnumber).
1863
+ # This field has been deprecated and replaced by the parent field.
1864
+ # @param zone [String]
1865
+ # Deprecated. The name of the Google Compute Engine
1866
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
1867
+ # resides.
1868
+ # This field has been deprecated and replaced by the parent field.
1869
+ # @param cluster_id [String]
1870
+ # Deprecated. The name of the cluster.
1871
+ # This field has been deprecated and replaced by the parent field.
1872
+ # @param node_pool [Google::Cloud::Container::V1::NodePool, Hash]
1873
+ # Required. The node pool to create.
1874
+ # @param parent [String]
1875
+ # The parent (project, location, cluster id) where the node pool will be
1876
+ # created. Specified in the format
1877
+ # `projects/*/locations/*/clusters/*`.
1878
+ #
1879
+ # @yield [response, operation] Access the result along with the RPC operation
1880
+ # @yieldparam response [Google::Cloud::Container::V1::Operation]
1881
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1882
+ #
1883
+ # @return [Google::Cloud::Container::V1::Operation]
1884
+ #
1885
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1886
+ #
1887
+ def create_node_pool request, options = nil
1888
+ raise ArgumentError, "request must be provided" if request.nil?
1889
+
1890
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::CreateNodePoolRequest
1891
+
1892
+ # Converts hash and nil to an options object
1893
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1894
+
1895
+ # Customize the options with defaults
1896
+ metadata = @config.rpcs.create_node_pool.metadata.to_h
1897
+
1898
+ # Set x-goog-api-client and x-goog-user-project headers
1899
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1900
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1901
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
1902
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1903
+
1904
+ header_params = {
1905
+ "parent" => request.parent
1906
+ }
1907
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1908
+ metadata[:"x-goog-request-params"] ||= request_params_header
1909
+
1910
+ options.apply_defaults timeout: @config.rpcs.create_node_pool.timeout,
1911
+ metadata: metadata,
1912
+ retry_policy: @config.rpcs.create_node_pool.retry_policy
1913
+ options.apply_defaults metadata: @config.metadata,
1914
+ retry_policy: @config.retry_policy
1915
+
1916
+ @cluster_manager_stub.call_rpc :create_node_pool, request, options: options do |response, operation|
1917
+ yield response, operation if block_given?
1918
+ return response
1919
+ end
1920
+ rescue GRPC::BadStatus => e
1921
+ raise Google::Cloud::Error.from_error(e)
1922
+ end
1923
+
1924
+ ##
1925
+ # Deletes a node pool from a cluster.
1926
+ #
1927
+ # @overload delete_node_pool(request, options = nil)
1928
+ # Pass arguments to `delete_node_pool` via a request object, either of type
1929
+ # {Google::Cloud::Container::V1::DeleteNodePoolRequest} or an equivalent Hash.
1930
+ #
1931
+ # @param request [Google::Cloud::Container::V1::DeleteNodePoolRequest, Hash]
1932
+ # A request object representing the call parameters. Required. To specify no
1933
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1934
+ # @param options [Gapic::CallOptions, Hash]
1935
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1936
+ #
1937
+ # @overload delete_node_pool(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, name: nil)
1938
+ # Pass arguments to `delete_node_pool` via keyword arguments. Note that at
1939
+ # least one keyword argument is required. To specify no parameters, or to keep all
1940
+ # the default parameter values, pass an empty Hash as a request object (see above).
1941
+ #
1942
+ # @param project_id [String]
1943
+ # Deprecated. The Google Developers Console [project ID or project
1944
+ # number](https://developers.google.com/console/help/new/#projectnumber).
1945
+ # This field has been deprecated and replaced by the name field.
1946
+ # @param zone [String]
1947
+ # Deprecated. The name of the Google Compute Engine
1948
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
1949
+ # resides.
1950
+ # This field has been deprecated and replaced by the name field.
1951
+ # @param cluster_id [String]
1952
+ # Deprecated. The name of the cluster.
1953
+ # This field has been deprecated and replaced by the name field.
1954
+ # @param node_pool_id [String]
1955
+ # Deprecated. The name of the node pool to delete.
1956
+ # This field has been deprecated and replaced by the name field.
1957
+ # @param name [String]
1958
+ # The name (project, location, cluster, node pool id) of the node pool to
1959
+ # delete. Specified in the format
1960
+ # `projects/*/locations/*/clusters/*/nodePools/*`.
1961
+ #
1962
+ # @yield [response, operation] Access the result along with the RPC operation
1963
+ # @yieldparam response [Google::Cloud::Container::V1::Operation]
1964
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1965
+ #
1966
+ # @return [Google::Cloud::Container::V1::Operation]
1967
+ #
1968
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1969
+ #
1970
+ def delete_node_pool request, options = nil
1971
+ raise ArgumentError, "request must be provided" if request.nil?
1972
+
1973
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::DeleteNodePoolRequest
1974
+
1975
+ # Converts hash and nil to an options object
1976
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1977
+
1978
+ # Customize the options with defaults
1979
+ metadata = @config.rpcs.delete_node_pool.metadata.to_h
1980
+
1981
+ # Set x-goog-api-client and x-goog-user-project headers
1982
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1983
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1984
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
1985
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1986
+
1987
+ header_params = {
1988
+ "name" => request.name
1989
+ }
1990
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1991
+ metadata[:"x-goog-request-params"] ||= request_params_header
1992
+
1993
+ options.apply_defaults timeout: @config.rpcs.delete_node_pool.timeout,
1994
+ metadata: metadata,
1995
+ retry_policy: @config.rpcs.delete_node_pool.retry_policy
1996
+ options.apply_defaults metadata: @config.metadata,
1997
+ retry_policy: @config.retry_policy
1998
+
1999
+ @cluster_manager_stub.call_rpc :delete_node_pool, request, options: options do |response, operation|
2000
+ yield response, operation if block_given?
2001
+ return response
2002
+ end
2003
+ rescue GRPC::BadStatus => e
2004
+ raise Google::Cloud::Error.from_error(e)
2005
+ end
2006
+
2007
+ ##
2008
+ # Rolls back a previously Aborted or Failed NodePool upgrade.
2009
+ # This makes no changes if the last upgrade successfully completed.
2010
+ #
2011
+ # @overload rollback_node_pool_upgrade(request, options = nil)
2012
+ # Pass arguments to `rollback_node_pool_upgrade` via a request object, either of type
2013
+ # {Google::Cloud::Container::V1::RollbackNodePoolUpgradeRequest} or an equivalent Hash.
2014
+ #
2015
+ # @param request [Google::Cloud::Container::V1::RollbackNodePoolUpgradeRequest, Hash]
2016
+ # A request object representing the call parameters. Required. To specify no
2017
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2018
+ # @param options [Gapic::CallOptions, Hash]
2019
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2020
+ #
2021
+ # @overload rollback_node_pool_upgrade(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, name: nil)
2022
+ # Pass arguments to `rollback_node_pool_upgrade` via keyword arguments. Note that at
2023
+ # least one keyword argument is required. To specify no parameters, or to keep all
2024
+ # the default parameter values, pass an empty Hash as a request object (see above).
2025
+ #
2026
+ # @param project_id [String]
2027
+ # Deprecated. The Google Developers Console [project ID or project
2028
+ # number](https://support.google.com/cloud/answer/6158840).
2029
+ # This field has been deprecated and replaced by the name field.
2030
+ # @param zone [String]
2031
+ # Deprecated. The name of the Google Compute Engine
2032
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
2033
+ # resides.
2034
+ # This field has been deprecated and replaced by the name field.
2035
+ # @param cluster_id [String]
2036
+ # Deprecated. The name of the cluster to rollback.
2037
+ # This field has been deprecated and replaced by the name field.
2038
+ # @param node_pool_id [String]
2039
+ # Deprecated. The name of the node pool to rollback.
2040
+ # This field has been deprecated and replaced by the name field.
2041
+ # @param name [String]
2042
+ # The name (project, location, cluster, node pool id) of the node poll to
2043
+ # rollback upgrade.
2044
+ # Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`.
2045
+ #
2046
+ # @yield [response, operation] Access the result along with the RPC operation
2047
+ # @yieldparam response [Google::Cloud::Container::V1::Operation]
2048
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
2049
+ #
2050
+ # @return [Google::Cloud::Container::V1::Operation]
2051
+ #
2052
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
2053
+ #
2054
+ def rollback_node_pool_upgrade request, options = nil
2055
+ raise ArgumentError, "request must be provided" if request.nil?
2056
+
2057
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::RollbackNodePoolUpgradeRequest
2058
+
2059
+ # Converts hash and nil to an options object
2060
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2061
+
2062
+ # Customize the options with defaults
2063
+ metadata = @config.rpcs.rollback_node_pool_upgrade.metadata.to_h
2064
+
2065
+ # Set x-goog-api-client and x-goog-user-project headers
2066
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
2067
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2068
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
2069
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2070
+
2071
+ header_params = {
2072
+ "name" => request.name
2073
+ }
2074
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2075
+ metadata[:"x-goog-request-params"] ||= request_params_header
2076
+
2077
+ options.apply_defaults timeout: @config.rpcs.rollback_node_pool_upgrade.timeout,
2078
+ metadata: metadata,
2079
+ retry_policy: @config.rpcs.rollback_node_pool_upgrade.retry_policy
2080
+ options.apply_defaults metadata: @config.metadata,
2081
+ retry_policy: @config.retry_policy
2082
+
2083
+ @cluster_manager_stub.call_rpc :rollback_node_pool_upgrade, request, options: options do |response, operation|
2084
+ yield response, operation if block_given?
2085
+ return response
2086
+ end
2087
+ rescue GRPC::BadStatus => e
2088
+ raise Google::Cloud::Error.from_error(e)
2089
+ end
2090
+
2091
+ ##
2092
+ # Sets the NodeManagement options for a node pool.
2093
+ #
2094
+ # @overload set_node_pool_management(request, options = nil)
2095
+ # Pass arguments to `set_node_pool_management` via a request object, either of type
2096
+ # {Google::Cloud::Container::V1::SetNodePoolManagementRequest} or an equivalent Hash.
2097
+ #
2098
+ # @param request [Google::Cloud::Container::V1::SetNodePoolManagementRequest, Hash]
2099
+ # A request object representing the call parameters. Required. To specify no
2100
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2101
+ # @param options [Gapic::CallOptions, Hash]
2102
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2103
+ #
2104
+ # @overload set_node_pool_management(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, management: nil, name: nil)
2105
+ # Pass arguments to `set_node_pool_management` via keyword arguments. Note that at
2106
+ # least one keyword argument is required. To specify no parameters, or to keep all
2107
+ # the default parameter values, pass an empty Hash as a request object (see above).
2108
+ #
2109
+ # @param project_id [String]
2110
+ # Deprecated. The Google Developers Console [project ID or project
2111
+ # number](https://support.google.com/cloud/answer/6158840).
2112
+ # This field has been deprecated and replaced by the name field.
2113
+ # @param zone [String]
2114
+ # Deprecated. The name of the Google Compute Engine
2115
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
2116
+ # resides.
2117
+ # This field has been deprecated and replaced by the name field.
2118
+ # @param cluster_id [String]
2119
+ # Deprecated. The name of the cluster to update.
2120
+ # This field has been deprecated and replaced by the name field.
2121
+ # @param node_pool_id [String]
2122
+ # Deprecated. The name of the node pool to update.
2123
+ # This field has been deprecated and replaced by the name field.
2124
+ # @param management [Google::Cloud::Container::V1::NodeManagement, Hash]
2125
+ # Required. NodeManagement configuration for the node pool.
2126
+ # @param name [String]
2127
+ # The name (project, location, cluster, node pool id) of the node pool to set
2128
+ # management properties. Specified in the format
2129
+ # `projects/*/locations/*/clusters/*/nodePools/*`.
2130
+ #
2131
+ # @yield [response, operation] Access the result along with the RPC operation
2132
+ # @yieldparam response [Google::Cloud::Container::V1::Operation]
2133
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
2134
+ #
2135
+ # @return [Google::Cloud::Container::V1::Operation]
2136
+ #
2137
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
2138
+ #
2139
+ def set_node_pool_management request, options = nil
2140
+ raise ArgumentError, "request must be provided" if request.nil?
2141
+
2142
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::SetNodePoolManagementRequest
2143
+
2144
+ # Converts hash and nil to an options object
2145
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2146
+
2147
+ # Customize the options with defaults
2148
+ metadata = @config.rpcs.set_node_pool_management.metadata.to_h
2149
+
2150
+ # Set x-goog-api-client and x-goog-user-project headers
2151
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
2152
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2153
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
2154
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2155
+
2156
+ header_params = {
2157
+ "name" => request.name
2158
+ }
2159
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2160
+ metadata[:"x-goog-request-params"] ||= request_params_header
2161
+
2162
+ options.apply_defaults timeout: @config.rpcs.set_node_pool_management.timeout,
2163
+ metadata: metadata,
2164
+ retry_policy: @config.rpcs.set_node_pool_management.retry_policy
2165
+ options.apply_defaults metadata: @config.metadata,
2166
+ retry_policy: @config.retry_policy
2167
+
2168
+ @cluster_manager_stub.call_rpc :set_node_pool_management, request, options: options do |response, operation|
2169
+ yield response, operation if block_given?
2170
+ return response
2171
+ end
2172
+ rescue GRPC::BadStatus => e
2173
+ raise Google::Cloud::Error.from_error(e)
2174
+ end
2175
+
2176
+ ##
2177
+ # Sets labels on a cluster.
2178
+ #
2179
+ # @overload set_labels(request, options = nil)
2180
+ # Pass arguments to `set_labels` via a request object, either of type
2181
+ # {Google::Cloud::Container::V1::SetLabelsRequest} or an equivalent Hash.
2182
+ #
2183
+ # @param request [Google::Cloud::Container::V1::SetLabelsRequest, Hash]
2184
+ # A request object representing the call parameters. Required. To specify no
2185
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2186
+ # @param options [Gapic::CallOptions, Hash]
2187
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2188
+ #
2189
+ # @overload set_labels(project_id: nil, zone: nil, cluster_id: nil, resource_labels: nil, label_fingerprint: nil, name: nil)
2190
+ # Pass arguments to `set_labels` via keyword arguments. Note that at
2191
+ # least one keyword argument is required. To specify no parameters, or to keep all
2192
+ # the default parameter values, pass an empty Hash as a request object (see above).
2193
+ #
2194
+ # @param project_id [String]
2195
+ # Deprecated. The Google Developers Console [project ID or project
2196
+ # number](https://developers.google.com/console/help/new/#projectnumber).
2197
+ # This field has been deprecated and replaced by the name field.
2198
+ # @param zone [String]
2199
+ # Deprecated. The name of the Google Compute Engine
2200
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
2201
+ # resides.
2202
+ # This field has been deprecated and replaced by the name field.
2203
+ # @param cluster_id [String]
2204
+ # Deprecated. The name of the cluster.
2205
+ # This field has been deprecated and replaced by the name field.
2206
+ # @param resource_labels [Hash{String => String}]
2207
+ # Required. The labels to set for that cluster.
2208
+ # @param label_fingerprint [String]
2209
+ # Required. The fingerprint of the previous set of labels for this resource,
2210
+ # used to detect conflicts. The fingerprint is initially generated by
2211
+ # Kubernetes Engine and changes after every request to modify or update
2212
+ # labels. You must always provide an up-to-date fingerprint hash when
2213
+ # updating or changing labels. Make a <code>get()</code> request to the
2214
+ # resource to get the latest fingerprint.
2215
+ # @param name [String]
2216
+ # The name (project, location, cluster id) of the cluster to set labels.
2217
+ # Specified in the format `projects/*/locations/*/clusters/*`.
2218
+ #
2219
+ # @yield [response, operation] Access the result along with the RPC operation
2220
+ # @yieldparam response [Google::Cloud::Container::V1::Operation]
2221
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
2222
+ #
2223
+ # @return [Google::Cloud::Container::V1::Operation]
2224
+ #
2225
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
2226
+ #
2227
+ def set_labels request, options = nil
2228
+ raise ArgumentError, "request must be provided" if request.nil?
2229
+
2230
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::SetLabelsRequest
2231
+
2232
+ # Converts hash and nil to an options object
2233
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2234
+
2235
+ # Customize the options with defaults
2236
+ metadata = @config.rpcs.set_labels.metadata.to_h
2237
+
2238
+ # Set x-goog-api-client and x-goog-user-project headers
2239
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
2240
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2241
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
2242
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2243
+
2244
+ header_params = {
2245
+ "name" => request.name
2246
+ }
2247
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2248
+ metadata[:"x-goog-request-params"] ||= request_params_header
2249
+
2250
+ options.apply_defaults timeout: @config.rpcs.set_labels.timeout,
2251
+ metadata: metadata,
2252
+ retry_policy: @config.rpcs.set_labels.retry_policy
2253
+ options.apply_defaults metadata: @config.metadata,
2254
+ retry_policy: @config.retry_policy
2255
+
2256
+ @cluster_manager_stub.call_rpc :set_labels, request, options: options do |response, operation|
2257
+ yield response, operation if block_given?
2258
+ return response
2259
+ end
2260
+ rescue GRPC::BadStatus => e
2261
+ raise Google::Cloud::Error.from_error(e)
2262
+ end
2263
+
2264
+ ##
2265
+ # Enables or disables the ABAC authorization mechanism on a cluster.
2266
+ #
2267
+ # @overload set_legacy_abac(request, options = nil)
2268
+ # Pass arguments to `set_legacy_abac` via a request object, either of type
2269
+ # {Google::Cloud::Container::V1::SetLegacyAbacRequest} or an equivalent Hash.
2270
+ #
2271
+ # @param request [Google::Cloud::Container::V1::SetLegacyAbacRequest, Hash]
2272
+ # A request object representing the call parameters. Required. To specify no
2273
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2274
+ # @param options [Gapic::CallOptions, Hash]
2275
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2276
+ #
2277
+ # @overload set_legacy_abac(project_id: nil, zone: nil, cluster_id: nil, enabled: nil, name: nil)
2278
+ # Pass arguments to `set_legacy_abac` via keyword arguments. Note that at
2279
+ # least one keyword argument is required. To specify no parameters, or to keep all
2280
+ # the default parameter values, pass an empty Hash as a request object (see above).
2281
+ #
2282
+ # @param project_id [String]
2283
+ # Deprecated. The Google Developers Console [project ID or project
2284
+ # number](https://support.google.com/cloud/answer/6158840).
2285
+ # This field has been deprecated and replaced by the name field.
2286
+ # @param zone [String]
2287
+ # Deprecated. The name of the Google Compute Engine
2288
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
2289
+ # resides.
2290
+ # This field has been deprecated and replaced by the name field.
2291
+ # @param cluster_id [String]
2292
+ # Deprecated. The name of the cluster to update.
2293
+ # This field has been deprecated and replaced by the name field.
2294
+ # @param enabled [Boolean]
2295
+ # Required. Whether ABAC authorization will be enabled in the cluster.
2296
+ # @param name [String]
2297
+ # The name (project, location, cluster id) of the cluster to set legacy abac.
2298
+ # Specified in the format `projects/*/locations/*/clusters/*`.
2299
+ #
2300
+ # @yield [response, operation] Access the result along with the RPC operation
2301
+ # @yieldparam response [Google::Cloud::Container::V1::Operation]
2302
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
2303
+ #
2304
+ # @return [Google::Cloud::Container::V1::Operation]
2305
+ #
2306
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
2307
+ #
2308
+ def set_legacy_abac request, options = nil
2309
+ raise ArgumentError, "request must be provided" if request.nil?
2310
+
2311
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::SetLegacyAbacRequest
2312
+
2313
+ # Converts hash and nil to an options object
2314
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2315
+
2316
+ # Customize the options with defaults
2317
+ metadata = @config.rpcs.set_legacy_abac.metadata.to_h
2318
+
2319
+ # Set x-goog-api-client and x-goog-user-project headers
2320
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
2321
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2322
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
2323
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2324
+
2325
+ header_params = {
2326
+ "name" => request.name
2327
+ }
2328
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2329
+ metadata[:"x-goog-request-params"] ||= request_params_header
2330
+
2331
+ options.apply_defaults timeout: @config.rpcs.set_legacy_abac.timeout,
2332
+ metadata: metadata,
2333
+ retry_policy: @config.rpcs.set_legacy_abac.retry_policy
2334
+ options.apply_defaults metadata: @config.metadata,
2335
+ retry_policy: @config.retry_policy
2336
+
2337
+ @cluster_manager_stub.call_rpc :set_legacy_abac, request, options: options do |response, operation|
2338
+ yield response, operation if block_given?
2339
+ return response
2340
+ end
2341
+ rescue GRPC::BadStatus => e
2342
+ raise Google::Cloud::Error.from_error(e)
2343
+ end
2344
+
2345
+ ##
2346
+ # Starts master IP rotation.
2347
+ #
2348
+ # @overload start_ip_rotation(request, options = nil)
2349
+ # Pass arguments to `start_ip_rotation` via a request object, either of type
2350
+ # {Google::Cloud::Container::V1::StartIPRotationRequest} or an equivalent Hash.
2351
+ #
2352
+ # @param request [Google::Cloud::Container::V1::StartIPRotationRequest, Hash]
2353
+ # A request object representing the call parameters. Required. To specify no
2354
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2355
+ # @param options [Gapic::CallOptions, Hash]
2356
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2357
+ #
2358
+ # @overload start_ip_rotation(project_id: nil, zone: nil, cluster_id: nil, name: nil, rotate_credentials: nil)
2359
+ # Pass arguments to `start_ip_rotation` via keyword arguments. Note that at
2360
+ # least one keyword argument is required. To specify no parameters, or to keep all
2361
+ # the default parameter values, pass an empty Hash as a request object (see above).
2362
+ #
2363
+ # @param project_id [String]
2364
+ # Deprecated. The Google Developers Console [project ID or project
2365
+ # number](https://developers.google.com/console/help/new/#projectnumber).
2366
+ # This field has been deprecated and replaced by the name field.
2367
+ # @param zone [String]
2368
+ # Deprecated. The name of the Google Compute Engine
2369
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
2370
+ # resides.
2371
+ # This field has been deprecated and replaced by the name field.
2372
+ # @param cluster_id [String]
2373
+ # Deprecated. The name of the cluster.
2374
+ # This field has been deprecated and replaced by the name field.
2375
+ # @param name [String]
2376
+ # The name (project, location, cluster id) of the cluster to start IP
2377
+ # rotation. Specified in the format `projects/*/locations/*/clusters/*`.
2378
+ # @param rotate_credentials [Boolean]
2379
+ # Whether to rotate credentials during IP rotation.
2380
+ #
2381
+ # @yield [response, operation] Access the result along with the RPC operation
2382
+ # @yieldparam response [Google::Cloud::Container::V1::Operation]
2383
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
2384
+ #
2385
+ # @return [Google::Cloud::Container::V1::Operation]
2386
+ #
2387
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
2388
+ #
2389
+ def start_ip_rotation request, options = nil
2390
+ raise ArgumentError, "request must be provided" if request.nil?
2391
+
2392
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::StartIPRotationRequest
2393
+
2394
+ # Converts hash and nil to an options object
2395
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2396
+
2397
+ # Customize the options with defaults
2398
+ metadata = @config.rpcs.start_ip_rotation.metadata.to_h
2399
+
2400
+ # Set x-goog-api-client and x-goog-user-project headers
2401
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
2402
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2403
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
2404
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2405
+
2406
+ header_params = {
2407
+ "name" => request.name
2408
+ }
2409
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2410
+ metadata[:"x-goog-request-params"] ||= request_params_header
2411
+
2412
+ options.apply_defaults timeout: @config.rpcs.start_ip_rotation.timeout,
2413
+ metadata: metadata,
2414
+ retry_policy: @config.rpcs.start_ip_rotation.retry_policy
2415
+ options.apply_defaults metadata: @config.metadata,
2416
+ retry_policy: @config.retry_policy
2417
+
2418
+ @cluster_manager_stub.call_rpc :start_ip_rotation, request, options: options do |response, operation|
2419
+ yield response, operation if block_given?
2420
+ return response
2421
+ end
2422
+ rescue GRPC::BadStatus => e
2423
+ raise Google::Cloud::Error.from_error(e)
2424
+ end
2425
+
2426
+ ##
2427
+ # Completes master IP rotation.
2428
+ #
2429
+ # @overload complete_ip_rotation(request, options = nil)
2430
+ # Pass arguments to `complete_ip_rotation` via a request object, either of type
2431
+ # {Google::Cloud::Container::V1::CompleteIPRotationRequest} or an equivalent Hash.
2432
+ #
2433
+ # @param request [Google::Cloud::Container::V1::CompleteIPRotationRequest, Hash]
2434
+ # A request object representing the call parameters. Required. To specify no
2435
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2436
+ # @param options [Gapic::CallOptions, Hash]
2437
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2438
+ #
2439
+ # @overload complete_ip_rotation(project_id: nil, zone: nil, cluster_id: nil, name: nil)
2440
+ # Pass arguments to `complete_ip_rotation` via keyword arguments. Note that at
2441
+ # least one keyword argument is required. To specify no parameters, or to keep all
2442
+ # the default parameter values, pass an empty Hash as a request object (see above).
2443
+ #
2444
+ # @param project_id [String]
2445
+ # Deprecated. The Google Developers Console [project ID or project
2446
+ # number](https://developers.google.com/console/help/new/#projectnumber).
2447
+ # This field has been deprecated and replaced by the name field.
2448
+ # @param zone [String]
2449
+ # Deprecated. The name of the Google Compute Engine
2450
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
2451
+ # resides.
2452
+ # This field has been deprecated and replaced by the name field.
2453
+ # @param cluster_id [String]
2454
+ # Deprecated. The name of the cluster.
2455
+ # This field has been deprecated and replaced by the name field.
2456
+ # @param name [String]
2457
+ # The name (project, location, cluster id) of the cluster to complete IP
2458
+ # rotation. Specified in the format `projects/*/locations/*/clusters/*`.
2459
+ #
2460
+ # @yield [response, operation] Access the result along with the RPC operation
2461
+ # @yieldparam response [Google::Cloud::Container::V1::Operation]
2462
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
2463
+ #
2464
+ # @return [Google::Cloud::Container::V1::Operation]
2465
+ #
2466
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
2467
+ #
2468
+ def complete_ip_rotation request, options = nil
2469
+ raise ArgumentError, "request must be provided" if request.nil?
2470
+
2471
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::CompleteIPRotationRequest
2472
+
2473
+ # Converts hash and nil to an options object
2474
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2475
+
2476
+ # Customize the options with defaults
2477
+ metadata = @config.rpcs.complete_ip_rotation.metadata.to_h
2478
+
2479
+ # Set x-goog-api-client and x-goog-user-project headers
2480
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
2481
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2482
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
2483
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2484
+
2485
+ header_params = {
2486
+ "name" => request.name
2487
+ }
2488
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2489
+ metadata[:"x-goog-request-params"] ||= request_params_header
2490
+
2491
+ options.apply_defaults timeout: @config.rpcs.complete_ip_rotation.timeout,
2492
+ metadata: metadata,
2493
+ retry_policy: @config.rpcs.complete_ip_rotation.retry_policy
2494
+ options.apply_defaults metadata: @config.metadata,
2495
+ retry_policy: @config.retry_policy
2496
+
2497
+ @cluster_manager_stub.call_rpc :complete_ip_rotation, request, options: options do |response, operation|
2498
+ yield response, operation if block_given?
2499
+ return response
2500
+ end
2501
+ rescue GRPC::BadStatus => e
2502
+ raise Google::Cloud::Error.from_error(e)
2503
+ end
2504
+
2505
+ ##
2506
+ # Sets the size for a specific node pool.
2507
+ #
2508
+ # @overload set_node_pool_size(request, options = nil)
2509
+ # Pass arguments to `set_node_pool_size` via a request object, either of type
2510
+ # {Google::Cloud::Container::V1::SetNodePoolSizeRequest} or an equivalent Hash.
2511
+ #
2512
+ # @param request [Google::Cloud::Container::V1::SetNodePoolSizeRequest, Hash]
2513
+ # A request object representing the call parameters. Required. To specify no
2514
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2515
+ # @param options [Gapic::CallOptions, Hash]
2516
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2517
+ #
2518
+ # @overload set_node_pool_size(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, node_count: nil, name: nil)
2519
+ # Pass arguments to `set_node_pool_size` via keyword arguments. Note that at
2520
+ # least one keyword argument is required. To specify no parameters, or to keep all
2521
+ # the default parameter values, pass an empty Hash as a request object (see above).
2522
+ #
2523
+ # @param project_id [String]
2524
+ # Deprecated. The Google Developers Console [project ID or project
2525
+ # number](https://support.google.com/cloud/answer/6158840).
2526
+ # This field has been deprecated and replaced by the name field.
2527
+ # @param zone [String]
2528
+ # Deprecated. The name of the Google Compute Engine
2529
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
2530
+ # resides.
2531
+ # This field has been deprecated and replaced by the name field.
2532
+ # @param cluster_id [String]
2533
+ # Deprecated. The name of the cluster to update.
2534
+ # This field has been deprecated and replaced by the name field.
2535
+ # @param node_pool_id [String]
2536
+ # Deprecated. The name of the node pool to update.
2537
+ # This field has been deprecated and replaced by the name field.
2538
+ # @param node_count [Integer]
2539
+ # Required. The desired node count for the pool.
2540
+ # @param name [String]
2541
+ # The name (project, location, cluster, node pool id) of the node pool to set
2542
+ # size.
2543
+ # Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`.
2544
+ #
2545
+ # @yield [response, operation] Access the result along with the RPC operation
2546
+ # @yieldparam response [Google::Cloud::Container::V1::Operation]
2547
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
2548
+ #
2549
+ # @return [Google::Cloud::Container::V1::Operation]
2550
+ #
2551
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
2552
+ #
2553
+ def set_node_pool_size request, options = nil
2554
+ raise ArgumentError, "request must be provided" if request.nil?
2555
+
2556
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::SetNodePoolSizeRequest
2557
+
2558
+ # Converts hash and nil to an options object
2559
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2560
+
2561
+ # Customize the options with defaults
2562
+ metadata = @config.rpcs.set_node_pool_size.metadata.to_h
2563
+
2564
+ # Set x-goog-api-client and x-goog-user-project headers
2565
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
2566
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2567
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
2568
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2569
+
2570
+ header_params = {
2571
+ "name" => request.name
2572
+ }
2573
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2574
+ metadata[:"x-goog-request-params"] ||= request_params_header
2575
+
2576
+ options.apply_defaults timeout: @config.rpcs.set_node_pool_size.timeout,
2577
+ metadata: metadata,
2578
+ retry_policy: @config.rpcs.set_node_pool_size.retry_policy
2579
+ options.apply_defaults metadata: @config.metadata,
2580
+ retry_policy: @config.retry_policy
2581
+
2582
+ @cluster_manager_stub.call_rpc :set_node_pool_size, request, options: options do |response, operation|
2583
+ yield response, operation if block_given?
2584
+ return response
2585
+ end
2586
+ rescue GRPC::BadStatus => e
2587
+ raise Google::Cloud::Error.from_error(e)
2588
+ end
2589
+
2590
+ ##
2591
+ # Enables or disables Network Policy for a cluster.
2592
+ #
2593
+ # @overload set_network_policy(request, options = nil)
2594
+ # Pass arguments to `set_network_policy` via a request object, either of type
2595
+ # {Google::Cloud::Container::V1::SetNetworkPolicyRequest} or an equivalent Hash.
2596
+ #
2597
+ # @param request [Google::Cloud::Container::V1::SetNetworkPolicyRequest, Hash]
2598
+ # A request object representing the call parameters. Required. To specify no
2599
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2600
+ # @param options [Gapic::CallOptions, Hash]
2601
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2602
+ #
2603
+ # @overload set_network_policy(project_id: nil, zone: nil, cluster_id: nil, network_policy: nil, name: nil)
2604
+ # Pass arguments to `set_network_policy` via keyword arguments. Note that at
2605
+ # least one keyword argument is required. To specify no parameters, or to keep all
2606
+ # the default parameter values, pass an empty Hash as a request object (see above).
2607
+ #
2608
+ # @param project_id [String]
2609
+ # Deprecated. The Google Developers Console [project ID or project
2610
+ # number](https://developers.google.com/console/help/new/#projectnumber).
2611
+ # This field has been deprecated and replaced by the name field.
2612
+ # @param zone [String]
2613
+ # Deprecated. The name of the Google Compute Engine
2614
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
2615
+ # resides.
2616
+ # This field has been deprecated and replaced by the name field.
2617
+ # @param cluster_id [String]
2618
+ # Deprecated. The name of the cluster.
2619
+ # This field has been deprecated and replaced by the name field.
2620
+ # @param network_policy [Google::Cloud::Container::V1::NetworkPolicy, Hash]
2621
+ # Required. Configuration options for the NetworkPolicy feature.
2622
+ # @param name [String]
2623
+ # The name (project, location, cluster id) of the cluster to set networking
2624
+ # policy. Specified in the format `projects/*/locations/*/clusters/*`.
2625
+ #
2626
+ # @yield [response, operation] Access the result along with the RPC operation
2627
+ # @yieldparam response [Google::Cloud::Container::V1::Operation]
2628
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
2629
+ #
2630
+ # @return [Google::Cloud::Container::V1::Operation]
2631
+ #
2632
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
2633
+ #
2634
+ def set_network_policy request, options = nil
2635
+ raise ArgumentError, "request must be provided" if request.nil?
2636
+
2637
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::SetNetworkPolicyRequest
2638
+
2639
+ # Converts hash and nil to an options object
2640
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2641
+
2642
+ # Customize the options with defaults
2643
+ metadata = @config.rpcs.set_network_policy.metadata.to_h
2644
+
2645
+ # Set x-goog-api-client and x-goog-user-project headers
2646
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
2647
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2648
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
2649
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2650
+
2651
+ header_params = {
2652
+ "name" => request.name
2653
+ }
2654
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2655
+ metadata[:"x-goog-request-params"] ||= request_params_header
2656
+
2657
+ options.apply_defaults timeout: @config.rpcs.set_network_policy.timeout,
2658
+ metadata: metadata,
2659
+ retry_policy: @config.rpcs.set_network_policy.retry_policy
2660
+ options.apply_defaults metadata: @config.metadata,
2661
+ retry_policy: @config.retry_policy
2662
+
2663
+ @cluster_manager_stub.call_rpc :set_network_policy, request, options: options do |response, operation|
2664
+ yield response, operation if block_given?
2665
+ return response
2666
+ end
2667
+ rescue GRPC::BadStatus => e
2668
+ raise Google::Cloud::Error.from_error(e)
2669
+ end
2670
+
2671
+ ##
2672
+ # Sets the maintenance policy for a cluster.
2673
+ #
2674
+ # @overload set_maintenance_policy(request, options = nil)
2675
+ # Pass arguments to `set_maintenance_policy` via a request object, either of type
2676
+ # {Google::Cloud::Container::V1::SetMaintenancePolicyRequest} or an equivalent Hash.
2677
+ #
2678
+ # @param request [Google::Cloud::Container::V1::SetMaintenancePolicyRequest, Hash]
2679
+ # A request object representing the call parameters. Required. To specify no
2680
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2681
+ # @param options [Gapic::CallOptions, Hash]
2682
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2683
+ #
2684
+ # @overload set_maintenance_policy(project_id: nil, zone: nil, cluster_id: nil, maintenance_policy: nil, name: nil)
2685
+ # Pass arguments to `set_maintenance_policy` via keyword arguments. Note that at
2686
+ # least one keyword argument is required. To specify no parameters, or to keep all
2687
+ # the default parameter values, pass an empty Hash as a request object (see above).
2688
+ #
2689
+ # @param project_id [String]
2690
+ # Required. The Google Developers Console [project ID or project
2691
+ # number](https://support.google.com/cloud/answer/6158840).
2692
+ # @param zone [String]
2693
+ # Required. The name of the Google Compute Engine
2694
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
2695
+ # resides.
2696
+ # @param cluster_id [String]
2697
+ # Required. The name of the cluster to update.
2698
+ # @param maintenance_policy [Google::Cloud::Container::V1::MaintenancePolicy, Hash]
2699
+ # Required. The maintenance policy to be set for the cluster. An empty field
2700
+ # clears the existing maintenance policy.
2701
+ # @param name [String]
2702
+ # The name (project, location, cluster id) of the cluster to set maintenance
2703
+ # policy.
2704
+ # Specified in the format `projects/*/locations/*/clusters/*`.
2705
+ #
2706
+ # @yield [response, operation] Access the result along with the RPC operation
2707
+ # @yieldparam response [Google::Cloud::Container::V1::Operation]
2708
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
2709
+ #
2710
+ # @return [Google::Cloud::Container::V1::Operation]
2711
+ #
2712
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
2713
+ #
2714
+ def set_maintenance_policy request, options = nil
2715
+ raise ArgumentError, "request must be provided" if request.nil?
2716
+
2717
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::SetMaintenancePolicyRequest
2718
+
2719
+ # Converts hash and nil to an options object
2720
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2721
+
2722
+ # Customize the options with defaults
2723
+ metadata = @config.rpcs.set_maintenance_policy.metadata.to_h
2724
+
2725
+ # Set x-goog-api-client and x-goog-user-project headers
2726
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
2727
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2728
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
2729
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2730
+
2731
+ header_params = {
2732
+ "name" => request.name
2733
+ }
2734
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2735
+ metadata[:"x-goog-request-params"] ||= request_params_header
2736
+
2737
+ options.apply_defaults timeout: @config.rpcs.set_maintenance_policy.timeout,
2738
+ metadata: metadata,
2739
+ retry_policy: @config.rpcs.set_maintenance_policy.retry_policy
2740
+ options.apply_defaults metadata: @config.metadata,
2741
+ retry_policy: @config.retry_policy
2742
+
2743
+ @cluster_manager_stub.call_rpc :set_maintenance_policy, request, options: options do |response, operation|
2744
+ yield response, operation if block_given?
2745
+ return response
2746
+ end
2747
+ rescue GRPC::BadStatus => e
2748
+ raise Google::Cloud::Error.from_error(e)
2749
+ end
2750
+
2751
+ ##
2752
+ # Lists subnetworks that are usable for creating clusters in a project.
2753
+ #
2754
+ # @overload list_usable_subnetworks(request, options = nil)
2755
+ # Pass arguments to `list_usable_subnetworks` via a request object, either of type
2756
+ # {Google::Cloud::Container::V1::ListUsableSubnetworksRequest} or an equivalent Hash.
2757
+ #
2758
+ # @param request [Google::Cloud::Container::V1::ListUsableSubnetworksRequest, Hash]
2759
+ # A request object representing the call parameters. Required. To specify no
2760
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2761
+ # @param options [Gapic::CallOptions, Hash]
2762
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2763
+ #
2764
+ # @overload list_usable_subnetworks(parent: nil, filter: nil, page_size: nil, page_token: nil)
2765
+ # Pass arguments to `list_usable_subnetworks` via keyword arguments. Note that at
2766
+ # least one keyword argument is required. To specify no parameters, or to keep all
2767
+ # the default parameter values, pass an empty Hash as a request object (see above).
2768
+ #
2769
+ # @param parent [String]
2770
+ # The parent project where subnetworks are usable.
2771
+ # Specified in the format `projects/*`.
2772
+ # @param filter [String]
2773
+ # Filtering currently only supports equality on the networkProjectId and must
2774
+ # be in the form: "networkProjectId=[PROJECTID]", where `networkProjectId`
2775
+ # is the project which owns the listed subnetworks. This defaults to the
2776
+ # parent project ID.
2777
+ # @param page_size [Integer]
2778
+ # The max number of results per page that should be returned. If the number
2779
+ # of available results is larger than `page_size`, a `next_page_token` is
2780
+ # returned which can be used to get the next page of results in subsequent
2781
+ # requests. Acceptable values are 0 to 500, inclusive. (Default: 500)
2782
+ # @param page_token [String]
2783
+ # Specifies a page token to use. Set this to the nextPageToken returned by
2784
+ # previous list requests to get the next page of results.
2785
+ #
2786
+ # @yield [response, operation] Access the result along with the RPC operation
2787
+ # @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::Container::V1::UsableSubnetwork>]
2788
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
2789
+ #
2790
+ # @return [Gapic::PagedEnumerable<Google::Cloud::Container::V1::UsableSubnetwork>]
2791
+ #
2792
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
2793
+ #
2794
+ def list_usable_subnetworks request, options = nil
2795
+ raise ArgumentError, "request must be provided" if request.nil?
2796
+
2797
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Container::V1::ListUsableSubnetworksRequest
2798
+
2799
+ # Converts hash and nil to an options object
2800
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2801
+
2802
+ # Customize the options with defaults
2803
+ metadata = @config.rpcs.list_usable_subnetworks.metadata.to_h
2804
+
2805
+ # Set x-goog-api-client and x-goog-user-project headers
2806
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
2807
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2808
+ gapic_version: ::Google::Cloud::Container::V1::VERSION
2809
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2810
+
2811
+ header_params = {
2812
+ "parent" => request.parent
2813
+ }
2814
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2815
+ metadata[:"x-goog-request-params"] ||= request_params_header
2816
+
2817
+ options.apply_defaults timeout: @config.rpcs.list_usable_subnetworks.timeout,
2818
+ metadata: metadata,
2819
+ retry_policy: @config.rpcs.list_usable_subnetworks.retry_policy
2820
+ options.apply_defaults metadata: @config.metadata,
2821
+ retry_policy: @config.retry_policy
2822
+
2823
+ @cluster_manager_stub.call_rpc :list_usable_subnetworks, request, options: options do |response, operation|
2824
+ response = Gapic::PagedEnumerable.new @cluster_manager_stub, :list_usable_subnetworks, request, response, operation, options
2825
+ yield response, operation if block_given?
2826
+ return response
2827
+ end
2828
+ rescue GRPC::BadStatus => e
2829
+ raise Google::Cloud::Error.from_error(e)
2830
+ end
2831
+
2832
+ ##
2833
+ # Configuration class for the ClusterManager API.
2834
+ #
2835
+ # This class represents the configuration for ClusterManager,
2836
+ # providing control over timeouts, retry behavior, logging, transport
2837
+ # parameters, and other low-level controls. Certain parameters can also be
2838
+ # applied individually to specific RPCs. See
2839
+ # {Google::Cloud::Container::V1::ClusterManager::Client::Configuration::Rpcs}
2840
+ # for a list of RPCs that can be configured independently.
2841
+ #
2842
+ # Configuration can be applied globally to all clients, or to a single client
2843
+ # on construction.
2844
+ #
2845
+ # # Examples
2846
+ #
2847
+ # To modify the global config, setting the timeout for list_clusters
2848
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
2849
+ #
2850
+ # Google::Cloud::Container::V1::ClusterManager::Client.configure do |config|
2851
+ # config.timeout = 10_000
2852
+ # config.rpcs.list_clusters.timeout = 20_000
2853
+ # end
2854
+ #
2855
+ # To apply the above configuration only to a new client:
2856
+ #
2857
+ # client = Google::Cloud::Container::V1::ClusterManager::Client.new do |config|
2858
+ # config.timeout = 10_000
2859
+ # config.rpcs.list_clusters.timeout = 20_000
2860
+ # end
2861
+ #
2862
+ # @!attribute [rw] endpoint
2863
+ # The hostname or hostname:port of the service endpoint.
2864
+ # Defaults to `"container.googleapis.com"`.
2865
+ # @return [String]
2866
+ # @!attribute [rw] credentials
2867
+ # Credentials to send with calls. You may provide any of the following types:
2868
+ # * (`String`) The path to a service account key file in JSON format
2869
+ # * (`Hash`) A service account key as a Hash
2870
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
2871
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
2872
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2873
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
2874
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
2875
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
2876
+ # * (`nil`) indicating no credentials
2877
+ # @return [Object]
2878
+ # @!attribute [rw] scope
2879
+ # The OAuth scopes
2880
+ # @return [Array<String>]
2881
+ # @!attribute [rw] lib_name
2882
+ # The library name as recorded in instrumentation and logging
2883
+ # @return [String]
2884
+ # @!attribute [rw] lib_version
2885
+ # The library version as recorded in instrumentation and logging
2886
+ # @return [String]
2887
+ # @!attribute [rw] channel_args
2888
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
2889
+ # `GRPC::Core::Channel` object is provided as the credential.
2890
+ # @return [Hash]
2891
+ # @!attribute [rw] interceptors
2892
+ # An array of interceptors that are run before calls are executed.
2893
+ # @return [Array<GRPC::ClientInterceptor>]
2894
+ # @!attribute [rw] timeout
2895
+ # The call timeout in milliseconds.
2896
+ # @return [Numeric]
2897
+ # @!attribute [rw] metadata
2898
+ # Additional gRPC headers to be sent with the call.
2899
+ # @return [Hash{Symbol=>String}]
2900
+ # @!attribute [rw] retry_policy
2901
+ # The retry policy. The value is a hash with the following keys:
2902
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2903
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2904
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2905
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2906
+ # trigger a retry.
2907
+ # @return [Hash]
2908
+ #
2909
+ class Configuration
2910
+ extend Gapic::Config
2911
+
2912
+ config_attr :endpoint, "container.googleapis.com", String
2913
+ config_attr :credentials, nil do |value|
2914
+ allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2915
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
2916
+ allowed.any? { |klass| klass === value }
2917
+ end
2918
+ config_attr :scope, nil, String, Array, nil
2919
+ config_attr :lib_name, nil, String, nil
2920
+ config_attr :lib_version, nil, String, nil
2921
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, Hash, nil)
2922
+ config_attr :interceptors, nil, Array, nil
2923
+ config_attr :timeout, nil, Numeric, nil
2924
+ config_attr :metadata, nil, Hash, nil
2925
+ config_attr :retry_policy, nil, Hash, Proc, nil
2926
+
2927
+ # @private
2928
+ def initialize parent_config = nil
2929
+ @parent_config = parent_config unless parent_config.nil?
2930
+
2931
+ yield self if block_given?
2932
+ end
2933
+
2934
+ ##
2935
+ # Configurations for individual RPCs
2936
+ # @return [Rpcs]
2937
+ #
2938
+ def rpcs
2939
+ @rpcs ||= begin
2940
+ parent_rpcs = nil
2941
+ parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
2942
+ Rpcs.new parent_rpcs
2943
+ end
2944
+ end
2945
+
2946
+ ##
2947
+ # Configuration RPC class for the ClusterManager API.
2948
+ #
2949
+ # Includes fields providing the configuration for each RPC in this service.
2950
+ # Each configuration object is of type `Gapic::Config::Method` and includes
2951
+ # the following configuration fields:
2952
+ #
2953
+ # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
2954
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
2955
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
2956
+ # include the following keys:
2957
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2958
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2959
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2960
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2961
+ # trigger a retry.
2962
+ #
2963
+ class Rpcs
2964
+ ##
2965
+ # RPC-specific configuration for `list_clusters`
2966
+ # @return [Gapic::Config::Method]
2967
+ #
2968
+ attr_reader :list_clusters
2969
+ ##
2970
+ # RPC-specific configuration for `get_cluster`
2971
+ # @return [Gapic::Config::Method]
2972
+ #
2973
+ attr_reader :get_cluster
2974
+ ##
2975
+ # RPC-specific configuration for `create_cluster`
2976
+ # @return [Gapic::Config::Method]
2977
+ #
2978
+ attr_reader :create_cluster
2979
+ ##
2980
+ # RPC-specific configuration for `update_cluster`
2981
+ # @return [Gapic::Config::Method]
2982
+ #
2983
+ attr_reader :update_cluster
2984
+ ##
2985
+ # RPC-specific configuration for `update_node_pool`
2986
+ # @return [Gapic::Config::Method]
2987
+ #
2988
+ attr_reader :update_node_pool
2989
+ ##
2990
+ # RPC-specific configuration for `set_node_pool_autoscaling`
2991
+ # @return [Gapic::Config::Method]
2992
+ #
2993
+ attr_reader :set_node_pool_autoscaling
2994
+ ##
2995
+ # RPC-specific configuration for `set_logging_service`
2996
+ # @return [Gapic::Config::Method]
2997
+ #
2998
+ attr_reader :set_logging_service
2999
+ ##
3000
+ # RPC-specific configuration for `set_monitoring_service`
3001
+ # @return [Gapic::Config::Method]
3002
+ #
3003
+ attr_reader :set_monitoring_service
3004
+ ##
3005
+ # RPC-specific configuration for `set_addons_config`
3006
+ # @return [Gapic::Config::Method]
3007
+ #
3008
+ attr_reader :set_addons_config
3009
+ ##
3010
+ # RPC-specific configuration for `set_locations`
3011
+ # @return [Gapic::Config::Method]
3012
+ #
3013
+ attr_reader :set_locations
3014
+ ##
3015
+ # RPC-specific configuration for `update_master`
3016
+ # @return [Gapic::Config::Method]
3017
+ #
3018
+ attr_reader :update_master
3019
+ ##
3020
+ # RPC-specific configuration for `set_master_auth`
3021
+ # @return [Gapic::Config::Method]
3022
+ #
3023
+ attr_reader :set_master_auth
3024
+ ##
3025
+ # RPC-specific configuration for `delete_cluster`
3026
+ # @return [Gapic::Config::Method]
3027
+ #
3028
+ attr_reader :delete_cluster
3029
+ ##
3030
+ # RPC-specific configuration for `list_operations`
3031
+ # @return [Gapic::Config::Method]
3032
+ #
3033
+ attr_reader :list_operations
3034
+ ##
3035
+ # RPC-specific configuration for `get_operation`
3036
+ # @return [Gapic::Config::Method]
3037
+ #
3038
+ attr_reader :get_operation
3039
+ ##
3040
+ # RPC-specific configuration for `cancel_operation`
3041
+ # @return [Gapic::Config::Method]
3042
+ #
3043
+ attr_reader :cancel_operation
3044
+ ##
3045
+ # RPC-specific configuration for `get_server_config`
3046
+ # @return [Gapic::Config::Method]
3047
+ #
3048
+ attr_reader :get_server_config
3049
+ ##
3050
+ # RPC-specific configuration for `list_node_pools`
3051
+ # @return [Gapic::Config::Method]
3052
+ #
3053
+ attr_reader :list_node_pools
3054
+ ##
3055
+ # RPC-specific configuration for `get_node_pool`
3056
+ # @return [Gapic::Config::Method]
3057
+ #
3058
+ attr_reader :get_node_pool
3059
+ ##
3060
+ # RPC-specific configuration for `create_node_pool`
3061
+ # @return [Gapic::Config::Method]
3062
+ #
3063
+ attr_reader :create_node_pool
3064
+ ##
3065
+ # RPC-specific configuration for `delete_node_pool`
3066
+ # @return [Gapic::Config::Method]
3067
+ #
3068
+ attr_reader :delete_node_pool
3069
+ ##
3070
+ # RPC-specific configuration for `rollback_node_pool_upgrade`
3071
+ # @return [Gapic::Config::Method]
3072
+ #
3073
+ attr_reader :rollback_node_pool_upgrade
3074
+ ##
3075
+ # RPC-specific configuration for `set_node_pool_management`
3076
+ # @return [Gapic::Config::Method]
3077
+ #
3078
+ attr_reader :set_node_pool_management
3079
+ ##
3080
+ # RPC-specific configuration for `set_labels`
3081
+ # @return [Gapic::Config::Method]
3082
+ #
3083
+ attr_reader :set_labels
3084
+ ##
3085
+ # RPC-specific configuration for `set_legacy_abac`
3086
+ # @return [Gapic::Config::Method]
3087
+ #
3088
+ attr_reader :set_legacy_abac
3089
+ ##
3090
+ # RPC-specific configuration for `start_ip_rotation`
3091
+ # @return [Gapic::Config::Method]
3092
+ #
3093
+ attr_reader :start_ip_rotation
3094
+ ##
3095
+ # RPC-specific configuration for `complete_ip_rotation`
3096
+ # @return [Gapic::Config::Method]
3097
+ #
3098
+ attr_reader :complete_ip_rotation
3099
+ ##
3100
+ # RPC-specific configuration for `set_node_pool_size`
3101
+ # @return [Gapic::Config::Method]
3102
+ #
3103
+ attr_reader :set_node_pool_size
3104
+ ##
3105
+ # RPC-specific configuration for `set_network_policy`
3106
+ # @return [Gapic::Config::Method]
3107
+ #
3108
+ attr_reader :set_network_policy
3109
+ ##
3110
+ # RPC-specific configuration for `set_maintenance_policy`
3111
+ # @return [Gapic::Config::Method]
3112
+ #
3113
+ attr_reader :set_maintenance_policy
3114
+ ##
3115
+ # RPC-specific configuration for `list_usable_subnetworks`
3116
+ # @return [Gapic::Config::Method]
3117
+ #
3118
+ attr_reader :list_usable_subnetworks
3119
+
3120
+ # @private
3121
+ def initialize parent_rpcs = nil
3122
+ list_clusters_config = parent_rpcs&.list_clusters if parent_rpcs&.respond_to? :list_clusters
3123
+ @list_clusters = Gapic::Config::Method.new list_clusters_config
3124
+ get_cluster_config = parent_rpcs&.get_cluster if parent_rpcs&.respond_to? :get_cluster
3125
+ @get_cluster = Gapic::Config::Method.new get_cluster_config
3126
+ create_cluster_config = parent_rpcs&.create_cluster if parent_rpcs&.respond_to? :create_cluster
3127
+ @create_cluster = Gapic::Config::Method.new create_cluster_config
3128
+ update_cluster_config = parent_rpcs&.update_cluster if parent_rpcs&.respond_to? :update_cluster
3129
+ @update_cluster = Gapic::Config::Method.new update_cluster_config
3130
+ update_node_pool_config = parent_rpcs&.update_node_pool if parent_rpcs&.respond_to? :update_node_pool
3131
+ @update_node_pool = Gapic::Config::Method.new update_node_pool_config
3132
+ set_node_pool_autoscaling_config = parent_rpcs&.set_node_pool_autoscaling if parent_rpcs&.respond_to? :set_node_pool_autoscaling
3133
+ @set_node_pool_autoscaling = Gapic::Config::Method.new set_node_pool_autoscaling_config
3134
+ set_logging_service_config = parent_rpcs&.set_logging_service if parent_rpcs&.respond_to? :set_logging_service
3135
+ @set_logging_service = Gapic::Config::Method.new set_logging_service_config
3136
+ set_monitoring_service_config = parent_rpcs&.set_monitoring_service if parent_rpcs&.respond_to? :set_monitoring_service
3137
+ @set_monitoring_service = Gapic::Config::Method.new set_monitoring_service_config
3138
+ set_addons_config_config = parent_rpcs&.set_addons_config if parent_rpcs&.respond_to? :set_addons_config
3139
+ @set_addons_config = Gapic::Config::Method.new set_addons_config_config
3140
+ set_locations_config = parent_rpcs&.set_locations if parent_rpcs&.respond_to? :set_locations
3141
+ @set_locations = Gapic::Config::Method.new set_locations_config
3142
+ update_master_config = parent_rpcs&.update_master if parent_rpcs&.respond_to? :update_master
3143
+ @update_master = Gapic::Config::Method.new update_master_config
3144
+ set_master_auth_config = parent_rpcs&.set_master_auth if parent_rpcs&.respond_to? :set_master_auth
3145
+ @set_master_auth = Gapic::Config::Method.new set_master_auth_config
3146
+ delete_cluster_config = parent_rpcs&.delete_cluster if parent_rpcs&.respond_to? :delete_cluster
3147
+ @delete_cluster = Gapic::Config::Method.new delete_cluster_config
3148
+ list_operations_config = parent_rpcs&.list_operations if parent_rpcs&.respond_to? :list_operations
3149
+ @list_operations = Gapic::Config::Method.new list_operations_config
3150
+ get_operation_config = parent_rpcs&.get_operation if parent_rpcs&.respond_to? :get_operation
3151
+ @get_operation = Gapic::Config::Method.new get_operation_config
3152
+ cancel_operation_config = parent_rpcs&.cancel_operation if parent_rpcs&.respond_to? :cancel_operation
3153
+ @cancel_operation = Gapic::Config::Method.new cancel_operation_config
3154
+ get_server_config_config = parent_rpcs&.get_server_config if parent_rpcs&.respond_to? :get_server_config
3155
+ @get_server_config = Gapic::Config::Method.new get_server_config_config
3156
+ list_node_pools_config = parent_rpcs&.list_node_pools if parent_rpcs&.respond_to? :list_node_pools
3157
+ @list_node_pools = Gapic::Config::Method.new list_node_pools_config
3158
+ get_node_pool_config = parent_rpcs&.get_node_pool if parent_rpcs&.respond_to? :get_node_pool
3159
+ @get_node_pool = Gapic::Config::Method.new get_node_pool_config
3160
+ create_node_pool_config = parent_rpcs&.create_node_pool if parent_rpcs&.respond_to? :create_node_pool
3161
+ @create_node_pool = Gapic::Config::Method.new create_node_pool_config
3162
+ delete_node_pool_config = parent_rpcs&.delete_node_pool if parent_rpcs&.respond_to? :delete_node_pool
3163
+ @delete_node_pool = Gapic::Config::Method.new delete_node_pool_config
3164
+ rollback_node_pool_upgrade_config = parent_rpcs&.rollback_node_pool_upgrade if parent_rpcs&.respond_to? :rollback_node_pool_upgrade
3165
+ @rollback_node_pool_upgrade = Gapic::Config::Method.new rollback_node_pool_upgrade_config
3166
+ set_node_pool_management_config = parent_rpcs&.set_node_pool_management if parent_rpcs&.respond_to? :set_node_pool_management
3167
+ @set_node_pool_management = Gapic::Config::Method.new set_node_pool_management_config
3168
+ set_labels_config = parent_rpcs&.set_labels if parent_rpcs&.respond_to? :set_labels
3169
+ @set_labels = Gapic::Config::Method.new set_labels_config
3170
+ set_legacy_abac_config = parent_rpcs&.set_legacy_abac if parent_rpcs&.respond_to? :set_legacy_abac
3171
+ @set_legacy_abac = Gapic::Config::Method.new set_legacy_abac_config
3172
+ start_ip_rotation_config = parent_rpcs&.start_ip_rotation if parent_rpcs&.respond_to? :start_ip_rotation
3173
+ @start_ip_rotation = Gapic::Config::Method.new start_ip_rotation_config
3174
+ complete_ip_rotation_config = parent_rpcs&.complete_ip_rotation if parent_rpcs&.respond_to? :complete_ip_rotation
3175
+ @complete_ip_rotation = Gapic::Config::Method.new complete_ip_rotation_config
3176
+ set_node_pool_size_config = parent_rpcs&.set_node_pool_size if parent_rpcs&.respond_to? :set_node_pool_size
3177
+ @set_node_pool_size = Gapic::Config::Method.new set_node_pool_size_config
3178
+ set_network_policy_config = parent_rpcs&.set_network_policy if parent_rpcs&.respond_to? :set_network_policy
3179
+ @set_network_policy = Gapic::Config::Method.new set_network_policy_config
3180
+ set_maintenance_policy_config = parent_rpcs&.set_maintenance_policy if parent_rpcs&.respond_to? :set_maintenance_policy
3181
+ @set_maintenance_policy = Gapic::Config::Method.new set_maintenance_policy_config
3182
+ list_usable_subnetworks_config = parent_rpcs&.list_usable_subnetworks if parent_rpcs&.respond_to? :list_usable_subnetworks
3183
+ @list_usable_subnetworks = Gapic::Config::Method.new list_usable_subnetworks_config
3184
+
3185
+ yield self if block_given?
3186
+ end
3187
+ end
3188
+ end
3189
+ end
3190
+ end
3191
+ end
3192
+ end
3193
+ end
3194
+ end