google-cloud-container-v1 0.41.0 → 0.42.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3957 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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
+ require "google/cloud/container/v1/cluster_manager/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Container
26
+ module V1
27
+ module ClusterManager
28
+ module Rest
29
+ ##
30
+ # REST client for the ClusterManager service.
31
+ #
32
+ # Google Kubernetes Engine Cluster Manager v1
33
+ #
34
+ class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "container.$UNIVERSE_DOMAIN$"
40
+
41
+ include Paths
42
+
43
+ # @private
44
+ attr_reader :cluster_manager_stub
45
+
46
+ ##
47
+ # Configure the ClusterManager Client class.
48
+ #
49
+ # See {::Google::Cloud::Container::V1::ClusterManager::Rest::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all ClusterManager clients
55
+ # ::Google::Cloud::Container::V1::ClusterManager::Rest::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
58
+ #
59
+ # @yield [config] Configure the Client client.
60
+ # @yieldparam config [Client::Configuration]
61
+ #
62
+ # @return [Client::Configuration]
63
+ #
64
+ def self.configure
65
+ @configure ||= begin
66
+ namespace = ["Google", "Cloud", "Container", "V1"]
67
+ parent_config = while namespace.any?
68
+ parent_name = namespace.join "::"
69
+ parent_const = const_get parent_name
70
+ break parent_const.configure if parent_const.respond_to? :configure
71
+ namespace.pop
72
+ end
73
+ default_config = Client::Configuration.new parent_config
74
+
75
+ default_config.rpcs.list_clusters.timeout = 20.0
76
+ default_config.rpcs.list_clusters.retry_policy = {
77
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
78
+ }
79
+
80
+ default_config.rpcs.get_cluster.timeout = 20.0
81
+ default_config.rpcs.get_cluster.retry_policy = {
82
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
83
+ }
84
+
85
+ default_config.rpcs.create_cluster.timeout = 45.0
86
+
87
+ default_config.rpcs.update_cluster.timeout = 45.0
88
+
89
+ default_config.rpcs.update_node_pool.timeout = 45.0
90
+
91
+ default_config.rpcs.set_node_pool_autoscaling.timeout = 45.0
92
+
93
+ default_config.rpcs.set_logging_service.timeout = 45.0
94
+
95
+ default_config.rpcs.set_monitoring_service.timeout = 45.0
96
+
97
+ default_config.rpcs.set_addons_config.timeout = 45.0
98
+
99
+ default_config.rpcs.set_locations.timeout = 45.0
100
+
101
+ default_config.rpcs.update_master.timeout = 45.0
102
+
103
+ default_config.rpcs.set_master_auth.timeout = 45.0
104
+
105
+ default_config.rpcs.delete_cluster.timeout = 20.0
106
+ default_config.rpcs.delete_cluster.retry_policy = {
107
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
108
+ }
109
+
110
+ default_config.rpcs.list_operations.timeout = 20.0
111
+ default_config.rpcs.list_operations.retry_policy = {
112
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
113
+ }
114
+
115
+ default_config.rpcs.get_operation.timeout = 20.0
116
+ default_config.rpcs.get_operation.retry_policy = {
117
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
118
+ }
119
+
120
+ default_config.rpcs.cancel_operation.timeout = 45.0
121
+
122
+ default_config.rpcs.get_server_config.timeout = 20.0
123
+ default_config.rpcs.get_server_config.retry_policy = {
124
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
125
+ }
126
+
127
+ default_config.rpcs.list_node_pools.timeout = 20.0
128
+ default_config.rpcs.list_node_pools.retry_policy = {
129
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
130
+ }
131
+
132
+ default_config.rpcs.get_node_pool.timeout = 20.0
133
+ default_config.rpcs.get_node_pool.retry_policy = {
134
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
135
+ }
136
+
137
+ default_config.rpcs.create_node_pool.timeout = 45.0
138
+
139
+ default_config.rpcs.delete_node_pool.timeout = 20.0
140
+ default_config.rpcs.delete_node_pool.retry_policy = {
141
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
142
+ }
143
+
144
+ default_config.rpcs.rollback_node_pool_upgrade.timeout = 45.0
145
+
146
+ default_config.rpcs.set_node_pool_management.timeout = 45.0
147
+
148
+ default_config.rpcs.set_labels.timeout = 45.0
149
+
150
+ default_config.rpcs.set_legacy_abac.timeout = 45.0
151
+
152
+ default_config.rpcs.start_ip_rotation.timeout = 45.0
153
+
154
+ default_config.rpcs.complete_ip_rotation.timeout = 45.0
155
+
156
+ default_config.rpcs.set_node_pool_size.timeout = 45.0
157
+
158
+ default_config.rpcs.set_network_policy.timeout = 45.0
159
+
160
+ default_config.rpcs.set_maintenance_policy.timeout = 45.0
161
+
162
+ default_config
163
+ end
164
+ yield @configure if block_given?
165
+ @configure
166
+ end
167
+
168
+ ##
169
+ # Configure the ClusterManager Client instance.
170
+ #
171
+ # The configuration is set to the derived mode, meaning that values can be changed,
172
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
173
+ # should be made on {Client.configure}.
174
+ #
175
+ # See {::Google::Cloud::Container::V1::ClusterManager::Rest::Client::Configuration}
176
+ # for a description of the configuration fields.
177
+ #
178
+ # @yield [config] Configure the Client client.
179
+ # @yieldparam config [Client::Configuration]
180
+ #
181
+ # @return [Client::Configuration]
182
+ #
183
+ def configure
184
+ yield @config if block_given?
185
+ @config
186
+ end
187
+
188
+ ##
189
+ # The effective universe domain
190
+ #
191
+ # @return [String]
192
+ #
193
+ def universe_domain
194
+ @cluster_manager_stub.universe_domain
195
+ end
196
+
197
+ ##
198
+ # Create a new ClusterManager REST client object.
199
+ #
200
+ # @example
201
+ #
202
+ # # Create a client using the default configuration
203
+ # client = ::Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
204
+ #
205
+ # # Create a client using a custom configuration
206
+ # client = ::Google::Cloud::Container::V1::ClusterManager::Rest::Client.new do |config|
207
+ # config.timeout = 10.0
208
+ # end
209
+ #
210
+ # @yield [config] Configure the ClusterManager client.
211
+ # @yieldparam config [Client::Configuration]
212
+ #
213
+ def initialize
214
+ # Create the configuration object
215
+ @config = Configuration.new Client.configure
216
+
217
+ # Yield the configuration if needed
218
+ yield @config if block_given?
219
+
220
+ # Create credentials
221
+ credentials = @config.credentials
222
+ # Use self-signed JWT if the endpoint is unchanged from default,
223
+ # but only if the default endpoint does not have a region prefix.
224
+ enable_self_signed_jwt = @config.endpoint.nil? ||
225
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
226
+ !@config.endpoint.split(".").first.include?("-"))
227
+ credentials ||= Credentials.default scope: @config.scope,
228
+ enable_self_signed_jwt: enable_self_signed_jwt
229
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
230
+ credentials = Credentials.new credentials, scope: @config.scope
231
+ end
232
+
233
+ @quota_project_id = @config.quota_project
234
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
235
+
236
+ @cluster_manager_stub = ::Google::Cloud::Container::V1::ClusterManager::Rest::ServiceStub.new(
237
+ endpoint: @config.endpoint,
238
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
239
+ universe_domain: @config.universe_domain,
240
+ credentials: credentials
241
+ )
242
+ end
243
+
244
+ # Service calls
245
+
246
+ ##
247
+ # Lists all clusters owned by a project in either the specified zone or all
248
+ # zones.
249
+ #
250
+ # @overload list_clusters(request, options = nil)
251
+ # Pass arguments to `list_clusters` via a request object, either of type
252
+ # {::Google::Cloud::Container::V1::ListClustersRequest} or an equivalent Hash.
253
+ #
254
+ # @param request [::Google::Cloud::Container::V1::ListClustersRequest, ::Hash]
255
+ # A request object representing the call parameters. Required. To specify no
256
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
257
+ # @param options [::Gapic::CallOptions, ::Hash]
258
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
259
+ #
260
+ # @overload list_clusters(project_id: nil, zone: nil, parent: nil)
261
+ # Pass arguments to `list_clusters` via keyword arguments. Note that at
262
+ # least one keyword argument is required. To specify no parameters, or to keep all
263
+ # the default parameter values, pass an empty Hash as a request object (see above).
264
+ #
265
+ # @param project_id [::String]
266
+ # Deprecated. The Google Developers Console [project ID or project
267
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
268
+ # This field has been deprecated and replaced by the parent field.
269
+ # @param zone [::String]
270
+ # Deprecated. The name of the Google Compute Engine
271
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
272
+ # cluster resides, or "-" for all zones. This field has been deprecated and
273
+ # replaced by the parent field.
274
+ # @param parent [::String]
275
+ # The parent (project and location) where the clusters will be listed.
276
+ # Specified in the format `projects/*/locations/*`.
277
+ # Location "-" matches all zones and all regions.
278
+ # @yield [result, operation] Access the result along with the TransportOperation object
279
+ # @yieldparam result [::Google::Cloud::Container::V1::ListClustersResponse]
280
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
281
+ #
282
+ # @return [::Google::Cloud::Container::V1::ListClustersResponse]
283
+ #
284
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
285
+ #
286
+ # @example Basic example
287
+ # require "google/cloud/container/v1"
288
+ #
289
+ # # Create a client object. The client can be reused for multiple calls.
290
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
291
+ #
292
+ # # Create a request. To set request fields, pass in keyword arguments.
293
+ # request = Google::Cloud::Container::V1::ListClustersRequest.new
294
+ #
295
+ # # Call the list_clusters method.
296
+ # result = client.list_clusters request
297
+ #
298
+ # # The returned object is of type Google::Cloud::Container::V1::ListClustersResponse.
299
+ # p result
300
+ #
301
+ def list_clusters request, options = nil
302
+ raise ::ArgumentError, "request must be provided" if request.nil?
303
+
304
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::ListClustersRequest
305
+
306
+ # Converts hash and nil to an options object
307
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
308
+
309
+ # Customize the options with defaults
310
+ call_metadata = @config.rpcs.list_clusters.metadata.to_h
311
+
312
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
313
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
314
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
315
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
316
+ transports_version_send: [:rest]
317
+
318
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
319
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
320
+
321
+ options.apply_defaults timeout: @config.rpcs.list_clusters.timeout,
322
+ metadata: call_metadata,
323
+ retry_policy: @config.rpcs.list_clusters.retry_policy
324
+
325
+ options.apply_defaults timeout: @config.timeout,
326
+ metadata: @config.metadata,
327
+ retry_policy: @config.retry_policy
328
+
329
+ @cluster_manager_stub.list_clusters request, options do |result, operation|
330
+ yield result, operation if block_given?
331
+ return result
332
+ end
333
+ rescue ::Gapic::Rest::Error => e
334
+ raise ::Google::Cloud::Error.from_error(e)
335
+ end
336
+
337
+ ##
338
+ # Gets the details of a specific cluster.
339
+ #
340
+ # @overload get_cluster(request, options = nil)
341
+ # Pass arguments to `get_cluster` via a request object, either of type
342
+ # {::Google::Cloud::Container::V1::GetClusterRequest} or an equivalent Hash.
343
+ #
344
+ # @param request [::Google::Cloud::Container::V1::GetClusterRequest, ::Hash]
345
+ # A request object representing the call parameters. Required. To specify no
346
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
347
+ # @param options [::Gapic::CallOptions, ::Hash]
348
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
349
+ #
350
+ # @overload get_cluster(project_id: nil, zone: nil, cluster_id: nil, name: nil)
351
+ # Pass arguments to `get_cluster` via keyword arguments. Note that at
352
+ # least one keyword argument is required. To specify no parameters, or to keep all
353
+ # the default parameter values, pass an empty Hash as a request object (see above).
354
+ #
355
+ # @param project_id [::String]
356
+ # Deprecated. The Google Developers Console [project ID or project
357
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
358
+ # This field has been deprecated and replaced by the name field.
359
+ # @param zone [::String]
360
+ # Deprecated. The name of the Google Compute Engine
361
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
362
+ # cluster resides. This field has been deprecated and replaced by the name
363
+ # field.
364
+ # @param cluster_id [::String]
365
+ # Deprecated. The name of the cluster to retrieve.
366
+ # This field has been deprecated and replaced by the name field.
367
+ # @param name [::String]
368
+ # The name (project, location, cluster) of the cluster to retrieve.
369
+ # Specified in the format `projects/*/locations/*/clusters/*`.
370
+ # @yield [result, operation] Access the result along with the TransportOperation object
371
+ # @yieldparam result [::Google::Cloud::Container::V1::Cluster]
372
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
373
+ #
374
+ # @return [::Google::Cloud::Container::V1::Cluster]
375
+ #
376
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
377
+ #
378
+ # @example Basic example
379
+ # require "google/cloud/container/v1"
380
+ #
381
+ # # Create a client object. The client can be reused for multiple calls.
382
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
383
+ #
384
+ # # Create a request. To set request fields, pass in keyword arguments.
385
+ # request = Google::Cloud::Container::V1::GetClusterRequest.new
386
+ #
387
+ # # Call the get_cluster method.
388
+ # result = client.get_cluster request
389
+ #
390
+ # # The returned object is of type Google::Cloud::Container::V1::Cluster.
391
+ # p result
392
+ #
393
+ def get_cluster request, options = nil
394
+ raise ::ArgumentError, "request must be provided" if request.nil?
395
+
396
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::GetClusterRequest
397
+
398
+ # Converts hash and nil to an options object
399
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
400
+
401
+ # Customize the options with defaults
402
+ call_metadata = @config.rpcs.get_cluster.metadata.to_h
403
+
404
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
405
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
406
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
407
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
408
+ transports_version_send: [:rest]
409
+
410
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
411
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
412
+
413
+ options.apply_defaults timeout: @config.rpcs.get_cluster.timeout,
414
+ metadata: call_metadata,
415
+ retry_policy: @config.rpcs.get_cluster.retry_policy
416
+
417
+ options.apply_defaults timeout: @config.timeout,
418
+ metadata: @config.metadata,
419
+ retry_policy: @config.retry_policy
420
+
421
+ @cluster_manager_stub.get_cluster request, options do |result, operation|
422
+ yield result, operation if block_given?
423
+ return result
424
+ end
425
+ rescue ::Gapic::Rest::Error => e
426
+ raise ::Google::Cloud::Error.from_error(e)
427
+ end
428
+
429
+ ##
430
+ # Creates a cluster, consisting of the specified number and type of Google
431
+ # Compute Engine instances.
432
+ #
433
+ # By default, the cluster is created in the project's
434
+ # [default
435
+ # network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks).
436
+ #
437
+ # One firewall is added for the cluster. After cluster creation,
438
+ # the Kubelet creates routes for each node to allow the containers
439
+ # on that node to communicate with all other instances in the
440
+ # cluster.
441
+ #
442
+ # Finally, an entry is added to the project's global metadata indicating
443
+ # which CIDR range the cluster is using.
444
+ #
445
+ # @overload create_cluster(request, options = nil)
446
+ # Pass arguments to `create_cluster` via a request object, either of type
447
+ # {::Google::Cloud::Container::V1::CreateClusterRequest} or an equivalent Hash.
448
+ #
449
+ # @param request [::Google::Cloud::Container::V1::CreateClusterRequest, ::Hash]
450
+ # A request object representing the call parameters. Required. To specify no
451
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
452
+ # @param options [::Gapic::CallOptions, ::Hash]
453
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
454
+ #
455
+ # @overload create_cluster(project_id: nil, zone: nil, cluster: nil, parent: nil)
456
+ # Pass arguments to `create_cluster` via keyword arguments. Note that at
457
+ # least one keyword argument is required. To specify no parameters, or to keep all
458
+ # the default parameter values, pass an empty Hash as a request object (see above).
459
+ #
460
+ # @param project_id [::String]
461
+ # Deprecated. The Google Developers Console [project ID or project
462
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
463
+ # This field has been deprecated and replaced by the parent field.
464
+ # @param zone [::String]
465
+ # Deprecated. The name of the Google Compute Engine
466
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
467
+ # cluster resides. This field has been deprecated and replaced by the parent
468
+ # field.
469
+ # @param cluster [::Google::Cloud::Container::V1::Cluster, ::Hash]
470
+ # Required. A [cluster
471
+ # resource](https://cloud.google.com/container-engine/reference/rest/v1/projects.locations.clusters)
472
+ # @param parent [::String]
473
+ # The parent (project and location) where the cluster will be created.
474
+ # Specified in the format `projects/*/locations/*`.
475
+ # @yield [result, operation] Access the result along with the TransportOperation object
476
+ # @yieldparam result [::Google::Cloud::Container::V1::Operation]
477
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
478
+ #
479
+ # @return [::Google::Cloud::Container::V1::Operation]
480
+ #
481
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
482
+ #
483
+ # @example Basic example
484
+ # require "google/cloud/container/v1"
485
+ #
486
+ # # Create a client object. The client can be reused for multiple calls.
487
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
488
+ #
489
+ # # Create a request. To set request fields, pass in keyword arguments.
490
+ # request = Google::Cloud::Container::V1::CreateClusterRequest.new
491
+ #
492
+ # # Call the create_cluster method.
493
+ # result = client.create_cluster request
494
+ #
495
+ # # The returned object is of type Google::Cloud::Container::V1::Operation.
496
+ # p result
497
+ #
498
+ def create_cluster request, options = nil
499
+ raise ::ArgumentError, "request must be provided" if request.nil?
500
+
501
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::CreateClusterRequest
502
+
503
+ # Converts hash and nil to an options object
504
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
505
+
506
+ # Customize the options with defaults
507
+ call_metadata = @config.rpcs.create_cluster.metadata.to_h
508
+
509
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
510
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
511
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
512
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
513
+ transports_version_send: [:rest]
514
+
515
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
516
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
517
+
518
+ options.apply_defaults timeout: @config.rpcs.create_cluster.timeout,
519
+ metadata: call_metadata,
520
+ retry_policy: @config.rpcs.create_cluster.retry_policy
521
+
522
+ options.apply_defaults timeout: @config.timeout,
523
+ metadata: @config.metadata,
524
+ retry_policy: @config.retry_policy
525
+
526
+ @cluster_manager_stub.create_cluster request, options do |result, operation|
527
+ yield result, operation if block_given?
528
+ return result
529
+ end
530
+ rescue ::Gapic::Rest::Error => e
531
+ raise ::Google::Cloud::Error.from_error(e)
532
+ end
533
+
534
+ ##
535
+ # Updates the settings of a specific cluster.
536
+ #
537
+ # @overload update_cluster(request, options = nil)
538
+ # Pass arguments to `update_cluster` via a request object, either of type
539
+ # {::Google::Cloud::Container::V1::UpdateClusterRequest} or an equivalent Hash.
540
+ #
541
+ # @param request [::Google::Cloud::Container::V1::UpdateClusterRequest, ::Hash]
542
+ # A request object representing the call parameters. Required. To specify no
543
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
544
+ # @param options [::Gapic::CallOptions, ::Hash]
545
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
546
+ #
547
+ # @overload update_cluster(project_id: nil, zone: nil, cluster_id: nil, update: nil, name: nil)
548
+ # Pass arguments to `update_cluster` via keyword arguments. Note that at
549
+ # least one keyword argument is required. To specify no parameters, or to keep all
550
+ # the default parameter values, pass an empty Hash as a request object (see above).
551
+ #
552
+ # @param project_id [::String]
553
+ # Deprecated. The Google Developers Console [project ID or project
554
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
555
+ # This field has been deprecated and replaced by the name field.
556
+ # @param zone [::String]
557
+ # Deprecated. The name of the Google Compute Engine
558
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
559
+ # cluster resides. This field has been deprecated and replaced by the name
560
+ # field.
561
+ # @param cluster_id [::String]
562
+ # Deprecated. The name of the cluster to upgrade.
563
+ # This field has been deprecated and replaced by the name field.
564
+ # @param update [::Google::Cloud::Container::V1::ClusterUpdate, ::Hash]
565
+ # Required. A description of the update.
566
+ # @param name [::String]
567
+ # The name (project, location, cluster) of the cluster to update.
568
+ # Specified in the format `projects/*/locations/*/clusters/*`.
569
+ # @yield [result, operation] Access the result along with the TransportOperation object
570
+ # @yieldparam result [::Google::Cloud::Container::V1::Operation]
571
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
572
+ #
573
+ # @return [::Google::Cloud::Container::V1::Operation]
574
+ #
575
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
576
+ #
577
+ # @example Basic example
578
+ # require "google/cloud/container/v1"
579
+ #
580
+ # # Create a client object. The client can be reused for multiple calls.
581
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
582
+ #
583
+ # # Create a request. To set request fields, pass in keyword arguments.
584
+ # request = Google::Cloud::Container::V1::UpdateClusterRequest.new
585
+ #
586
+ # # Call the update_cluster method.
587
+ # result = client.update_cluster request
588
+ #
589
+ # # The returned object is of type Google::Cloud::Container::V1::Operation.
590
+ # p result
591
+ #
592
+ def update_cluster request, options = nil
593
+ raise ::ArgumentError, "request must be provided" if request.nil?
594
+
595
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::UpdateClusterRequest
596
+
597
+ # Converts hash and nil to an options object
598
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
599
+
600
+ # Customize the options with defaults
601
+ call_metadata = @config.rpcs.update_cluster.metadata.to_h
602
+
603
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
604
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
605
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
606
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
607
+ transports_version_send: [:rest]
608
+
609
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
610
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
611
+
612
+ options.apply_defaults timeout: @config.rpcs.update_cluster.timeout,
613
+ metadata: call_metadata,
614
+ retry_policy: @config.rpcs.update_cluster.retry_policy
615
+
616
+ options.apply_defaults timeout: @config.timeout,
617
+ metadata: @config.metadata,
618
+ retry_policy: @config.retry_policy
619
+
620
+ @cluster_manager_stub.update_cluster request, options do |result, operation|
621
+ yield result, operation if block_given?
622
+ return result
623
+ end
624
+ rescue ::Gapic::Rest::Error => e
625
+ raise ::Google::Cloud::Error.from_error(e)
626
+ end
627
+
628
+ ##
629
+ # Updates the version and/or image type for the specified node pool.
630
+ #
631
+ # @overload update_node_pool(request, options = nil)
632
+ # Pass arguments to `update_node_pool` via a request object, either of type
633
+ # {::Google::Cloud::Container::V1::UpdateNodePoolRequest} or an equivalent Hash.
634
+ #
635
+ # @param request [::Google::Cloud::Container::V1::UpdateNodePoolRequest, ::Hash]
636
+ # A request object representing the call parameters. Required. To specify no
637
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
638
+ # @param options [::Gapic::CallOptions, ::Hash]
639
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
640
+ #
641
+ # @overload update_node_pool(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, node_version: nil, image_type: nil, name: nil, locations: nil, workload_metadata_config: nil, upgrade_settings: nil, tags: nil, taints: nil, labels: nil, linux_node_config: nil, kubelet_config: nil, node_network_config: nil, gcfs_config: nil, confidential_nodes: nil, gvnic: nil, etag: nil, fast_socket: nil, logging_config: nil, resource_labels: nil, windows_node_config: nil, accelerators: nil, machine_type: nil, disk_type: nil, disk_size_gb: nil, resource_manager_tags: nil, containerd_config: nil, queued_provisioning: nil)
642
+ # Pass arguments to `update_node_pool` via keyword arguments. Note that at
643
+ # least one keyword argument is required. To specify no parameters, or to keep all
644
+ # the default parameter values, pass an empty Hash as a request object (see above).
645
+ #
646
+ # @param project_id [::String]
647
+ # Deprecated. The Google Developers Console [project ID or project
648
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
649
+ # This field has been deprecated and replaced by the name field.
650
+ # @param zone [::String]
651
+ # Deprecated. The name of the Google Compute Engine
652
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
653
+ # cluster resides. This field has been deprecated and replaced by the name
654
+ # field.
655
+ # @param cluster_id [::String]
656
+ # Deprecated. The name of the cluster to upgrade.
657
+ # This field has been deprecated and replaced by the name field.
658
+ # @param node_pool_id [::String]
659
+ # Deprecated. The name of the node pool to upgrade.
660
+ # This field has been deprecated and replaced by the name field.
661
+ # @param node_version [::String]
662
+ # Required. The Kubernetes version to change the nodes to (typically an
663
+ # upgrade).
664
+ #
665
+ # Users may specify either explicit versions offered by Kubernetes Engine or
666
+ # version aliases, which have the following behavior:
667
+ #
668
+ # - "latest": picks the highest valid Kubernetes version
669
+ # - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
670
+ # - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
671
+ # - "1.X.Y-gke.N": picks an explicit Kubernetes version
672
+ # - "-": picks the Kubernetes master version
673
+ # @param image_type [::String]
674
+ # Required. The desired image type for the node pool. Please see
675
+ # https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for
676
+ # available image types.
677
+ # @param name [::String]
678
+ # The name (project, location, cluster, node pool) of the node pool to
679
+ # update. Specified in the format
680
+ # `projects/*/locations/*/clusters/*/nodePools/*`.
681
+ # @param locations [::Array<::String>]
682
+ # The desired list of Google Compute Engine
683
+ # [zones](https://cloud.google.com/compute/docs/zones#available) in which the
684
+ # node pool's nodes should be located. Changing the locations for a node pool
685
+ # will result in nodes being either created or removed from the node pool,
686
+ # depending on whether locations are being added or removed.
687
+ # @param workload_metadata_config [::Google::Cloud::Container::V1::WorkloadMetadataConfig, ::Hash]
688
+ # The desired workload metadata config for the node pool.
689
+ # @param upgrade_settings [::Google::Cloud::Container::V1::NodePool::UpgradeSettings, ::Hash]
690
+ # Upgrade settings control disruption and speed of the upgrade.
691
+ # @param tags [::Google::Cloud::Container::V1::NetworkTags, ::Hash]
692
+ # The desired network tags to be applied to all nodes in the node pool.
693
+ # If this field is not present, the tags will not be changed. Otherwise,
694
+ # the existing network tags will be *replaced* with the provided tags.
695
+ # @param taints [::Google::Cloud::Container::V1::NodeTaints, ::Hash]
696
+ # The desired node taints to be applied to all nodes in the node pool.
697
+ # If this field is not present, the taints will not be changed. Otherwise,
698
+ # the existing node taints will be *replaced* with the provided taints.
699
+ # @param labels [::Google::Cloud::Container::V1::NodeLabels, ::Hash]
700
+ # The desired node labels to be applied to all nodes in the node pool.
701
+ # If this field is not present, the labels will not be changed. Otherwise,
702
+ # the existing node labels will be *replaced* with the provided labels.
703
+ # @param linux_node_config [::Google::Cloud::Container::V1::LinuxNodeConfig, ::Hash]
704
+ # Parameters that can be configured on Linux nodes.
705
+ # @param kubelet_config [::Google::Cloud::Container::V1::NodeKubeletConfig, ::Hash]
706
+ # Node kubelet configs.
707
+ # @param node_network_config [::Google::Cloud::Container::V1::NodeNetworkConfig, ::Hash]
708
+ # Node network config.
709
+ # @param gcfs_config [::Google::Cloud::Container::V1::GcfsConfig, ::Hash]
710
+ # GCFS config.
711
+ # @param confidential_nodes [::Google::Cloud::Container::V1::ConfidentialNodes, ::Hash]
712
+ # Confidential nodes config.
713
+ # All the nodes in the node pool will be Confidential VM once enabled.
714
+ # @param gvnic [::Google::Cloud::Container::V1::VirtualNIC, ::Hash]
715
+ # Enable or disable gvnic on the node pool.
716
+ # @param etag [::String]
717
+ # The current etag of the node pool.
718
+ # If an etag is provided and does not match the current etag of the node
719
+ # pool, update will be blocked and an ABORTED error will be returned.
720
+ # @param fast_socket [::Google::Cloud::Container::V1::FastSocket, ::Hash]
721
+ # Enable or disable NCCL fast socket for the node pool.
722
+ # @param logging_config [::Google::Cloud::Container::V1::NodePoolLoggingConfig, ::Hash]
723
+ # Logging configuration.
724
+ # @param resource_labels [::Google::Cloud::Container::V1::ResourceLabels, ::Hash]
725
+ # The resource labels for the node pool to use to annotate any related
726
+ # Google Compute Engine resources.
727
+ # @param windows_node_config [::Google::Cloud::Container::V1::WindowsNodeConfig, ::Hash]
728
+ # Parameters that can be configured on Windows nodes.
729
+ # @param accelerators [::Array<::Google::Cloud::Container::V1::AcceleratorConfig, ::Hash>]
730
+ # A list of hardware accelerators to be attached to each node.
731
+ # See https://cloud.google.com/compute/docs/gpus for more information about
732
+ # support for GPUs.
733
+ # @param machine_type [::String]
734
+ # Optional. The desired [Google Compute Engine machine
735
+ # type](https://cloud.google.com/compute/docs/machine-types) for nodes in the
736
+ # node pool. Initiates an upgrade operation that migrates the nodes in the
737
+ # node pool to the specified machine type.
738
+ # @param disk_type [::String]
739
+ # Optional. The desired disk type (e.g. 'pd-standard', 'pd-ssd' or
740
+ # 'pd-balanced') for nodes in the node pool.
741
+ # Initiates an upgrade operation that migrates the nodes in the
742
+ # node pool to the specified disk type.
743
+ # @param disk_size_gb [::Integer]
744
+ # Optional. The desired disk size for nodes in the node pool specified in GB.
745
+ # The smallest allowed disk size is 10GB.
746
+ # Initiates an upgrade operation that migrates the nodes in the
747
+ # node pool to the specified disk size.
748
+ # @param resource_manager_tags [::Google::Cloud::Container::V1::ResourceManagerTags, ::Hash]
749
+ # Desired resource manager tag keys and values to be attached to the nodes
750
+ # for managing Compute Engine firewalls using Network Firewall Policies.
751
+ # Existing tags will be replaced with new values.
752
+ # @param containerd_config [::Google::Cloud::Container::V1::ContainerdConfig, ::Hash]
753
+ # The desired containerd config for nodes in the node pool.
754
+ # Initiates an upgrade operation that recreates the nodes with the new
755
+ # config.
756
+ # @param queued_provisioning [::Google::Cloud::Container::V1::NodePool::QueuedProvisioning, ::Hash]
757
+ # Specifies the configuration of queued provisioning.
758
+ # @yield [result, operation] Access the result along with the TransportOperation object
759
+ # @yieldparam result [::Google::Cloud::Container::V1::Operation]
760
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
761
+ #
762
+ # @return [::Google::Cloud::Container::V1::Operation]
763
+ #
764
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
765
+ #
766
+ # @example Basic example
767
+ # require "google/cloud/container/v1"
768
+ #
769
+ # # Create a client object. The client can be reused for multiple calls.
770
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
771
+ #
772
+ # # Create a request. To set request fields, pass in keyword arguments.
773
+ # request = Google::Cloud::Container::V1::UpdateNodePoolRequest.new
774
+ #
775
+ # # Call the update_node_pool method.
776
+ # result = client.update_node_pool request
777
+ #
778
+ # # The returned object is of type Google::Cloud::Container::V1::Operation.
779
+ # p result
780
+ #
781
+ def update_node_pool request, options = nil
782
+ raise ::ArgumentError, "request must be provided" if request.nil?
783
+
784
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::UpdateNodePoolRequest
785
+
786
+ # Converts hash and nil to an options object
787
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
788
+
789
+ # Customize the options with defaults
790
+ call_metadata = @config.rpcs.update_node_pool.metadata.to_h
791
+
792
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
793
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
794
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
795
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
796
+ transports_version_send: [:rest]
797
+
798
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
799
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
800
+
801
+ options.apply_defaults timeout: @config.rpcs.update_node_pool.timeout,
802
+ metadata: call_metadata,
803
+ retry_policy: @config.rpcs.update_node_pool.retry_policy
804
+
805
+ options.apply_defaults timeout: @config.timeout,
806
+ metadata: @config.metadata,
807
+ retry_policy: @config.retry_policy
808
+
809
+ @cluster_manager_stub.update_node_pool request, options do |result, operation|
810
+ yield result, operation if block_given?
811
+ return result
812
+ end
813
+ rescue ::Gapic::Rest::Error => e
814
+ raise ::Google::Cloud::Error.from_error(e)
815
+ end
816
+
817
+ ##
818
+ # Sets the autoscaling settings for the specified node pool.
819
+ #
820
+ # @overload set_node_pool_autoscaling(request, options = nil)
821
+ # Pass arguments to `set_node_pool_autoscaling` via a request object, either of type
822
+ # {::Google::Cloud::Container::V1::SetNodePoolAutoscalingRequest} or an equivalent Hash.
823
+ #
824
+ # @param request [::Google::Cloud::Container::V1::SetNodePoolAutoscalingRequest, ::Hash]
825
+ # A request object representing the call parameters. Required. To specify no
826
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
827
+ # @param options [::Gapic::CallOptions, ::Hash]
828
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
829
+ #
830
+ # @overload set_node_pool_autoscaling(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, autoscaling: nil, name: nil)
831
+ # Pass arguments to `set_node_pool_autoscaling` via keyword arguments. Note that at
832
+ # least one keyword argument is required. To specify no parameters, or to keep all
833
+ # the default parameter values, pass an empty Hash as a request object (see above).
834
+ #
835
+ # @param project_id [::String]
836
+ # Deprecated. The Google Developers Console [project ID or project
837
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
838
+ # This field has been deprecated and replaced by the name field.
839
+ # @param zone [::String]
840
+ # Deprecated. The name of the Google Compute Engine
841
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
842
+ # cluster resides. This field has been deprecated and replaced by the name
843
+ # field.
844
+ # @param cluster_id [::String]
845
+ # Deprecated. The name of the cluster to upgrade.
846
+ # This field has been deprecated and replaced by the name field.
847
+ # @param node_pool_id [::String]
848
+ # Deprecated. The name of the node pool to upgrade.
849
+ # This field has been deprecated and replaced by the name field.
850
+ # @param autoscaling [::Google::Cloud::Container::V1::NodePoolAutoscaling, ::Hash]
851
+ # Required. Autoscaling configuration for the node pool.
852
+ # @param name [::String]
853
+ # The name (project, location, cluster, node pool) of the node pool to set
854
+ # autoscaler settings. Specified in the format
855
+ # `projects/*/locations/*/clusters/*/nodePools/*`.
856
+ # @yield [result, operation] Access the result along with the TransportOperation object
857
+ # @yieldparam result [::Google::Cloud::Container::V1::Operation]
858
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
859
+ #
860
+ # @return [::Google::Cloud::Container::V1::Operation]
861
+ #
862
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
863
+ #
864
+ # @example Basic example
865
+ # require "google/cloud/container/v1"
866
+ #
867
+ # # Create a client object. The client can be reused for multiple calls.
868
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
869
+ #
870
+ # # Create a request. To set request fields, pass in keyword arguments.
871
+ # request = Google::Cloud::Container::V1::SetNodePoolAutoscalingRequest.new
872
+ #
873
+ # # Call the set_node_pool_autoscaling method.
874
+ # result = client.set_node_pool_autoscaling request
875
+ #
876
+ # # The returned object is of type Google::Cloud::Container::V1::Operation.
877
+ # p result
878
+ #
879
+ def set_node_pool_autoscaling request, options = nil
880
+ raise ::ArgumentError, "request must be provided" if request.nil?
881
+
882
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::SetNodePoolAutoscalingRequest
883
+
884
+ # Converts hash and nil to an options object
885
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
886
+
887
+ # Customize the options with defaults
888
+ call_metadata = @config.rpcs.set_node_pool_autoscaling.metadata.to_h
889
+
890
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
891
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
892
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
893
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
894
+ transports_version_send: [:rest]
895
+
896
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
897
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
898
+
899
+ options.apply_defaults timeout: @config.rpcs.set_node_pool_autoscaling.timeout,
900
+ metadata: call_metadata,
901
+ retry_policy: @config.rpcs.set_node_pool_autoscaling.retry_policy
902
+
903
+ options.apply_defaults timeout: @config.timeout,
904
+ metadata: @config.metadata,
905
+ retry_policy: @config.retry_policy
906
+
907
+ @cluster_manager_stub.set_node_pool_autoscaling request, options do |result, operation|
908
+ yield result, operation if block_given?
909
+ return result
910
+ end
911
+ rescue ::Gapic::Rest::Error => e
912
+ raise ::Google::Cloud::Error.from_error(e)
913
+ end
914
+
915
+ ##
916
+ # Sets the logging service for a specific cluster.
917
+ #
918
+ # @overload set_logging_service(request, options = nil)
919
+ # Pass arguments to `set_logging_service` via a request object, either of type
920
+ # {::Google::Cloud::Container::V1::SetLoggingServiceRequest} or an equivalent Hash.
921
+ #
922
+ # @param request [::Google::Cloud::Container::V1::SetLoggingServiceRequest, ::Hash]
923
+ # A request object representing the call parameters. Required. To specify no
924
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
925
+ # @param options [::Gapic::CallOptions, ::Hash]
926
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
927
+ #
928
+ # @overload set_logging_service(project_id: nil, zone: nil, cluster_id: nil, logging_service: nil, name: nil)
929
+ # Pass arguments to `set_logging_service` via keyword arguments. Note that at
930
+ # least one keyword argument is required. To specify no parameters, or to keep all
931
+ # the default parameter values, pass an empty Hash as a request object (see above).
932
+ #
933
+ # @param project_id [::String]
934
+ # Deprecated. The Google Developers Console [project ID or project
935
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
936
+ # This field has been deprecated and replaced by the name field.
937
+ # @param zone [::String]
938
+ # Deprecated. The name of the Google Compute Engine
939
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
940
+ # cluster resides. This field has been deprecated and replaced by the name
941
+ # field.
942
+ # @param cluster_id [::String]
943
+ # Deprecated. The name of the cluster to upgrade.
944
+ # This field has been deprecated and replaced by the name field.
945
+ # @param logging_service [::String]
946
+ # Required. The logging service the cluster should use to write logs.
947
+ # Currently available options:
948
+ #
949
+ # * `logging.googleapis.com/kubernetes` - The Cloud Logging
950
+ # service with a Kubernetes-native resource model
951
+ # * `logging.googleapis.com` - The legacy Cloud Logging service (no longer
952
+ # available as of GKE 1.15).
953
+ # * `none` - no logs will be exported from the cluster.
954
+ #
955
+ # If left as an empty string,`logging.googleapis.com/kubernetes` will be
956
+ # used for GKE 1.14+ or `logging.googleapis.com` for earlier versions.
957
+ # @param name [::String]
958
+ # The name (project, location, cluster) of the cluster to set logging.
959
+ # Specified in the format `projects/*/locations/*/clusters/*`.
960
+ # @yield [result, operation] Access the result along with the TransportOperation object
961
+ # @yieldparam result [::Google::Cloud::Container::V1::Operation]
962
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
963
+ #
964
+ # @return [::Google::Cloud::Container::V1::Operation]
965
+ #
966
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
967
+ #
968
+ # @example Basic example
969
+ # require "google/cloud/container/v1"
970
+ #
971
+ # # Create a client object. The client can be reused for multiple calls.
972
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
973
+ #
974
+ # # Create a request. To set request fields, pass in keyword arguments.
975
+ # request = Google::Cloud::Container::V1::SetLoggingServiceRequest.new
976
+ #
977
+ # # Call the set_logging_service method.
978
+ # result = client.set_logging_service request
979
+ #
980
+ # # The returned object is of type Google::Cloud::Container::V1::Operation.
981
+ # p result
982
+ #
983
+ def set_logging_service request, options = nil
984
+ raise ::ArgumentError, "request must be provided" if request.nil?
985
+
986
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::SetLoggingServiceRequest
987
+
988
+ # Converts hash and nil to an options object
989
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
990
+
991
+ # Customize the options with defaults
992
+ call_metadata = @config.rpcs.set_logging_service.metadata.to_h
993
+
994
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
995
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
996
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
997
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
998
+ transports_version_send: [:rest]
999
+
1000
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1001
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1002
+
1003
+ options.apply_defaults timeout: @config.rpcs.set_logging_service.timeout,
1004
+ metadata: call_metadata,
1005
+ retry_policy: @config.rpcs.set_logging_service.retry_policy
1006
+
1007
+ options.apply_defaults timeout: @config.timeout,
1008
+ metadata: @config.metadata,
1009
+ retry_policy: @config.retry_policy
1010
+
1011
+ @cluster_manager_stub.set_logging_service request, options do |result, operation|
1012
+ yield result, operation if block_given?
1013
+ return result
1014
+ end
1015
+ rescue ::Gapic::Rest::Error => e
1016
+ raise ::Google::Cloud::Error.from_error(e)
1017
+ end
1018
+
1019
+ ##
1020
+ # Sets the monitoring service for a specific cluster.
1021
+ #
1022
+ # @overload set_monitoring_service(request, options = nil)
1023
+ # Pass arguments to `set_monitoring_service` via a request object, either of type
1024
+ # {::Google::Cloud::Container::V1::SetMonitoringServiceRequest} or an equivalent Hash.
1025
+ #
1026
+ # @param request [::Google::Cloud::Container::V1::SetMonitoringServiceRequest, ::Hash]
1027
+ # A request object representing the call parameters. Required. To specify no
1028
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1029
+ # @param options [::Gapic::CallOptions, ::Hash]
1030
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1031
+ #
1032
+ # @overload set_monitoring_service(project_id: nil, zone: nil, cluster_id: nil, monitoring_service: nil, name: nil)
1033
+ # Pass arguments to `set_monitoring_service` via keyword arguments. Note that at
1034
+ # least one keyword argument is required. To specify no parameters, or to keep all
1035
+ # the default parameter values, pass an empty Hash as a request object (see above).
1036
+ #
1037
+ # @param project_id [::String]
1038
+ # Deprecated. The Google Developers Console [project ID or project
1039
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
1040
+ # This field has been deprecated and replaced by the name field.
1041
+ # @param zone [::String]
1042
+ # Deprecated. The name of the Google Compute Engine
1043
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
1044
+ # cluster resides. This field has been deprecated and replaced by the name
1045
+ # field.
1046
+ # @param cluster_id [::String]
1047
+ # Deprecated. The name of the cluster to upgrade.
1048
+ # This field has been deprecated and replaced by the name field.
1049
+ # @param monitoring_service [::String]
1050
+ # Required. The monitoring service the cluster should use to write metrics.
1051
+ # Currently available options:
1052
+ #
1053
+ # * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring
1054
+ # service with a Kubernetes-native resource model
1055
+ # * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no
1056
+ # longer available as of GKE 1.15).
1057
+ # * `none` - No metrics will be exported from the cluster.
1058
+ #
1059
+ # If left as an empty string,`monitoring.googleapis.com/kubernetes` will be
1060
+ # used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions.
1061
+ # @param name [::String]
1062
+ # The name (project, location, cluster) of the cluster to set monitoring.
1063
+ # Specified in the format `projects/*/locations/*/clusters/*`.
1064
+ # @yield [result, operation] Access the result along with the TransportOperation object
1065
+ # @yieldparam result [::Google::Cloud::Container::V1::Operation]
1066
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1067
+ #
1068
+ # @return [::Google::Cloud::Container::V1::Operation]
1069
+ #
1070
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1071
+ #
1072
+ # @example Basic example
1073
+ # require "google/cloud/container/v1"
1074
+ #
1075
+ # # Create a client object. The client can be reused for multiple calls.
1076
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
1077
+ #
1078
+ # # Create a request. To set request fields, pass in keyword arguments.
1079
+ # request = Google::Cloud::Container::V1::SetMonitoringServiceRequest.new
1080
+ #
1081
+ # # Call the set_monitoring_service method.
1082
+ # result = client.set_monitoring_service request
1083
+ #
1084
+ # # The returned object is of type Google::Cloud::Container::V1::Operation.
1085
+ # p result
1086
+ #
1087
+ def set_monitoring_service request, options = nil
1088
+ raise ::ArgumentError, "request must be provided" if request.nil?
1089
+
1090
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::SetMonitoringServiceRequest
1091
+
1092
+ # Converts hash and nil to an options object
1093
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1094
+
1095
+ # Customize the options with defaults
1096
+ call_metadata = @config.rpcs.set_monitoring_service.metadata.to_h
1097
+
1098
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1099
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1100
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1101
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
1102
+ transports_version_send: [:rest]
1103
+
1104
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1105
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1106
+
1107
+ options.apply_defaults timeout: @config.rpcs.set_monitoring_service.timeout,
1108
+ metadata: call_metadata,
1109
+ retry_policy: @config.rpcs.set_monitoring_service.retry_policy
1110
+
1111
+ options.apply_defaults timeout: @config.timeout,
1112
+ metadata: @config.metadata,
1113
+ retry_policy: @config.retry_policy
1114
+
1115
+ @cluster_manager_stub.set_monitoring_service request, options do |result, operation|
1116
+ yield result, operation if block_given?
1117
+ return result
1118
+ end
1119
+ rescue ::Gapic::Rest::Error => e
1120
+ raise ::Google::Cloud::Error.from_error(e)
1121
+ end
1122
+
1123
+ ##
1124
+ # Sets the addons for a specific cluster.
1125
+ #
1126
+ # @overload set_addons_config(request, options = nil)
1127
+ # Pass arguments to `set_addons_config` via a request object, either of type
1128
+ # {::Google::Cloud::Container::V1::SetAddonsConfigRequest} or an equivalent Hash.
1129
+ #
1130
+ # @param request [::Google::Cloud::Container::V1::SetAddonsConfigRequest, ::Hash]
1131
+ # A request object representing the call parameters. Required. To specify no
1132
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1133
+ # @param options [::Gapic::CallOptions, ::Hash]
1134
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1135
+ #
1136
+ # @overload set_addons_config(project_id: nil, zone: nil, cluster_id: nil, addons_config: nil, name: nil)
1137
+ # Pass arguments to `set_addons_config` via keyword arguments. Note that at
1138
+ # least one keyword argument is required. To specify no parameters, or to keep all
1139
+ # the default parameter values, pass an empty Hash as a request object (see above).
1140
+ #
1141
+ # @param project_id [::String]
1142
+ # Deprecated. The Google Developers Console [project ID or project
1143
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
1144
+ # This field has been deprecated and replaced by the name field.
1145
+ # @param zone [::String]
1146
+ # Deprecated. The name of the Google Compute Engine
1147
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
1148
+ # cluster resides. This field has been deprecated and replaced by the name
1149
+ # field.
1150
+ # @param cluster_id [::String]
1151
+ # Deprecated. The name of the cluster to upgrade.
1152
+ # This field has been deprecated and replaced by the name field.
1153
+ # @param addons_config [::Google::Cloud::Container::V1::AddonsConfig, ::Hash]
1154
+ # Required. The desired configurations for the various addons available to
1155
+ # run in the cluster.
1156
+ # @param name [::String]
1157
+ # The name (project, location, cluster) of the cluster to set addons.
1158
+ # Specified in the format `projects/*/locations/*/clusters/*`.
1159
+ # @yield [result, operation] Access the result along with the TransportOperation object
1160
+ # @yieldparam result [::Google::Cloud::Container::V1::Operation]
1161
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1162
+ #
1163
+ # @return [::Google::Cloud::Container::V1::Operation]
1164
+ #
1165
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1166
+ #
1167
+ # @example Basic example
1168
+ # require "google/cloud/container/v1"
1169
+ #
1170
+ # # Create a client object. The client can be reused for multiple calls.
1171
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
1172
+ #
1173
+ # # Create a request. To set request fields, pass in keyword arguments.
1174
+ # request = Google::Cloud::Container::V1::SetAddonsConfigRequest.new
1175
+ #
1176
+ # # Call the set_addons_config method.
1177
+ # result = client.set_addons_config request
1178
+ #
1179
+ # # The returned object is of type Google::Cloud::Container::V1::Operation.
1180
+ # p result
1181
+ #
1182
+ def set_addons_config request, options = nil
1183
+ raise ::ArgumentError, "request must be provided" if request.nil?
1184
+
1185
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::SetAddonsConfigRequest
1186
+
1187
+ # Converts hash and nil to an options object
1188
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1189
+
1190
+ # Customize the options with defaults
1191
+ call_metadata = @config.rpcs.set_addons_config.metadata.to_h
1192
+
1193
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1194
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1195
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1196
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
1197
+ transports_version_send: [:rest]
1198
+
1199
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1200
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1201
+
1202
+ options.apply_defaults timeout: @config.rpcs.set_addons_config.timeout,
1203
+ metadata: call_metadata,
1204
+ retry_policy: @config.rpcs.set_addons_config.retry_policy
1205
+
1206
+ options.apply_defaults timeout: @config.timeout,
1207
+ metadata: @config.metadata,
1208
+ retry_policy: @config.retry_policy
1209
+
1210
+ @cluster_manager_stub.set_addons_config request, options do |result, operation|
1211
+ yield result, operation if block_given?
1212
+ return result
1213
+ end
1214
+ rescue ::Gapic::Rest::Error => e
1215
+ raise ::Google::Cloud::Error.from_error(e)
1216
+ end
1217
+
1218
+ ##
1219
+ # Sets the locations for a specific cluster.
1220
+ # Deprecated. Use
1221
+ # [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update)
1222
+ # instead.
1223
+ #
1224
+ # @overload set_locations(request, options = nil)
1225
+ # Pass arguments to `set_locations` via a request object, either of type
1226
+ # {::Google::Cloud::Container::V1::SetLocationsRequest} or an equivalent Hash.
1227
+ #
1228
+ # @param request [::Google::Cloud::Container::V1::SetLocationsRequest, ::Hash]
1229
+ # A request object representing the call parameters. Required. To specify no
1230
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1231
+ # @param options [::Gapic::CallOptions, ::Hash]
1232
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1233
+ #
1234
+ # @overload set_locations(project_id: nil, zone: nil, cluster_id: nil, locations: nil, name: nil)
1235
+ # Pass arguments to `set_locations` via keyword arguments. Note that at
1236
+ # least one keyword argument is required. To specify no parameters, or to keep all
1237
+ # the default parameter values, pass an empty Hash as a request object (see above).
1238
+ #
1239
+ # @param project_id [::String]
1240
+ # Deprecated. The Google Developers Console [project ID or project
1241
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
1242
+ # This field has been deprecated and replaced by the name field.
1243
+ # @param zone [::String]
1244
+ # Deprecated. The name of the Google Compute Engine
1245
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
1246
+ # cluster resides. This field has been deprecated and replaced by the name
1247
+ # field.
1248
+ # @param cluster_id [::String]
1249
+ # Deprecated. The name of the cluster to upgrade.
1250
+ # This field has been deprecated and replaced by the name field.
1251
+ # @param locations [::Array<::String>]
1252
+ # Required. The desired list of Google Compute Engine
1253
+ # [zones](https://cloud.google.com/compute/docs/zones#available) in which the
1254
+ # cluster's nodes should be located. Changing the locations a cluster is in
1255
+ # will result in nodes being either created or removed from the cluster,
1256
+ # depending on whether locations are being added or removed.
1257
+ #
1258
+ # This list must always include the cluster's primary zone.
1259
+ # @param name [::String]
1260
+ # The name (project, location, cluster) of the cluster to set locations.
1261
+ # Specified in the format `projects/*/locations/*/clusters/*`.
1262
+ # @yield [result, operation] Access the result along with the TransportOperation object
1263
+ # @yieldparam result [::Google::Cloud::Container::V1::Operation]
1264
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1265
+ #
1266
+ # @return [::Google::Cloud::Container::V1::Operation]
1267
+ #
1268
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1269
+ #
1270
+ # @example Basic example
1271
+ # require "google/cloud/container/v1"
1272
+ #
1273
+ # # Create a client object. The client can be reused for multiple calls.
1274
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
1275
+ #
1276
+ # # Create a request. To set request fields, pass in keyword arguments.
1277
+ # request = Google::Cloud::Container::V1::SetLocationsRequest.new
1278
+ #
1279
+ # # Call the set_locations method.
1280
+ # result = client.set_locations request
1281
+ #
1282
+ # # The returned object is of type Google::Cloud::Container::V1::Operation.
1283
+ # p result
1284
+ #
1285
+ def set_locations request, options = nil
1286
+ raise ::ArgumentError, "request must be provided" if request.nil?
1287
+
1288
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::SetLocationsRequest
1289
+
1290
+ # Converts hash and nil to an options object
1291
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1292
+
1293
+ # Customize the options with defaults
1294
+ call_metadata = @config.rpcs.set_locations.metadata.to_h
1295
+
1296
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1297
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1298
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1299
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
1300
+ transports_version_send: [:rest]
1301
+
1302
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1303
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1304
+
1305
+ options.apply_defaults timeout: @config.rpcs.set_locations.timeout,
1306
+ metadata: call_metadata,
1307
+ retry_policy: @config.rpcs.set_locations.retry_policy
1308
+
1309
+ options.apply_defaults timeout: @config.timeout,
1310
+ metadata: @config.metadata,
1311
+ retry_policy: @config.retry_policy
1312
+
1313
+ @cluster_manager_stub.set_locations request, options do |result, operation|
1314
+ yield result, operation if block_given?
1315
+ return result
1316
+ end
1317
+ rescue ::Gapic::Rest::Error => e
1318
+ raise ::Google::Cloud::Error.from_error(e)
1319
+ end
1320
+
1321
+ ##
1322
+ # Updates the master for a specific cluster.
1323
+ #
1324
+ # @overload update_master(request, options = nil)
1325
+ # Pass arguments to `update_master` via a request object, either of type
1326
+ # {::Google::Cloud::Container::V1::UpdateMasterRequest} or an equivalent Hash.
1327
+ #
1328
+ # @param request [::Google::Cloud::Container::V1::UpdateMasterRequest, ::Hash]
1329
+ # A request object representing the call parameters. Required. To specify no
1330
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1331
+ # @param options [::Gapic::CallOptions, ::Hash]
1332
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1333
+ #
1334
+ # @overload update_master(project_id: nil, zone: nil, cluster_id: nil, master_version: nil, name: nil)
1335
+ # Pass arguments to `update_master` via keyword arguments. Note that at
1336
+ # least one keyword argument is required. To specify no parameters, or to keep all
1337
+ # the default parameter values, pass an empty Hash as a request object (see above).
1338
+ #
1339
+ # @param project_id [::String]
1340
+ # Deprecated. The Google Developers Console [project ID or project
1341
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
1342
+ # This field has been deprecated and replaced by the name field.
1343
+ # @param zone [::String]
1344
+ # Deprecated. The name of the Google Compute Engine
1345
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
1346
+ # cluster resides. This field has been deprecated and replaced by the name
1347
+ # field.
1348
+ # @param cluster_id [::String]
1349
+ # Deprecated. The name of the cluster to upgrade.
1350
+ # This field has been deprecated and replaced by the name field.
1351
+ # @param master_version [::String]
1352
+ # Required. The Kubernetes version to change the master to.
1353
+ #
1354
+ # Users may specify either explicit versions offered by Kubernetes Engine or
1355
+ # version aliases, which have the following behavior:
1356
+ #
1357
+ # - "latest": picks the highest valid Kubernetes version
1358
+ # - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
1359
+ # - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
1360
+ # - "1.X.Y-gke.N": picks an explicit Kubernetes version
1361
+ # - "-": picks the default Kubernetes version
1362
+ # @param name [::String]
1363
+ # The name (project, location, cluster) of the cluster to update.
1364
+ # Specified in the format `projects/*/locations/*/clusters/*`.
1365
+ # @yield [result, operation] Access the result along with the TransportOperation object
1366
+ # @yieldparam result [::Google::Cloud::Container::V1::Operation]
1367
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1368
+ #
1369
+ # @return [::Google::Cloud::Container::V1::Operation]
1370
+ #
1371
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1372
+ #
1373
+ # @example Basic example
1374
+ # require "google/cloud/container/v1"
1375
+ #
1376
+ # # Create a client object. The client can be reused for multiple calls.
1377
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
1378
+ #
1379
+ # # Create a request. To set request fields, pass in keyword arguments.
1380
+ # request = Google::Cloud::Container::V1::UpdateMasterRequest.new
1381
+ #
1382
+ # # Call the update_master method.
1383
+ # result = client.update_master request
1384
+ #
1385
+ # # The returned object is of type Google::Cloud::Container::V1::Operation.
1386
+ # p result
1387
+ #
1388
+ def update_master request, options = nil
1389
+ raise ::ArgumentError, "request must be provided" if request.nil?
1390
+
1391
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::UpdateMasterRequest
1392
+
1393
+ # Converts hash and nil to an options object
1394
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1395
+
1396
+ # Customize the options with defaults
1397
+ call_metadata = @config.rpcs.update_master.metadata.to_h
1398
+
1399
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1400
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1401
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1402
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
1403
+ transports_version_send: [:rest]
1404
+
1405
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1406
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1407
+
1408
+ options.apply_defaults timeout: @config.rpcs.update_master.timeout,
1409
+ metadata: call_metadata,
1410
+ retry_policy: @config.rpcs.update_master.retry_policy
1411
+
1412
+ options.apply_defaults timeout: @config.timeout,
1413
+ metadata: @config.metadata,
1414
+ retry_policy: @config.retry_policy
1415
+
1416
+ @cluster_manager_stub.update_master request, options do |result, operation|
1417
+ yield result, operation if block_given?
1418
+ return result
1419
+ end
1420
+ rescue ::Gapic::Rest::Error => e
1421
+ raise ::Google::Cloud::Error.from_error(e)
1422
+ end
1423
+
1424
+ ##
1425
+ # Sets master auth materials. Currently supports changing the admin password
1426
+ # or a specific cluster, either via password generation or explicitly setting
1427
+ # the password.
1428
+ #
1429
+ # @overload set_master_auth(request, options = nil)
1430
+ # Pass arguments to `set_master_auth` via a request object, either of type
1431
+ # {::Google::Cloud::Container::V1::SetMasterAuthRequest} or an equivalent Hash.
1432
+ #
1433
+ # @param request [::Google::Cloud::Container::V1::SetMasterAuthRequest, ::Hash]
1434
+ # A request object representing the call parameters. Required. To specify no
1435
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1436
+ # @param options [::Gapic::CallOptions, ::Hash]
1437
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1438
+ #
1439
+ # @overload set_master_auth(project_id: nil, zone: nil, cluster_id: nil, action: nil, update: nil, name: nil)
1440
+ # Pass arguments to `set_master_auth` via keyword arguments. Note that at
1441
+ # least one keyword argument is required. To specify no parameters, or to keep all
1442
+ # the default parameter values, pass an empty Hash as a request object (see above).
1443
+ #
1444
+ # @param project_id [::String]
1445
+ # Deprecated. The Google Developers Console [project ID or project
1446
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
1447
+ # This field has been deprecated and replaced by the name field.
1448
+ # @param zone [::String]
1449
+ # Deprecated. The name of the Google Compute Engine
1450
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
1451
+ # cluster resides. This field has been deprecated and replaced by the name
1452
+ # field.
1453
+ # @param cluster_id [::String]
1454
+ # Deprecated. The name of the cluster to upgrade.
1455
+ # This field has been deprecated and replaced by the name field.
1456
+ # @param action [::Google::Cloud::Container::V1::SetMasterAuthRequest::Action]
1457
+ # Required. The exact form of action to be taken on the master auth.
1458
+ # @param update [::Google::Cloud::Container::V1::MasterAuth, ::Hash]
1459
+ # Required. A description of the update.
1460
+ # @param name [::String]
1461
+ # The name (project, location, cluster) of the cluster to set auth.
1462
+ # Specified in the format `projects/*/locations/*/clusters/*`.
1463
+ # @yield [result, operation] Access the result along with the TransportOperation object
1464
+ # @yieldparam result [::Google::Cloud::Container::V1::Operation]
1465
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1466
+ #
1467
+ # @return [::Google::Cloud::Container::V1::Operation]
1468
+ #
1469
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1470
+ #
1471
+ # @example Basic example
1472
+ # require "google/cloud/container/v1"
1473
+ #
1474
+ # # Create a client object. The client can be reused for multiple calls.
1475
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
1476
+ #
1477
+ # # Create a request. To set request fields, pass in keyword arguments.
1478
+ # request = Google::Cloud::Container::V1::SetMasterAuthRequest.new
1479
+ #
1480
+ # # Call the set_master_auth method.
1481
+ # result = client.set_master_auth request
1482
+ #
1483
+ # # The returned object is of type Google::Cloud::Container::V1::Operation.
1484
+ # p result
1485
+ #
1486
+ def set_master_auth request, options = nil
1487
+ raise ::ArgumentError, "request must be provided" if request.nil?
1488
+
1489
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::SetMasterAuthRequest
1490
+
1491
+ # Converts hash and nil to an options object
1492
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1493
+
1494
+ # Customize the options with defaults
1495
+ call_metadata = @config.rpcs.set_master_auth.metadata.to_h
1496
+
1497
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1498
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1499
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1500
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
1501
+ transports_version_send: [:rest]
1502
+
1503
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1504
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1505
+
1506
+ options.apply_defaults timeout: @config.rpcs.set_master_auth.timeout,
1507
+ metadata: call_metadata,
1508
+ retry_policy: @config.rpcs.set_master_auth.retry_policy
1509
+
1510
+ options.apply_defaults timeout: @config.timeout,
1511
+ metadata: @config.metadata,
1512
+ retry_policy: @config.retry_policy
1513
+
1514
+ @cluster_manager_stub.set_master_auth request, options do |result, operation|
1515
+ yield result, operation if block_given?
1516
+ return result
1517
+ end
1518
+ rescue ::Gapic::Rest::Error => e
1519
+ raise ::Google::Cloud::Error.from_error(e)
1520
+ end
1521
+
1522
+ ##
1523
+ # Deletes the cluster, including the Kubernetes endpoint and all worker
1524
+ # nodes.
1525
+ #
1526
+ # Firewalls and routes that were configured during cluster creation
1527
+ # are also deleted.
1528
+ #
1529
+ # Other Google Compute Engine resources that might be in use by the cluster,
1530
+ # such as load balancer resources, are not deleted if they weren't present
1531
+ # when the cluster was initially created.
1532
+ #
1533
+ # @overload delete_cluster(request, options = nil)
1534
+ # Pass arguments to `delete_cluster` via a request object, either of type
1535
+ # {::Google::Cloud::Container::V1::DeleteClusterRequest} or an equivalent Hash.
1536
+ #
1537
+ # @param request [::Google::Cloud::Container::V1::DeleteClusterRequest, ::Hash]
1538
+ # A request object representing the call parameters. Required. To specify no
1539
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1540
+ # @param options [::Gapic::CallOptions, ::Hash]
1541
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1542
+ #
1543
+ # @overload delete_cluster(project_id: nil, zone: nil, cluster_id: nil, name: nil)
1544
+ # Pass arguments to `delete_cluster` via keyword arguments. Note that at
1545
+ # least one keyword argument is required. To specify no parameters, or to keep all
1546
+ # the default parameter values, pass an empty Hash as a request object (see above).
1547
+ #
1548
+ # @param project_id [::String]
1549
+ # Deprecated. The Google Developers Console [project ID or project
1550
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
1551
+ # This field has been deprecated and replaced by the name field.
1552
+ # @param zone [::String]
1553
+ # Deprecated. The name of the Google Compute Engine
1554
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
1555
+ # cluster resides. This field has been deprecated and replaced by the name
1556
+ # field.
1557
+ # @param cluster_id [::String]
1558
+ # Deprecated. The name of the cluster to delete.
1559
+ # This field has been deprecated and replaced by the name field.
1560
+ # @param name [::String]
1561
+ # The name (project, location, cluster) of the cluster to delete.
1562
+ # Specified in the format `projects/*/locations/*/clusters/*`.
1563
+ # @yield [result, operation] Access the result along with the TransportOperation object
1564
+ # @yieldparam result [::Google::Cloud::Container::V1::Operation]
1565
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1566
+ #
1567
+ # @return [::Google::Cloud::Container::V1::Operation]
1568
+ #
1569
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1570
+ #
1571
+ # @example Basic example
1572
+ # require "google/cloud/container/v1"
1573
+ #
1574
+ # # Create a client object. The client can be reused for multiple calls.
1575
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
1576
+ #
1577
+ # # Create a request. To set request fields, pass in keyword arguments.
1578
+ # request = Google::Cloud::Container::V1::DeleteClusterRequest.new
1579
+ #
1580
+ # # Call the delete_cluster method.
1581
+ # result = client.delete_cluster request
1582
+ #
1583
+ # # The returned object is of type Google::Cloud::Container::V1::Operation.
1584
+ # p result
1585
+ #
1586
+ def delete_cluster request, options = nil
1587
+ raise ::ArgumentError, "request must be provided" if request.nil?
1588
+
1589
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::DeleteClusterRequest
1590
+
1591
+ # Converts hash and nil to an options object
1592
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1593
+
1594
+ # Customize the options with defaults
1595
+ call_metadata = @config.rpcs.delete_cluster.metadata.to_h
1596
+
1597
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1598
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1599
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1600
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
1601
+ transports_version_send: [:rest]
1602
+
1603
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1604
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1605
+
1606
+ options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout,
1607
+ metadata: call_metadata,
1608
+ retry_policy: @config.rpcs.delete_cluster.retry_policy
1609
+
1610
+ options.apply_defaults timeout: @config.timeout,
1611
+ metadata: @config.metadata,
1612
+ retry_policy: @config.retry_policy
1613
+
1614
+ @cluster_manager_stub.delete_cluster request, options do |result, operation|
1615
+ yield result, operation if block_given?
1616
+ return result
1617
+ end
1618
+ rescue ::Gapic::Rest::Error => e
1619
+ raise ::Google::Cloud::Error.from_error(e)
1620
+ end
1621
+
1622
+ ##
1623
+ # Lists all operations in a project in a specific zone or all zones.
1624
+ #
1625
+ # @overload list_operations(request, options = nil)
1626
+ # Pass arguments to `list_operations` via a request object, either of type
1627
+ # {::Google::Cloud::Container::V1::ListOperationsRequest} or an equivalent Hash.
1628
+ #
1629
+ # @param request [::Google::Cloud::Container::V1::ListOperationsRequest, ::Hash]
1630
+ # A request object representing the call parameters. Required. To specify no
1631
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1632
+ # @param options [::Gapic::CallOptions, ::Hash]
1633
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1634
+ #
1635
+ # @overload list_operations(project_id: nil, zone: nil, parent: nil)
1636
+ # Pass arguments to `list_operations` via keyword arguments. Note that at
1637
+ # least one keyword argument is required. To specify no parameters, or to keep all
1638
+ # the default parameter values, pass an empty Hash as a request object (see above).
1639
+ #
1640
+ # @param project_id [::String]
1641
+ # Deprecated. The Google Developers Console [project ID or project
1642
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
1643
+ # This field has been deprecated and replaced by the parent field.
1644
+ # @param zone [::String]
1645
+ # Deprecated. The name of the Google Compute Engine
1646
+ # [zone](https://cloud.google.com/compute/docs/zones#available) to return
1647
+ # operations for, or `-` for all zones. This field has been deprecated and
1648
+ # replaced by the parent field.
1649
+ # @param parent [::String]
1650
+ # The parent (project and location) where the operations will be listed.
1651
+ # Specified in the format `projects/*/locations/*`.
1652
+ # Location "-" matches all zones and all regions.
1653
+ # @yield [result, operation] Access the result along with the TransportOperation object
1654
+ # @yieldparam result [::Google::Cloud::Container::V1::ListOperationsResponse]
1655
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1656
+ #
1657
+ # @return [::Google::Cloud::Container::V1::ListOperationsResponse]
1658
+ #
1659
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1660
+ #
1661
+ # @example Basic example
1662
+ # require "google/cloud/container/v1"
1663
+ #
1664
+ # # Create a client object. The client can be reused for multiple calls.
1665
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
1666
+ #
1667
+ # # Create a request. To set request fields, pass in keyword arguments.
1668
+ # request = Google::Cloud::Container::V1::ListOperationsRequest.new
1669
+ #
1670
+ # # Call the list_operations method.
1671
+ # result = client.list_operations request
1672
+ #
1673
+ # # The returned object is of type Google::Cloud::Container::V1::ListOperationsResponse.
1674
+ # p result
1675
+ #
1676
+ def list_operations request, options = nil
1677
+ raise ::ArgumentError, "request must be provided" if request.nil?
1678
+
1679
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::ListOperationsRequest
1680
+
1681
+ # Converts hash and nil to an options object
1682
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1683
+
1684
+ # Customize the options with defaults
1685
+ call_metadata = @config.rpcs.list_operations.metadata.to_h
1686
+
1687
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1688
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1689
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1690
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
1691
+ transports_version_send: [:rest]
1692
+
1693
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1694
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1695
+
1696
+ options.apply_defaults timeout: @config.rpcs.list_operations.timeout,
1697
+ metadata: call_metadata,
1698
+ retry_policy: @config.rpcs.list_operations.retry_policy
1699
+
1700
+ options.apply_defaults timeout: @config.timeout,
1701
+ metadata: @config.metadata,
1702
+ retry_policy: @config.retry_policy
1703
+
1704
+ @cluster_manager_stub.list_operations request, options do |result, operation|
1705
+ yield result, operation if block_given?
1706
+ return result
1707
+ end
1708
+ rescue ::Gapic::Rest::Error => e
1709
+ raise ::Google::Cloud::Error.from_error(e)
1710
+ end
1711
+
1712
+ ##
1713
+ # Gets the specified operation.
1714
+ #
1715
+ # @overload get_operation(request, options = nil)
1716
+ # Pass arguments to `get_operation` via a request object, either of type
1717
+ # {::Google::Cloud::Container::V1::GetOperationRequest} or an equivalent Hash.
1718
+ #
1719
+ # @param request [::Google::Cloud::Container::V1::GetOperationRequest, ::Hash]
1720
+ # A request object representing the call parameters. Required. To specify no
1721
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1722
+ # @param options [::Gapic::CallOptions, ::Hash]
1723
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1724
+ #
1725
+ # @overload get_operation(project_id: nil, zone: nil, operation_id: nil, name: nil)
1726
+ # Pass arguments to `get_operation` via keyword arguments. Note that at
1727
+ # least one keyword argument is required. To specify no parameters, or to keep all
1728
+ # the default parameter values, pass an empty Hash as a request object (see above).
1729
+ #
1730
+ # @param project_id [::String]
1731
+ # Deprecated. The Google Developers Console [project ID or project
1732
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
1733
+ # This field has been deprecated and replaced by the name field.
1734
+ # @param zone [::String]
1735
+ # Deprecated. The name of the Google Compute Engine
1736
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
1737
+ # cluster resides. This field has been deprecated and replaced by the name
1738
+ # field.
1739
+ # @param operation_id [::String]
1740
+ # Deprecated. The server-assigned `name` of the operation.
1741
+ # This field has been deprecated and replaced by the name field.
1742
+ # @param name [::String]
1743
+ # The name (project, location, operation id) of the operation to get.
1744
+ # Specified in the format `projects/*/locations/*/operations/*`.
1745
+ # @yield [result, operation] Access the result along with the TransportOperation object
1746
+ # @yieldparam result [::Google::Cloud::Container::V1::Operation]
1747
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1748
+ #
1749
+ # @return [::Google::Cloud::Container::V1::Operation]
1750
+ #
1751
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1752
+ #
1753
+ # @example Basic example
1754
+ # require "google/cloud/container/v1"
1755
+ #
1756
+ # # Create a client object. The client can be reused for multiple calls.
1757
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
1758
+ #
1759
+ # # Create a request. To set request fields, pass in keyword arguments.
1760
+ # request = Google::Cloud::Container::V1::GetOperationRequest.new
1761
+ #
1762
+ # # Call the get_operation method.
1763
+ # result = client.get_operation request
1764
+ #
1765
+ # # The returned object is of type Google::Cloud::Container::V1::Operation.
1766
+ # p result
1767
+ #
1768
+ def get_operation request, options = nil
1769
+ raise ::ArgumentError, "request must be provided" if request.nil?
1770
+
1771
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::GetOperationRequest
1772
+
1773
+ # Converts hash and nil to an options object
1774
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1775
+
1776
+ # Customize the options with defaults
1777
+ call_metadata = @config.rpcs.get_operation.metadata.to_h
1778
+
1779
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1780
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1781
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1782
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
1783
+ transports_version_send: [:rest]
1784
+
1785
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1786
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1787
+
1788
+ options.apply_defaults timeout: @config.rpcs.get_operation.timeout,
1789
+ metadata: call_metadata,
1790
+ retry_policy: @config.rpcs.get_operation.retry_policy
1791
+
1792
+ options.apply_defaults timeout: @config.timeout,
1793
+ metadata: @config.metadata,
1794
+ retry_policy: @config.retry_policy
1795
+
1796
+ @cluster_manager_stub.get_operation request, options do |result, operation|
1797
+ yield result, operation if block_given?
1798
+ return result
1799
+ end
1800
+ rescue ::Gapic::Rest::Error => e
1801
+ raise ::Google::Cloud::Error.from_error(e)
1802
+ end
1803
+
1804
+ ##
1805
+ # Cancels the specified operation.
1806
+ #
1807
+ # @overload cancel_operation(request, options = nil)
1808
+ # Pass arguments to `cancel_operation` via a request object, either of type
1809
+ # {::Google::Cloud::Container::V1::CancelOperationRequest} or an equivalent Hash.
1810
+ #
1811
+ # @param request [::Google::Cloud::Container::V1::CancelOperationRequest, ::Hash]
1812
+ # A request object representing the call parameters. Required. To specify no
1813
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1814
+ # @param options [::Gapic::CallOptions, ::Hash]
1815
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1816
+ #
1817
+ # @overload cancel_operation(project_id: nil, zone: nil, operation_id: nil, name: nil)
1818
+ # Pass arguments to `cancel_operation` via keyword arguments. Note that at
1819
+ # least one keyword argument is required. To specify no parameters, or to keep all
1820
+ # the default parameter values, pass an empty Hash as a request object (see above).
1821
+ #
1822
+ # @param project_id [::String]
1823
+ # Deprecated. The Google Developers Console [project ID or project
1824
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
1825
+ # This field has been deprecated and replaced by the name field.
1826
+ # @param zone [::String]
1827
+ # Deprecated. The name of the Google Compute Engine
1828
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
1829
+ # operation resides. This field has been deprecated and replaced by the name
1830
+ # field.
1831
+ # @param operation_id [::String]
1832
+ # Deprecated. The server-assigned `name` of the operation.
1833
+ # This field has been deprecated and replaced by the name field.
1834
+ # @param name [::String]
1835
+ # The name (project, location, operation id) of the operation to cancel.
1836
+ # Specified in the format `projects/*/locations/*/operations/*`.
1837
+ # @yield [result, operation] Access the result along with the TransportOperation object
1838
+ # @yieldparam result [::Google::Protobuf::Empty]
1839
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1840
+ #
1841
+ # @return [::Google::Protobuf::Empty]
1842
+ #
1843
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1844
+ #
1845
+ # @example Basic example
1846
+ # require "google/cloud/container/v1"
1847
+ #
1848
+ # # Create a client object. The client can be reused for multiple calls.
1849
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
1850
+ #
1851
+ # # Create a request. To set request fields, pass in keyword arguments.
1852
+ # request = Google::Cloud::Container::V1::CancelOperationRequest.new
1853
+ #
1854
+ # # Call the cancel_operation method.
1855
+ # result = client.cancel_operation request
1856
+ #
1857
+ # # The returned object is of type Google::Protobuf::Empty.
1858
+ # p result
1859
+ #
1860
+ def cancel_operation request, options = nil
1861
+ raise ::ArgumentError, "request must be provided" if request.nil?
1862
+
1863
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::CancelOperationRequest
1864
+
1865
+ # Converts hash and nil to an options object
1866
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1867
+
1868
+ # Customize the options with defaults
1869
+ call_metadata = @config.rpcs.cancel_operation.metadata.to_h
1870
+
1871
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1872
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1873
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1874
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
1875
+ transports_version_send: [:rest]
1876
+
1877
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1878
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1879
+
1880
+ options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout,
1881
+ metadata: call_metadata,
1882
+ retry_policy: @config.rpcs.cancel_operation.retry_policy
1883
+
1884
+ options.apply_defaults timeout: @config.timeout,
1885
+ metadata: @config.metadata,
1886
+ retry_policy: @config.retry_policy
1887
+
1888
+ @cluster_manager_stub.cancel_operation request, options do |result, operation|
1889
+ yield result, operation if block_given?
1890
+ return result
1891
+ end
1892
+ rescue ::Gapic::Rest::Error => e
1893
+ raise ::Google::Cloud::Error.from_error(e)
1894
+ end
1895
+
1896
+ ##
1897
+ # Returns configuration info about the Google Kubernetes Engine service.
1898
+ #
1899
+ # @overload get_server_config(request, options = nil)
1900
+ # Pass arguments to `get_server_config` via a request object, either of type
1901
+ # {::Google::Cloud::Container::V1::GetServerConfigRequest} or an equivalent Hash.
1902
+ #
1903
+ # @param request [::Google::Cloud::Container::V1::GetServerConfigRequest, ::Hash]
1904
+ # A request object representing the call parameters. Required. To specify no
1905
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1906
+ # @param options [::Gapic::CallOptions, ::Hash]
1907
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1908
+ #
1909
+ # @overload get_server_config(project_id: nil, zone: nil, name: nil)
1910
+ # Pass arguments to `get_server_config` via keyword arguments. Note that at
1911
+ # least one keyword argument is required. To specify no parameters, or to keep all
1912
+ # the default parameter values, pass an empty Hash as a request object (see above).
1913
+ #
1914
+ # @param project_id [::String]
1915
+ # Deprecated. The Google Developers Console [project ID or project
1916
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
1917
+ # This field has been deprecated and replaced by the name field.
1918
+ # @param zone [::String]
1919
+ # Deprecated. The name of the Google Compute Engine
1920
+ # [zone](https://cloud.google.com/compute/docs/zones#available) to return
1921
+ # operations for. This field has been deprecated and replaced by the name
1922
+ # field.
1923
+ # @param name [::String]
1924
+ # The name (project and location) of the server config to get,
1925
+ # specified in the format `projects/*/locations/*`.
1926
+ # @yield [result, operation] Access the result along with the TransportOperation object
1927
+ # @yieldparam result [::Google::Cloud::Container::V1::ServerConfig]
1928
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1929
+ #
1930
+ # @return [::Google::Cloud::Container::V1::ServerConfig]
1931
+ #
1932
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1933
+ #
1934
+ # @example Basic example
1935
+ # require "google/cloud/container/v1"
1936
+ #
1937
+ # # Create a client object. The client can be reused for multiple calls.
1938
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
1939
+ #
1940
+ # # Create a request. To set request fields, pass in keyword arguments.
1941
+ # request = Google::Cloud::Container::V1::GetServerConfigRequest.new
1942
+ #
1943
+ # # Call the get_server_config method.
1944
+ # result = client.get_server_config request
1945
+ #
1946
+ # # The returned object is of type Google::Cloud::Container::V1::ServerConfig.
1947
+ # p result
1948
+ #
1949
+ def get_server_config request, options = nil
1950
+ raise ::ArgumentError, "request must be provided" if request.nil?
1951
+
1952
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::GetServerConfigRequest
1953
+
1954
+ # Converts hash and nil to an options object
1955
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1956
+
1957
+ # Customize the options with defaults
1958
+ call_metadata = @config.rpcs.get_server_config.metadata.to_h
1959
+
1960
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1961
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1962
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1963
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
1964
+ transports_version_send: [:rest]
1965
+
1966
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1967
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1968
+
1969
+ options.apply_defaults timeout: @config.rpcs.get_server_config.timeout,
1970
+ metadata: call_metadata,
1971
+ retry_policy: @config.rpcs.get_server_config.retry_policy
1972
+
1973
+ options.apply_defaults timeout: @config.timeout,
1974
+ metadata: @config.metadata,
1975
+ retry_policy: @config.retry_policy
1976
+
1977
+ @cluster_manager_stub.get_server_config request, options do |result, operation|
1978
+ yield result, operation if block_given?
1979
+ return result
1980
+ end
1981
+ rescue ::Gapic::Rest::Error => e
1982
+ raise ::Google::Cloud::Error.from_error(e)
1983
+ end
1984
+
1985
+ ##
1986
+ # Gets the public component of the cluster signing keys in
1987
+ # JSON Web Key format.
1988
+ #
1989
+ # @overload get_json_web_keys(request, options = nil)
1990
+ # Pass arguments to `get_json_web_keys` via a request object, either of type
1991
+ # {::Google::Cloud::Container::V1::GetJSONWebKeysRequest} or an equivalent Hash.
1992
+ #
1993
+ # @param request [::Google::Cloud::Container::V1::GetJSONWebKeysRequest, ::Hash]
1994
+ # A request object representing the call parameters. Required. To specify no
1995
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1996
+ # @param options [::Gapic::CallOptions, ::Hash]
1997
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1998
+ #
1999
+ # @overload get_json_web_keys(parent: nil)
2000
+ # Pass arguments to `get_json_web_keys` via keyword arguments. Note that at
2001
+ # least one keyword argument is required. To specify no parameters, or to keep all
2002
+ # the default parameter values, pass an empty Hash as a request object (see above).
2003
+ #
2004
+ # @param parent [::String]
2005
+ # The cluster (project, location, cluster name) to get keys for. Specified in
2006
+ # the format `projects/*/locations/*/clusters/*`.
2007
+ # @yield [result, operation] Access the result along with the TransportOperation object
2008
+ # @yieldparam result [::Google::Cloud::Container::V1::GetJSONWebKeysResponse]
2009
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2010
+ #
2011
+ # @return [::Google::Cloud::Container::V1::GetJSONWebKeysResponse]
2012
+ #
2013
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2014
+ #
2015
+ # @example Basic example
2016
+ # require "google/cloud/container/v1"
2017
+ #
2018
+ # # Create a client object. The client can be reused for multiple calls.
2019
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
2020
+ #
2021
+ # # Create a request. To set request fields, pass in keyword arguments.
2022
+ # request = Google::Cloud::Container::V1::GetJSONWebKeysRequest.new
2023
+ #
2024
+ # # Call the get_json_web_keys method.
2025
+ # result = client.get_json_web_keys request
2026
+ #
2027
+ # # The returned object is of type Google::Cloud::Container::V1::GetJSONWebKeysResponse.
2028
+ # p result
2029
+ #
2030
+ def get_json_web_keys request, options = nil
2031
+ raise ::ArgumentError, "request must be provided" if request.nil?
2032
+
2033
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::GetJSONWebKeysRequest
2034
+
2035
+ # Converts hash and nil to an options object
2036
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2037
+
2038
+ # Customize the options with defaults
2039
+ call_metadata = @config.rpcs.get_json_web_keys.metadata.to_h
2040
+
2041
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2042
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2043
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2044
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
2045
+ transports_version_send: [:rest]
2046
+
2047
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2048
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2049
+
2050
+ options.apply_defaults timeout: @config.rpcs.get_json_web_keys.timeout,
2051
+ metadata: call_metadata,
2052
+ retry_policy: @config.rpcs.get_json_web_keys.retry_policy
2053
+
2054
+ options.apply_defaults timeout: @config.timeout,
2055
+ metadata: @config.metadata,
2056
+ retry_policy: @config.retry_policy
2057
+
2058
+ @cluster_manager_stub.get_json_web_keys request, options do |result, operation|
2059
+ yield result, operation if block_given?
2060
+ return result
2061
+ end
2062
+ rescue ::Gapic::Rest::Error => e
2063
+ raise ::Google::Cloud::Error.from_error(e)
2064
+ end
2065
+
2066
+ ##
2067
+ # Lists the node pools for a cluster.
2068
+ #
2069
+ # @overload list_node_pools(request, options = nil)
2070
+ # Pass arguments to `list_node_pools` via a request object, either of type
2071
+ # {::Google::Cloud::Container::V1::ListNodePoolsRequest} or an equivalent Hash.
2072
+ #
2073
+ # @param request [::Google::Cloud::Container::V1::ListNodePoolsRequest, ::Hash]
2074
+ # A request object representing the call parameters. Required. To specify no
2075
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2076
+ # @param options [::Gapic::CallOptions, ::Hash]
2077
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2078
+ #
2079
+ # @overload list_node_pools(project_id: nil, zone: nil, cluster_id: nil, parent: nil)
2080
+ # Pass arguments to `list_node_pools` via keyword arguments. Note that at
2081
+ # least one keyword argument is required. To specify no parameters, or to keep all
2082
+ # the default parameter values, pass an empty Hash as a request object (see above).
2083
+ #
2084
+ # @param project_id [::String]
2085
+ # Deprecated. The Google Developers Console [project ID or project
2086
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
2087
+ # This field has been deprecated and replaced by the parent field.
2088
+ # @param zone [::String]
2089
+ # Deprecated. The name of the Google Compute Engine
2090
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
2091
+ # cluster resides. This field has been deprecated and replaced by the parent
2092
+ # field.
2093
+ # @param cluster_id [::String]
2094
+ # Deprecated. The name of the cluster.
2095
+ # This field has been deprecated and replaced by the parent field.
2096
+ # @param parent [::String]
2097
+ # The parent (project, location, cluster name) where the node pools will be
2098
+ # listed. Specified in the format `projects/*/locations/*/clusters/*`.
2099
+ # @yield [result, operation] Access the result along with the TransportOperation object
2100
+ # @yieldparam result [::Google::Cloud::Container::V1::ListNodePoolsResponse]
2101
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2102
+ #
2103
+ # @return [::Google::Cloud::Container::V1::ListNodePoolsResponse]
2104
+ #
2105
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2106
+ #
2107
+ # @example Basic example
2108
+ # require "google/cloud/container/v1"
2109
+ #
2110
+ # # Create a client object. The client can be reused for multiple calls.
2111
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
2112
+ #
2113
+ # # Create a request. To set request fields, pass in keyword arguments.
2114
+ # request = Google::Cloud::Container::V1::ListNodePoolsRequest.new
2115
+ #
2116
+ # # Call the list_node_pools method.
2117
+ # result = client.list_node_pools request
2118
+ #
2119
+ # # The returned object is of type Google::Cloud::Container::V1::ListNodePoolsResponse.
2120
+ # p result
2121
+ #
2122
+ def list_node_pools request, options = nil
2123
+ raise ::ArgumentError, "request must be provided" if request.nil?
2124
+
2125
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::ListNodePoolsRequest
2126
+
2127
+ # Converts hash and nil to an options object
2128
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2129
+
2130
+ # Customize the options with defaults
2131
+ call_metadata = @config.rpcs.list_node_pools.metadata.to_h
2132
+
2133
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2134
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2135
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2136
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
2137
+ transports_version_send: [:rest]
2138
+
2139
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2140
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2141
+
2142
+ options.apply_defaults timeout: @config.rpcs.list_node_pools.timeout,
2143
+ metadata: call_metadata,
2144
+ retry_policy: @config.rpcs.list_node_pools.retry_policy
2145
+
2146
+ options.apply_defaults timeout: @config.timeout,
2147
+ metadata: @config.metadata,
2148
+ retry_policy: @config.retry_policy
2149
+
2150
+ @cluster_manager_stub.list_node_pools request, options do |result, operation|
2151
+ yield result, operation if block_given?
2152
+ return result
2153
+ end
2154
+ rescue ::Gapic::Rest::Error => e
2155
+ raise ::Google::Cloud::Error.from_error(e)
2156
+ end
2157
+
2158
+ ##
2159
+ # Retrieves the requested node pool.
2160
+ #
2161
+ # @overload get_node_pool(request, options = nil)
2162
+ # Pass arguments to `get_node_pool` via a request object, either of type
2163
+ # {::Google::Cloud::Container::V1::GetNodePoolRequest} or an equivalent Hash.
2164
+ #
2165
+ # @param request [::Google::Cloud::Container::V1::GetNodePoolRequest, ::Hash]
2166
+ # A request object representing the call parameters. Required. To specify no
2167
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2168
+ # @param options [::Gapic::CallOptions, ::Hash]
2169
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2170
+ #
2171
+ # @overload get_node_pool(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, name: nil)
2172
+ # Pass arguments to `get_node_pool` via keyword arguments. Note that at
2173
+ # least one keyword argument is required. To specify no parameters, or to keep all
2174
+ # the default parameter values, pass an empty Hash as a request object (see above).
2175
+ #
2176
+ # @param project_id [::String]
2177
+ # Deprecated. The Google Developers Console [project ID or project
2178
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
2179
+ # This field has been deprecated and replaced by the name field.
2180
+ # @param zone [::String]
2181
+ # Deprecated. The name of the Google Compute Engine
2182
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
2183
+ # cluster resides. This field has been deprecated and replaced by the name
2184
+ # field.
2185
+ # @param cluster_id [::String]
2186
+ # Deprecated. The name of the cluster.
2187
+ # This field has been deprecated and replaced by the name field.
2188
+ # @param node_pool_id [::String]
2189
+ # Deprecated. The name of the node pool.
2190
+ # This field has been deprecated and replaced by the name field.
2191
+ # @param name [::String]
2192
+ # The name (project, location, cluster, node pool id) of the node pool to
2193
+ # get. Specified in the format
2194
+ # `projects/*/locations/*/clusters/*/nodePools/*`.
2195
+ # @yield [result, operation] Access the result along with the TransportOperation object
2196
+ # @yieldparam result [::Google::Cloud::Container::V1::NodePool]
2197
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2198
+ #
2199
+ # @return [::Google::Cloud::Container::V1::NodePool]
2200
+ #
2201
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2202
+ #
2203
+ # @example Basic example
2204
+ # require "google/cloud/container/v1"
2205
+ #
2206
+ # # Create a client object. The client can be reused for multiple calls.
2207
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
2208
+ #
2209
+ # # Create a request. To set request fields, pass in keyword arguments.
2210
+ # request = Google::Cloud::Container::V1::GetNodePoolRequest.new
2211
+ #
2212
+ # # Call the get_node_pool method.
2213
+ # result = client.get_node_pool request
2214
+ #
2215
+ # # The returned object is of type Google::Cloud::Container::V1::NodePool.
2216
+ # p result
2217
+ #
2218
+ def get_node_pool request, options = nil
2219
+ raise ::ArgumentError, "request must be provided" if request.nil?
2220
+
2221
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::GetNodePoolRequest
2222
+
2223
+ # Converts hash and nil to an options object
2224
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2225
+
2226
+ # Customize the options with defaults
2227
+ call_metadata = @config.rpcs.get_node_pool.metadata.to_h
2228
+
2229
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2230
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2231
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2232
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
2233
+ transports_version_send: [:rest]
2234
+
2235
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2236
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2237
+
2238
+ options.apply_defaults timeout: @config.rpcs.get_node_pool.timeout,
2239
+ metadata: call_metadata,
2240
+ retry_policy: @config.rpcs.get_node_pool.retry_policy
2241
+
2242
+ options.apply_defaults timeout: @config.timeout,
2243
+ metadata: @config.metadata,
2244
+ retry_policy: @config.retry_policy
2245
+
2246
+ @cluster_manager_stub.get_node_pool request, options do |result, operation|
2247
+ yield result, operation if block_given?
2248
+ return result
2249
+ end
2250
+ rescue ::Gapic::Rest::Error => e
2251
+ raise ::Google::Cloud::Error.from_error(e)
2252
+ end
2253
+
2254
+ ##
2255
+ # Creates a node pool for a cluster.
2256
+ #
2257
+ # @overload create_node_pool(request, options = nil)
2258
+ # Pass arguments to `create_node_pool` via a request object, either of type
2259
+ # {::Google::Cloud::Container::V1::CreateNodePoolRequest} or an equivalent Hash.
2260
+ #
2261
+ # @param request [::Google::Cloud::Container::V1::CreateNodePoolRequest, ::Hash]
2262
+ # A request object representing the call parameters. Required. To specify no
2263
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2264
+ # @param options [::Gapic::CallOptions, ::Hash]
2265
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2266
+ #
2267
+ # @overload create_node_pool(project_id: nil, zone: nil, cluster_id: nil, node_pool: nil, parent: nil)
2268
+ # Pass arguments to `create_node_pool` via keyword arguments. Note that at
2269
+ # least one keyword argument is required. To specify no parameters, or to keep all
2270
+ # the default parameter values, pass an empty Hash as a request object (see above).
2271
+ #
2272
+ # @param project_id [::String]
2273
+ # Deprecated. The Google Developers Console [project ID or project
2274
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
2275
+ # This field has been deprecated and replaced by the parent field.
2276
+ # @param zone [::String]
2277
+ # Deprecated. The name of the Google Compute Engine
2278
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
2279
+ # cluster resides. This field has been deprecated and replaced by the parent
2280
+ # field.
2281
+ # @param cluster_id [::String]
2282
+ # Deprecated. The name of the cluster.
2283
+ # This field has been deprecated and replaced by the parent field.
2284
+ # @param node_pool [::Google::Cloud::Container::V1::NodePool, ::Hash]
2285
+ # Required. The node pool to create.
2286
+ # @param parent [::String]
2287
+ # The parent (project, location, cluster name) where the node pool will be
2288
+ # created. Specified in the format
2289
+ # `projects/*/locations/*/clusters/*`.
2290
+ # @yield [result, operation] Access the result along with the TransportOperation object
2291
+ # @yieldparam result [::Google::Cloud::Container::V1::Operation]
2292
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2293
+ #
2294
+ # @return [::Google::Cloud::Container::V1::Operation]
2295
+ #
2296
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2297
+ #
2298
+ # @example Basic example
2299
+ # require "google/cloud/container/v1"
2300
+ #
2301
+ # # Create a client object. The client can be reused for multiple calls.
2302
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
2303
+ #
2304
+ # # Create a request. To set request fields, pass in keyword arguments.
2305
+ # request = Google::Cloud::Container::V1::CreateNodePoolRequest.new
2306
+ #
2307
+ # # Call the create_node_pool method.
2308
+ # result = client.create_node_pool request
2309
+ #
2310
+ # # The returned object is of type Google::Cloud::Container::V1::Operation.
2311
+ # p result
2312
+ #
2313
+ def create_node_pool request, options = nil
2314
+ raise ::ArgumentError, "request must be provided" if request.nil?
2315
+
2316
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::CreateNodePoolRequest
2317
+
2318
+ # Converts hash and nil to an options object
2319
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2320
+
2321
+ # Customize the options with defaults
2322
+ call_metadata = @config.rpcs.create_node_pool.metadata.to_h
2323
+
2324
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2325
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2326
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2327
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
2328
+ transports_version_send: [:rest]
2329
+
2330
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2331
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2332
+
2333
+ options.apply_defaults timeout: @config.rpcs.create_node_pool.timeout,
2334
+ metadata: call_metadata,
2335
+ retry_policy: @config.rpcs.create_node_pool.retry_policy
2336
+
2337
+ options.apply_defaults timeout: @config.timeout,
2338
+ metadata: @config.metadata,
2339
+ retry_policy: @config.retry_policy
2340
+
2341
+ @cluster_manager_stub.create_node_pool request, options do |result, operation|
2342
+ yield result, operation if block_given?
2343
+ return result
2344
+ end
2345
+ rescue ::Gapic::Rest::Error => e
2346
+ raise ::Google::Cloud::Error.from_error(e)
2347
+ end
2348
+
2349
+ ##
2350
+ # Deletes a node pool from a cluster.
2351
+ #
2352
+ # @overload delete_node_pool(request, options = nil)
2353
+ # Pass arguments to `delete_node_pool` via a request object, either of type
2354
+ # {::Google::Cloud::Container::V1::DeleteNodePoolRequest} or an equivalent Hash.
2355
+ #
2356
+ # @param request [::Google::Cloud::Container::V1::DeleteNodePoolRequest, ::Hash]
2357
+ # A request object representing the call parameters. Required. To specify no
2358
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2359
+ # @param options [::Gapic::CallOptions, ::Hash]
2360
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2361
+ #
2362
+ # @overload delete_node_pool(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, name: nil)
2363
+ # Pass arguments to `delete_node_pool` via keyword arguments. Note that at
2364
+ # least one keyword argument is required. To specify no parameters, or to keep all
2365
+ # the default parameter values, pass an empty Hash as a request object (see above).
2366
+ #
2367
+ # @param project_id [::String]
2368
+ # Deprecated. The Google Developers Console [project ID or project
2369
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
2370
+ # This field has been deprecated and replaced by the name field.
2371
+ # @param zone [::String]
2372
+ # Deprecated. The name of the Google Compute Engine
2373
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
2374
+ # cluster resides. This field has been deprecated and replaced by the name
2375
+ # field.
2376
+ # @param cluster_id [::String]
2377
+ # Deprecated. The name of the cluster.
2378
+ # This field has been deprecated and replaced by the name field.
2379
+ # @param node_pool_id [::String]
2380
+ # Deprecated. The name of the node pool to delete.
2381
+ # This field has been deprecated and replaced by the name field.
2382
+ # @param name [::String]
2383
+ # The name (project, location, cluster, node pool id) of the node pool to
2384
+ # delete. Specified in the format
2385
+ # `projects/*/locations/*/clusters/*/nodePools/*`.
2386
+ # @yield [result, operation] Access the result along with the TransportOperation object
2387
+ # @yieldparam result [::Google::Cloud::Container::V1::Operation]
2388
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2389
+ #
2390
+ # @return [::Google::Cloud::Container::V1::Operation]
2391
+ #
2392
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2393
+ #
2394
+ # @example Basic example
2395
+ # require "google/cloud/container/v1"
2396
+ #
2397
+ # # Create a client object. The client can be reused for multiple calls.
2398
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
2399
+ #
2400
+ # # Create a request. To set request fields, pass in keyword arguments.
2401
+ # request = Google::Cloud::Container::V1::DeleteNodePoolRequest.new
2402
+ #
2403
+ # # Call the delete_node_pool method.
2404
+ # result = client.delete_node_pool request
2405
+ #
2406
+ # # The returned object is of type Google::Cloud::Container::V1::Operation.
2407
+ # p result
2408
+ #
2409
+ def delete_node_pool request, options = nil
2410
+ raise ::ArgumentError, "request must be provided" if request.nil?
2411
+
2412
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::DeleteNodePoolRequest
2413
+
2414
+ # Converts hash and nil to an options object
2415
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2416
+
2417
+ # Customize the options with defaults
2418
+ call_metadata = @config.rpcs.delete_node_pool.metadata.to_h
2419
+
2420
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2421
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2422
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2423
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
2424
+ transports_version_send: [:rest]
2425
+
2426
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2427
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2428
+
2429
+ options.apply_defaults timeout: @config.rpcs.delete_node_pool.timeout,
2430
+ metadata: call_metadata,
2431
+ retry_policy: @config.rpcs.delete_node_pool.retry_policy
2432
+
2433
+ options.apply_defaults timeout: @config.timeout,
2434
+ metadata: @config.metadata,
2435
+ retry_policy: @config.retry_policy
2436
+
2437
+ @cluster_manager_stub.delete_node_pool request, options do |result, operation|
2438
+ yield result, operation if block_given?
2439
+ return result
2440
+ end
2441
+ rescue ::Gapic::Rest::Error => e
2442
+ raise ::Google::Cloud::Error.from_error(e)
2443
+ end
2444
+
2445
+ ##
2446
+ # CompleteNodePoolUpgrade will signal an on-going node pool upgrade to
2447
+ # complete.
2448
+ #
2449
+ # @overload complete_node_pool_upgrade(request, options = nil)
2450
+ # Pass arguments to `complete_node_pool_upgrade` via a request object, either of type
2451
+ # {::Google::Cloud::Container::V1::CompleteNodePoolUpgradeRequest} or an equivalent Hash.
2452
+ #
2453
+ # @param request [::Google::Cloud::Container::V1::CompleteNodePoolUpgradeRequest, ::Hash]
2454
+ # A request object representing the call parameters. Required. To specify no
2455
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2456
+ # @param options [::Gapic::CallOptions, ::Hash]
2457
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2458
+ #
2459
+ # @overload complete_node_pool_upgrade(name: nil)
2460
+ # Pass arguments to `complete_node_pool_upgrade` via keyword arguments. Note that at
2461
+ # least one keyword argument is required. To specify no parameters, or to keep all
2462
+ # the default parameter values, pass an empty Hash as a request object (see above).
2463
+ #
2464
+ # @param name [::String]
2465
+ # The name (project, location, cluster, node pool id) of the node pool to
2466
+ # complete upgrade.
2467
+ # Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`.
2468
+ # @yield [result, operation] Access the result along with the TransportOperation object
2469
+ # @yieldparam result [::Google::Protobuf::Empty]
2470
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2471
+ #
2472
+ # @return [::Google::Protobuf::Empty]
2473
+ #
2474
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2475
+ #
2476
+ # @example Basic example
2477
+ # require "google/cloud/container/v1"
2478
+ #
2479
+ # # Create a client object. The client can be reused for multiple calls.
2480
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
2481
+ #
2482
+ # # Create a request. To set request fields, pass in keyword arguments.
2483
+ # request = Google::Cloud::Container::V1::CompleteNodePoolUpgradeRequest.new
2484
+ #
2485
+ # # Call the complete_node_pool_upgrade method.
2486
+ # result = client.complete_node_pool_upgrade request
2487
+ #
2488
+ # # The returned object is of type Google::Protobuf::Empty.
2489
+ # p result
2490
+ #
2491
+ def complete_node_pool_upgrade request, options = nil
2492
+ raise ::ArgumentError, "request must be provided" if request.nil?
2493
+
2494
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::CompleteNodePoolUpgradeRequest
2495
+
2496
+ # Converts hash and nil to an options object
2497
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2498
+
2499
+ # Customize the options with defaults
2500
+ call_metadata = @config.rpcs.complete_node_pool_upgrade.metadata.to_h
2501
+
2502
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2503
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2504
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2505
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
2506
+ transports_version_send: [:rest]
2507
+
2508
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2509
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2510
+
2511
+ options.apply_defaults timeout: @config.rpcs.complete_node_pool_upgrade.timeout,
2512
+ metadata: call_metadata,
2513
+ retry_policy: @config.rpcs.complete_node_pool_upgrade.retry_policy
2514
+
2515
+ options.apply_defaults timeout: @config.timeout,
2516
+ metadata: @config.metadata,
2517
+ retry_policy: @config.retry_policy
2518
+
2519
+ @cluster_manager_stub.complete_node_pool_upgrade request, options do |result, operation|
2520
+ yield result, operation if block_given?
2521
+ return result
2522
+ end
2523
+ rescue ::Gapic::Rest::Error => e
2524
+ raise ::Google::Cloud::Error.from_error(e)
2525
+ end
2526
+
2527
+ ##
2528
+ # Rolls back a previously Aborted or Failed NodePool upgrade.
2529
+ # This makes no changes if the last upgrade successfully completed.
2530
+ #
2531
+ # @overload rollback_node_pool_upgrade(request, options = nil)
2532
+ # Pass arguments to `rollback_node_pool_upgrade` via a request object, either of type
2533
+ # {::Google::Cloud::Container::V1::RollbackNodePoolUpgradeRequest} or an equivalent Hash.
2534
+ #
2535
+ # @param request [::Google::Cloud::Container::V1::RollbackNodePoolUpgradeRequest, ::Hash]
2536
+ # A request object representing the call parameters. Required. To specify no
2537
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2538
+ # @param options [::Gapic::CallOptions, ::Hash]
2539
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2540
+ #
2541
+ # @overload rollback_node_pool_upgrade(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, name: nil, respect_pdb: nil)
2542
+ # Pass arguments to `rollback_node_pool_upgrade` via keyword arguments. Note that at
2543
+ # least one keyword argument is required. To specify no parameters, or to keep all
2544
+ # the default parameter values, pass an empty Hash as a request object (see above).
2545
+ #
2546
+ # @param project_id [::String]
2547
+ # Deprecated. The Google Developers Console [project ID or project
2548
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
2549
+ # This field has been deprecated and replaced by the name field.
2550
+ # @param zone [::String]
2551
+ # Deprecated. The name of the Google Compute Engine
2552
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
2553
+ # cluster resides. This field has been deprecated and replaced by the name
2554
+ # field.
2555
+ # @param cluster_id [::String]
2556
+ # Deprecated. The name of the cluster to rollback.
2557
+ # This field has been deprecated and replaced by the name field.
2558
+ # @param node_pool_id [::String]
2559
+ # Deprecated. The name of the node pool to rollback.
2560
+ # This field has been deprecated and replaced by the name field.
2561
+ # @param name [::String]
2562
+ # The name (project, location, cluster, node pool id) of the node poll to
2563
+ # rollback upgrade.
2564
+ # Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`.
2565
+ # @param respect_pdb [::Boolean]
2566
+ # Option for rollback to ignore the PodDisruptionBudget.
2567
+ # Default value is false.
2568
+ # @yield [result, operation] Access the result along with the TransportOperation object
2569
+ # @yieldparam result [::Google::Cloud::Container::V1::Operation]
2570
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2571
+ #
2572
+ # @return [::Google::Cloud::Container::V1::Operation]
2573
+ #
2574
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2575
+ #
2576
+ # @example Basic example
2577
+ # require "google/cloud/container/v1"
2578
+ #
2579
+ # # Create a client object. The client can be reused for multiple calls.
2580
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
2581
+ #
2582
+ # # Create a request. To set request fields, pass in keyword arguments.
2583
+ # request = Google::Cloud::Container::V1::RollbackNodePoolUpgradeRequest.new
2584
+ #
2585
+ # # Call the rollback_node_pool_upgrade method.
2586
+ # result = client.rollback_node_pool_upgrade request
2587
+ #
2588
+ # # The returned object is of type Google::Cloud::Container::V1::Operation.
2589
+ # p result
2590
+ #
2591
+ def rollback_node_pool_upgrade request, options = nil
2592
+ raise ::ArgumentError, "request must be provided" if request.nil?
2593
+
2594
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::RollbackNodePoolUpgradeRequest
2595
+
2596
+ # Converts hash and nil to an options object
2597
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2598
+
2599
+ # Customize the options with defaults
2600
+ call_metadata = @config.rpcs.rollback_node_pool_upgrade.metadata.to_h
2601
+
2602
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2603
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2604
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2605
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
2606
+ transports_version_send: [:rest]
2607
+
2608
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2609
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2610
+
2611
+ options.apply_defaults timeout: @config.rpcs.rollback_node_pool_upgrade.timeout,
2612
+ metadata: call_metadata,
2613
+ retry_policy: @config.rpcs.rollback_node_pool_upgrade.retry_policy
2614
+
2615
+ options.apply_defaults timeout: @config.timeout,
2616
+ metadata: @config.metadata,
2617
+ retry_policy: @config.retry_policy
2618
+
2619
+ @cluster_manager_stub.rollback_node_pool_upgrade request, options do |result, operation|
2620
+ yield result, operation if block_given?
2621
+ return result
2622
+ end
2623
+ rescue ::Gapic::Rest::Error => e
2624
+ raise ::Google::Cloud::Error.from_error(e)
2625
+ end
2626
+
2627
+ ##
2628
+ # Sets the NodeManagement options for a node pool.
2629
+ #
2630
+ # @overload set_node_pool_management(request, options = nil)
2631
+ # Pass arguments to `set_node_pool_management` via a request object, either of type
2632
+ # {::Google::Cloud::Container::V1::SetNodePoolManagementRequest} or an equivalent Hash.
2633
+ #
2634
+ # @param request [::Google::Cloud::Container::V1::SetNodePoolManagementRequest, ::Hash]
2635
+ # A request object representing the call parameters. Required. To specify no
2636
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2637
+ # @param options [::Gapic::CallOptions, ::Hash]
2638
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2639
+ #
2640
+ # @overload set_node_pool_management(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, management: nil, name: nil)
2641
+ # Pass arguments to `set_node_pool_management` via keyword arguments. Note that at
2642
+ # least one keyword argument is required. To specify no parameters, or to keep all
2643
+ # the default parameter values, pass an empty Hash as a request object (see above).
2644
+ #
2645
+ # @param project_id [::String]
2646
+ # Deprecated. The Google Developers Console [project ID or project
2647
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
2648
+ # This field has been deprecated and replaced by the name field.
2649
+ # @param zone [::String]
2650
+ # Deprecated. The name of the Google Compute Engine
2651
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
2652
+ # cluster resides. This field has been deprecated and replaced by the name
2653
+ # field.
2654
+ # @param cluster_id [::String]
2655
+ # Deprecated. The name of the cluster to update.
2656
+ # This field has been deprecated and replaced by the name field.
2657
+ # @param node_pool_id [::String]
2658
+ # Deprecated. The name of the node pool to update.
2659
+ # This field has been deprecated and replaced by the name field.
2660
+ # @param management [::Google::Cloud::Container::V1::NodeManagement, ::Hash]
2661
+ # Required. NodeManagement configuration for the node pool.
2662
+ # @param name [::String]
2663
+ # The name (project, location, cluster, node pool id) of the node pool to set
2664
+ # management properties. Specified in the format
2665
+ # `projects/*/locations/*/clusters/*/nodePools/*`.
2666
+ # @yield [result, operation] Access the result along with the TransportOperation object
2667
+ # @yieldparam result [::Google::Cloud::Container::V1::Operation]
2668
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2669
+ #
2670
+ # @return [::Google::Cloud::Container::V1::Operation]
2671
+ #
2672
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2673
+ #
2674
+ # @example Basic example
2675
+ # require "google/cloud/container/v1"
2676
+ #
2677
+ # # Create a client object. The client can be reused for multiple calls.
2678
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
2679
+ #
2680
+ # # Create a request. To set request fields, pass in keyword arguments.
2681
+ # request = Google::Cloud::Container::V1::SetNodePoolManagementRequest.new
2682
+ #
2683
+ # # Call the set_node_pool_management method.
2684
+ # result = client.set_node_pool_management request
2685
+ #
2686
+ # # The returned object is of type Google::Cloud::Container::V1::Operation.
2687
+ # p result
2688
+ #
2689
+ def set_node_pool_management request, options = nil
2690
+ raise ::ArgumentError, "request must be provided" if request.nil?
2691
+
2692
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::SetNodePoolManagementRequest
2693
+
2694
+ # Converts hash and nil to an options object
2695
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2696
+
2697
+ # Customize the options with defaults
2698
+ call_metadata = @config.rpcs.set_node_pool_management.metadata.to_h
2699
+
2700
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2701
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2702
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2703
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
2704
+ transports_version_send: [:rest]
2705
+
2706
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2707
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2708
+
2709
+ options.apply_defaults timeout: @config.rpcs.set_node_pool_management.timeout,
2710
+ metadata: call_metadata,
2711
+ retry_policy: @config.rpcs.set_node_pool_management.retry_policy
2712
+
2713
+ options.apply_defaults timeout: @config.timeout,
2714
+ metadata: @config.metadata,
2715
+ retry_policy: @config.retry_policy
2716
+
2717
+ @cluster_manager_stub.set_node_pool_management request, options do |result, operation|
2718
+ yield result, operation if block_given?
2719
+ return result
2720
+ end
2721
+ rescue ::Gapic::Rest::Error => e
2722
+ raise ::Google::Cloud::Error.from_error(e)
2723
+ end
2724
+
2725
+ ##
2726
+ # Sets labels on a cluster.
2727
+ #
2728
+ # @overload set_labels(request, options = nil)
2729
+ # Pass arguments to `set_labels` via a request object, either of type
2730
+ # {::Google::Cloud::Container::V1::SetLabelsRequest} or an equivalent Hash.
2731
+ #
2732
+ # @param request [::Google::Cloud::Container::V1::SetLabelsRequest, ::Hash]
2733
+ # A request object representing the call parameters. Required. To specify no
2734
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2735
+ # @param options [::Gapic::CallOptions, ::Hash]
2736
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2737
+ #
2738
+ # @overload set_labels(project_id: nil, zone: nil, cluster_id: nil, resource_labels: nil, label_fingerprint: nil, name: nil)
2739
+ # Pass arguments to `set_labels` via keyword arguments. Note that at
2740
+ # least one keyword argument is required. To specify no parameters, or to keep all
2741
+ # the default parameter values, pass an empty Hash as a request object (see above).
2742
+ #
2743
+ # @param project_id [::String]
2744
+ # Deprecated. The Google Developers Console [project ID or project
2745
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
2746
+ # This field has been deprecated and replaced by the name field.
2747
+ # @param zone [::String]
2748
+ # Deprecated. The name of the Google Compute Engine
2749
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
2750
+ # cluster resides. This field has been deprecated and replaced by the name
2751
+ # field.
2752
+ # @param cluster_id [::String]
2753
+ # Deprecated. The name of the cluster.
2754
+ # This field has been deprecated and replaced by the name field.
2755
+ # @param resource_labels [::Hash{::String => ::String}]
2756
+ # Required. The labels to set for that cluster.
2757
+ # @param label_fingerprint [::String]
2758
+ # Required. The fingerprint of the previous set of labels for this resource,
2759
+ # used to detect conflicts. The fingerprint is initially generated by
2760
+ # Kubernetes Engine and changes after every request to modify or update
2761
+ # labels. You must always provide an up-to-date fingerprint hash when
2762
+ # updating or changing labels. Make a `get()` request to the
2763
+ # resource to get the latest fingerprint.
2764
+ # @param name [::String]
2765
+ # The name (project, location, cluster name) of the cluster to set labels.
2766
+ # Specified in the format `projects/*/locations/*/clusters/*`.
2767
+ # @yield [result, operation] Access the result along with the TransportOperation object
2768
+ # @yieldparam result [::Google::Cloud::Container::V1::Operation]
2769
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2770
+ #
2771
+ # @return [::Google::Cloud::Container::V1::Operation]
2772
+ #
2773
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2774
+ #
2775
+ # @example Basic example
2776
+ # require "google/cloud/container/v1"
2777
+ #
2778
+ # # Create a client object. The client can be reused for multiple calls.
2779
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
2780
+ #
2781
+ # # Create a request. To set request fields, pass in keyword arguments.
2782
+ # request = Google::Cloud::Container::V1::SetLabelsRequest.new
2783
+ #
2784
+ # # Call the set_labels method.
2785
+ # result = client.set_labels request
2786
+ #
2787
+ # # The returned object is of type Google::Cloud::Container::V1::Operation.
2788
+ # p result
2789
+ #
2790
+ def set_labels request, options = nil
2791
+ raise ::ArgumentError, "request must be provided" if request.nil?
2792
+
2793
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::SetLabelsRequest
2794
+
2795
+ # Converts hash and nil to an options object
2796
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2797
+
2798
+ # Customize the options with defaults
2799
+ call_metadata = @config.rpcs.set_labels.metadata.to_h
2800
+
2801
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2802
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2803
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2804
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
2805
+ transports_version_send: [:rest]
2806
+
2807
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2808
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2809
+
2810
+ options.apply_defaults timeout: @config.rpcs.set_labels.timeout,
2811
+ metadata: call_metadata,
2812
+ retry_policy: @config.rpcs.set_labels.retry_policy
2813
+
2814
+ options.apply_defaults timeout: @config.timeout,
2815
+ metadata: @config.metadata,
2816
+ retry_policy: @config.retry_policy
2817
+
2818
+ @cluster_manager_stub.set_labels request, options do |result, operation|
2819
+ yield result, operation if block_given?
2820
+ return result
2821
+ end
2822
+ rescue ::Gapic::Rest::Error => e
2823
+ raise ::Google::Cloud::Error.from_error(e)
2824
+ end
2825
+
2826
+ ##
2827
+ # Enables or disables the ABAC authorization mechanism on a cluster.
2828
+ #
2829
+ # @overload set_legacy_abac(request, options = nil)
2830
+ # Pass arguments to `set_legacy_abac` via a request object, either of type
2831
+ # {::Google::Cloud::Container::V1::SetLegacyAbacRequest} or an equivalent Hash.
2832
+ #
2833
+ # @param request [::Google::Cloud::Container::V1::SetLegacyAbacRequest, ::Hash]
2834
+ # A request object representing the call parameters. Required. To specify no
2835
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2836
+ # @param options [::Gapic::CallOptions, ::Hash]
2837
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2838
+ #
2839
+ # @overload set_legacy_abac(project_id: nil, zone: nil, cluster_id: nil, enabled: nil, name: nil)
2840
+ # Pass arguments to `set_legacy_abac` via keyword arguments. Note that at
2841
+ # least one keyword argument is required. To specify no parameters, or to keep all
2842
+ # the default parameter values, pass an empty Hash as a request object (see above).
2843
+ #
2844
+ # @param project_id [::String]
2845
+ # Deprecated. The Google Developers Console [project ID or project
2846
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
2847
+ # This field has been deprecated and replaced by the name field.
2848
+ # @param zone [::String]
2849
+ # Deprecated. The name of the Google Compute Engine
2850
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
2851
+ # cluster resides. This field has been deprecated and replaced by the name
2852
+ # field.
2853
+ # @param cluster_id [::String]
2854
+ # Deprecated. The name of the cluster to update.
2855
+ # This field has been deprecated and replaced by the name field.
2856
+ # @param enabled [::Boolean]
2857
+ # Required. Whether ABAC authorization will be enabled in the cluster.
2858
+ # @param name [::String]
2859
+ # The name (project, location, cluster name) of the cluster to set legacy
2860
+ # abac. Specified in the format `projects/*/locations/*/clusters/*`.
2861
+ # @yield [result, operation] Access the result along with the TransportOperation object
2862
+ # @yieldparam result [::Google::Cloud::Container::V1::Operation]
2863
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2864
+ #
2865
+ # @return [::Google::Cloud::Container::V1::Operation]
2866
+ #
2867
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2868
+ #
2869
+ # @example Basic example
2870
+ # require "google/cloud/container/v1"
2871
+ #
2872
+ # # Create a client object. The client can be reused for multiple calls.
2873
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
2874
+ #
2875
+ # # Create a request. To set request fields, pass in keyword arguments.
2876
+ # request = Google::Cloud::Container::V1::SetLegacyAbacRequest.new
2877
+ #
2878
+ # # Call the set_legacy_abac method.
2879
+ # result = client.set_legacy_abac request
2880
+ #
2881
+ # # The returned object is of type Google::Cloud::Container::V1::Operation.
2882
+ # p result
2883
+ #
2884
+ def set_legacy_abac request, options = nil
2885
+ raise ::ArgumentError, "request must be provided" if request.nil?
2886
+
2887
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::SetLegacyAbacRequest
2888
+
2889
+ # Converts hash and nil to an options object
2890
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2891
+
2892
+ # Customize the options with defaults
2893
+ call_metadata = @config.rpcs.set_legacy_abac.metadata.to_h
2894
+
2895
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2896
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2897
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2898
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
2899
+ transports_version_send: [:rest]
2900
+
2901
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2902
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2903
+
2904
+ options.apply_defaults timeout: @config.rpcs.set_legacy_abac.timeout,
2905
+ metadata: call_metadata,
2906
+ retry_policy: @config.rpcs.set_legacy_abac.retry_policy
2907
+
2908
+ options.apply_defaults timeout: @config.timeout,
2909
+ metadata: @config.metadata,
2910
+ retry_policy: @config.retry_policy
2911
+
2912
+ @cluster_manager_stub.set_legacy_abac request, options do |result, operation|
2913
+ yield result, operation if block_given?
2914
+ return result
2915
+ end
2916
+ rescue ::Gapic::Rest::Error => e
2917
+ raise ::Google::Cloud::Error.from_error(e)
2918
+ end
2919
+
2920
+ ##
2921
+ # Starts master IP rotation.
2922
+ #
2923
+ # @overload start_ip_rotation(request, options = nil)
2924
+ # Pass arguments to `start_ip_rotation` via a request object, either of type
2925
+ # {::Google::Cloud::Container::V1::StartIPRotationRequest} or an equivalent Hash.
2926
+ #
2927
+ # @param request [::Google::Cloud::Container::V1::StartIPRotationRequest, ::Hash]
2928
+ # A request object representing the call parameters. Required. To specify no
2929
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2930
+ # @param options [::Gapic::CallOptions, ::Hash]
2931
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2932
+ #
2933
+ # @overload start_ip_rotation(project_id: nil, zone: nil, cluster_id: nil, name: nil, rotate_credentials: nil)
2934
+ # Pass arguments to `start_ip_rotation` via keyword arguments. Note that at
2935
+ # least one keyword argument is required. To specify no parameters, or to keep all
2936
+ # the default parameter values, pass an empty Hash as a request object (see above).
2937
+ #
2938
+ # @param project_id [::String]
2939
+ # Deprecated. The Google Developers Console [project ID or project
2940
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
2941
+ # This field has been deprecated and replaced by the name field.
2942
+ # @param zone [::String]
2943
+ # Deprecated. The name of the Google Compute Engine
2944
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
2945
+ # cluster resides. This field has been deprecated and replaced by the name
2946
+ # field.
2947
+ # @param cluster_id [::String]
2948
+ # Deprecated. The name of the cluster.
2949
+ # This field has been deprecated and replaced by the name field.
2950
+ # @param name [::String]
2951
+ # The name (project, location, cluster name) of the cluster to start IP
2952
+ # rotation. Specified in the format `projects/*/locations/*/clusters/*`.
2953
+ # @param rotate_credentials [::Boolean]
2954
+ # Whether to rotate credentials during IP rotation.
2955
+ # @yield [result, operation] Access the result along with the TransportOperation object
2956
+ # @yieldparam result [::Google::Cloud::Container::V1::Operation]
2957
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2958
+ #
2959
+ # @return [::Google::Cloud::Container::V1::Operation]
2960
+ #
2961
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2962
+ #
2963
+ # @example Basic example
2964
+ # require "google/cloud/container/v1"
2965
+ #
2966
+ # # Create a client object. The client can be reused for multiple calls.
2967
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
2968
+ #
2969
+ # # Create a request. To set request fields, pass in keyword arguments.
2970
+ # request = Google::Cloud::Container::V1::StartIPRotationRequest.new
2971
+ #
2972
+ # # Call the start_ip_rotation method.
2973
+ # result = client.start_ip_rotation request
2974
+ #
2975
+ # # The returned object is of type Google::Cloud::Container::V1::Operation.
2976
+ # p result
2977
+ #
2978
+ def start_ip_rotation request, options = nil
2979
+ raise ::ArgumentError, "request must be provided" if request.nil?
2980
+
2981
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::StartIPRotationRequest
2982
+
2983
+ # Converts hash and nil to an options object
2984
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2985
+
2986
+ # Customize the options with defaults
2987
+ call_metadata = @config.rpcs.start_ip_rotation.metadata.to_h
2988
+
2989
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2990
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2991
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2992
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
2993
+ transports_version_send: [:rest]
2994
+
2995
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2996
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2997
+
2998
+ options.apply_defaults timeout: @config.rpcs.start_ip_rotation.timeout,
2999
+ metadata: call_metadata,
3000
+ retry_policy: @config.rpcs.start_ip_rotation.retry_policy
3001
+
3002
+ options.apply_defaults timeout: @config.timeout,
3003
+ metadata: @config.metadata,
3004
+ retry_policy: @config.retry_policy
3005
+
3006
+ @cluster_manager_stub.start_ip_rotation request, options do |result, operation|
3007
+ yield result, operation if block_given?
3008
+ return result
3009
+ end
3010
+ rescue ::Gapic::Rest::Error => e
3011
+ raise ::Google::Cloud::Error.from_error(e)
3012
+ end
3013
+
3014
+ ##
3015
+ # Completes master IP rotation.
3016
+ #
3017
+ # @overload complete_ip_rotation(request, options = nil)
3018
+ # Pass arguments to `complete_ip_rotation` via a request object, either of type
3019
+ # {::Google::Cloud::Container::V1::CompleteIPRotationRequest} or an equivalent Hash.
3020
+ #
3021
+ # @param request [::Google::Cloud::Container::V1::CompleteIPRotationRequest, ::Hash]
3022
+ # A request object representing the call parameters. Required. To specify no
3023
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3024
+ # @param options [::Gapic::CallOptions, ::Hash]
3025
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3026
+ #
3027
+ # @overload complete_ip_rotation(project_id: nil, zone: nil, cluster_id: nil, name: nil)
3028
+ # Pass arguments to `complete_ip_rotation` via keyword arguments. Note that at
3029
+ # least one keyword argument is required. To specify no parameters, or to keep all
3030
+ # the default parameter values, pass an empty Hash as a request object (see above).
3031
+ #
3032
+ # @param project_id [::String]
3033
+ # Deprecated. The Google Developers Console [project ID or project
3034
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
3035
+ # This field has been deprecated and replaced by the name field.
3036
+ # @param zone [::String]
3037
+ # Deprecated. The name of the Google Compute Engine
3038
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
3039
+ # cluster resides. This field has been deprecated and replaced by the name
3040
+ # field.
3041
+ # @param cluster_id [::String]
3042
+ # Deprecated. The name of the cluster.
3043
+ # This field has been deprecated and replaced by the name field.
3044
+ # @param name [::String]
3045
+ # The name (project, location, cluster name) of the cluster to complete IP
3046
+ # rotation. Specified in the format `projects/*/locations/*/clusters/*`.
3047
+ # @yield [result, operation] Access the result along with the TransportOperation object
3048
+ # @yieldparam result [::Google::Cloud::Container::V1::Operation]
3049
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3050
+ #
3051
+ # @return [::Google::Cloud::Container::V1::Operation]
3052
+ #
3053
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3054
+ #
3055
+ # @example Basic example
3056
+ # require "google/cloud/container/v1"
3057
+ #
3058
+ # # Create a client object. The client can be reused for multiple calls.
3059
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
3060
+ #
3061
+ # # Create a request. To set request fields, pass in keyword arguments.
3062
+ # request = Google::Cloud::Container::V1::CompleteIPRotationRequest.new
3063
+ #
3064
+ # # Call the complete_ip_rotation method.
3065
+ # result = client.complete_ip_rotation request
3066
+ #
3067
+ # # The returned object is of type Google::Cloud::Container::V1::Operation.
3068
+ # p result
3069
+ #
3070
+ def complete_ip_rotation request, options = nil
3071
+ raise ::ArgumentError, "request must be provided" if request.nil?
3072
+
3073
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::CompleteIPRotationRequest
3074
+
3075
+ # Converts hash and nil to an options object
3076
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3077
+
3078
+ # Customize the options with defaults
3079
+ call_metadata = @config.rpcs.complete_ip_rotation.metadata.to_h
3080
+
3081
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3082
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3083
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3084
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
3085
+ transports_version_send: [:rest]
3086
+
3087
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3088
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3089
+
3090
+ options.apply_defaults timeout: @config.rpcs.complete_ip_rotation.timeout,
3091
+ metadata: call_metadata,
3092
+ retry_policy: @config.rpcs.complete_ip_rotation.retry_policy
3093
+
3094
+ options.apply_defaults timeout: @config.timeout,
3095
+ metadata: @config.metadata,
3096
+ retry_policy: @config.retry_policy
3097
+
3098
+ @cluster_manager_stub.complete_ip_rotation request, options do |result, operation|
3099
+ yield result, operation if block_given?
3100
+ return result
3101
+ end
3102
+ rescue ::Gapic::Rest::Error => e
3103
+ raise ::Google::Cloud::Error.from_error(e)
3104
+ end
3105
+
3106
+ ##
3107
+ # Sets the size for a specific node pool. The new size will be used for all
3108
+ # replicas, including future replicas created by modifying
3109
+ # {::Google::Cloud::Container::V1::NodePool#locations NodePool.locations}.
3110
+ #
3111
+ # @overload set_node_pool_size(request, options = nil)
3112
+ # Pass arguments to `set_node_pool_size` via a request object, either of type
3113
+ # {::Google::Cloud::Container::V1::SetNodePoolSizeRequest} or an equivalent Hash.
3114
+ #
3115
+ # @param request [::Google::Cloud::Container::V1::SetNodePoolSizeRequest, ::Hash]
3116
+ # A request object representing the call parameters. Required. To specify no
3117
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3118
+ # @param options [::Gapic::CallOptions, ::Hash]
3119
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3120
+ #
3121
+ # @overload set_node_pool_size(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, node_count: nil, name: nil)
3122
+ # Pass arguments to `set_node_pool_size` via keyword arguments. Note that at
3123
+ # least one keyword argument is required. To specify no parameters, or to keep all
3124
+ # the default parameter values, pass an empty Hash as a request object (see above).
3125
+ #
3126
+ # @param project_id [::String]
3127
+ # Deprecated. The Google Developers Console [project ID or project
3128
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
3129
+ # This field has been deprecated and replaced by the name field.
3130
+ # @param zone [::String]
3131
+ # Deprecated. The name of the Google Compute Engine
3132
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
3133
+ # cluster resides. This field has been deprecated and replaced by the name
3134
+ # field.
3135
+ # @param cluster_id [::String]
3136
+ # Deprecated. The name of the cluster to update.
3137
+ # This field has been deprecated and replaced by the name field.
3138
+ # @param node_pool_id [::String]
3139
+ # Deprecated. The name of the node pool to update.
3140
+ # This field has been deprecated and replaced by the name field.
3141
+ # @param node_count [::Integer]
3142
+ # Required. The desired node count for the pool.
3143
+ # @param name [::String]
3144
+ # The name (project, location, cluster, node pool id) of the node pool to set
3145
+ # size.
3146
+ # Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`.
3147
+ # @yield [result, operation] Access the result along with the TransportOperation object
3148
+ # @yieldparam result [::Google::Cloud::Container::V1::Operation]
3149
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3150
+ #
3151
+ # @return [::Google::Cloud::Container::V1::Operation]
3152
+ #
3153
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3154
+ #
3155
+ # @example Basic example
3156
+ # require "google/cloud/container/v1"
3157
+ #
3158
+ # # Create a client object. The client can be reused for multiple calls.
3159
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
3160
+ #
3161
+ # # Create a request. To set request fields, pass in keyword arguments.
3162
+ # request = Google::Cloud::Container::V1::SetNodePoolSizeRequest.new
3163
+ #
3164
+ # # Call the set_node_pool_size method.
3165
+ # result = client.set_node_pool_size request
3166
+ #
3167
+ # # The returned object is of type Google::Cloud::Container::V1::Operation.
3168
+ # p result
3169
+ #
3170
+ def set_node_pool_size request, options = nil
3171
+ raise ::ArgumentError, "request must be provided" if request.nil?
3172
+
3173
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::SetNodePoolSizeRequest
3174
+
3175
+ # Converts hash and nil to an options object
3176
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3177
+
3178
+ # Customize the options with defaults
3179
+ call_metadata = @config.rpcs.set_node_pool_size.metadata.to_h
3180
+
3181
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3182
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3183
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3184
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
3185
+ transports_version_send: [:rest]
3186
+
3187
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3188
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3189
+
3190
+ options.apply_defaults timeout: @config.rpcs.set_node_pool_size.timeout,
3191
+ metadata: call_metadata,
3192
+ retry_policy: @config.rpcs.set_node_pool_size.retry_policy
3193
+
3194
+ options.apply_defaults timeout: @config.timeout,
3195
+ metadata: @config.metadata,
3196
+ retry_policy: @config.retry_policy
3197
+
3198
+ @cluster_manager_stub.set_node_pool_size request, options do |result, operation|
3199
+ yield result, operation if block_given?
3200
+ return result
3201
+ end
3202
+ rescue ::Gapic::Rest::Error => e
3203
+ raise ::Google::Cloud::Error.from_error(e)
3204
+ end
3205
+
3206
+ ##
3207
+ # Enables or disables Network Policy for a cluster.
3208
+ #
3209
+ # @overload set_network_policy(request, options = nil)
3210
+ # Pass arguments to `set_network_policy` via a request object, either of type
3211
+ # {::Google::Cloud::Container::V1::SetNetworkPolicyRequest} or an equivalent Hash.
3212
+ #
3213
+ # @param request [::Google::Cloud::Container::V1::SetNetworkPolicyRequest, ::Hash]
3214
+ # A request object representing the call parameters. Required. To specify no
3215
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3216
+ # @param options [::Gapic::CallOptions, ::Hash]
3217
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3218
+ #
3219
+ # @overload set_network_policy(project_id: nil, zone: nil, cluster_id: nil, network_policy: nil, name: nil)
3220
+ # Pass arguments to `set_network_policy` via keyword arguments. Note that at
3221
+ # least one keyword argument is required. To specify no parameters, or to keep all
3222
+ # the default parameter values, pass an empty Hash as a request object (see above).
3223
+ #
3224
+ # @param project_id [::String]
3225
+ # Deprecated. The Google Developers Console [project ID or project
3226
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
3227
+ # This field has been deprecated and replaced by the name field.
3228
+ # @param zone [::String]
3229
+ # Deprecated. The name of the Google Compute Engine
3230
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
3231
+ # cluster resides. This field has been deprecated and replaced by the name
3232
+ # field.
3233
+ # @param cluster_id [::String]
3234
+ # Deprecated. The name of the cluster.
3235
+ # This field has been deprecated and replaced by the name field.
3236
+ # @param network_policy [::Google::Cloud::Container::V1::NetworkPolicy, ::Hash]
3237
+ # Required. Configuration options for the NetworkPolicy feature.
3238
+ # @param name [::String]
3239
+ # The name (project, location, cluster name) of the cluster to set networking
3240
+ # policy. Specified in the format `projects/*/locations/*/clusters/*`.
3241
+ # @yield [result, operation] Access the result along with the TransportOperation object
3242
+ # @yieldparam result [::Google::Cloud::Container::V1::Operation]
3243
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3244
+ #
3245
+ # @return [::Google::Cloud::Container::V1::Operation]
3246
+ #
3247
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3248
+ #
3249
+ # @example Basic example
3250
+ # require "google/cloud/container/v1"
3251
+ #
3252
+ # # Create a client object. The client can be reused for multiple calls.
3253
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
3254
+ #
3255
+ # # Create a request. To set request fields, pass in keyword arguments.
3256
+ # request = Google::Cloud::Container::V1::SetNetworkPolicyRequest.new
3257
+ #
3258
+ # # Call the set_network_policy method.
3259
+ # result = client.set_network_policy request
3260
+ #
3261
+ # # The returned object is of type Google::Cloud::Container::V1::Operation.
3262
+ # p result
3263
+ #
3264
+ def set_network_policy request, options = nil
3265
+ raise ::ArgumentError, "request must be provided" if request.nil?
3266
+
3267
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::SetNetworkPolicyRequest
3268
+
3269
+ # Converts hash and nil to an options object
3270
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3271
+
3272
+ # Customize the options with defaults
3273
+ call_metadata = @config.rpcs.set_network_policy.metadata.to_h
3274
+
3275
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3276
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3277
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3278
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
3279
+ transports_version_send: [:rest]
3280
+
3281
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3282
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3283
+
3284
+ options.apply_defaults timeout: @config.rpcs.set_network_policy.timeout,
3285
+ metadata: call_metadata,
3286
+ retry_policy: @config.rpcs.set_network_policy.retry_policy
3287
+
3288
+ options.apply_defaults timeout: @config.timeout,
3289
+ metadata: @config.metadata,
3290
+ retry_policy: @config.retry_policy
3291
+
3292
+ @cluster_manager_stub.set_network_policy request, options do |result, operation|
3293
+ yield result, operation if block_given?
3294
+ return result
3295
+ end
3296
+ rescue ::Gapic::Rest::Error => e
3297
+ raise ::Google::Cloud::Error.from_error(e)
3298
+ end
3299
+
3300
+ ##
3301
+ # Sets the maintenance policy for a cluster.
3302
+ #
3303
+ # @overload set_maintenance_policy(request, options = nil)
3304
+ # Pass arguments to `set_maintenance_policy` via a request object, either of type
3305
+ # {::Google::Cloud::Container::V1::SetMaintenancePolicyRequest} or an equivalent Hash.
3306
+ #
3307
+ # @param request [::Google::Cloud::Container::V1::SetMaintenancePolicyRequest, ::Hash]
3308
+ # A request object representing the call parameters. Required. To specify no
3309
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3310
+ # @param options [::Gapic::CallOptions, ::Hash]
3311
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3312
+ #
3313
+ # @overload set_maintenance_policy(project_id: nil, zone: nil, cluster_id: nil, maintenance_policy: nil, name: nil)
3314
+ # Pass arguments to `set_maintenance_policy` via keyword arguments. Note that at
3315
+ # least one keyword argument is required. To specify no parameters, or to keep all
3316
+ # the default parameter values, pass an empty Hash as a request object (see above).
3317
+ #
3318
+ # @param project_id [::String]
3319
+ # Required. The Google Developers Console [project ID or project
3320
+ # number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
3321
+ # @param zone [::String]
3322
+ # Required. The name of the Google Compute Engine
3323
+ # [zone](https://cloud.google.com/compute/docs/zones#available) in which the
3324
+ # cluster resides.
3325
+ # @param cluster_id [::String]
3326
+ # Required. The name of the cluster to update.
3327
+ # @param maintenance_policy [::Google::Cloud::Container::V1::MaintenancePolicy, ::Hash]
3328
+ # Required. The maintenance policy to be set for the cluster. An empty field
3329
+ # clears the existing maintenance policy.
3330
+ # @param name [::String]
3331
+ # The name (project, location, cluster name) of the cluster to set
3332
+ # maintenance policy.
3333
+ # Specified in the format `projects/*/locations/*/clusters/*`.
3334
+ # @yield [result, operation] Access the result along with the TransportOperation object
3335
+ # @yieldparam result [::Google::Cloud::Container::V1::Operation]
3336
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3337
+ #
3338
+ # @return [::Google::Cloud::Container::V1::Operation]
3339
+ #
3340
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3341
+ #
3342
+ # @example Basic example
3343
+ # require "google/cloud/container/v1"
3344
+ #
3345
+ # # Create a client object. The client can be reused for multiple calls.
3346
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
3347
+ #
3348
+ # # Create a request. To set request fields, pass in keyword arguments.
3349
+ # request = Google::Cloud::Container::V1::SetMaintenancePolicyRequest.new
3350
+ #
3351
+ # # Call the set_maintenance_policy method.
3352
+ # result = client.set_maintenance_policy request
3353
+ #
3354
+ # # The returned object is of type Google::Cloud::Container::V1::Operation.
3355
+ # p result
3356
+ #
3357
+ def set_maintenance_policy request, options = nil
3358
+ raise ::ArgumentError, "request must be provided" if request.nil?
3359
+
3360
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::SetMaintenancePolicyRequest
3361
+
3362
+ # Converts hash and nil to an options object
3363
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3364
+
3365
+ # Customize the options with defaults
3366
+ call_metadata = @config.rpcs.set_maintenance_policy.metadata.to_h
3367
+
3368
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3369
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3370
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3371
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
3372
+ transports_version_send: [:rest]
3373
+
3374
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3375
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3376
+
3377
+ options.apply_defaults timeout: @config.rpcs.set_maintenance_policy.timeout,
3378
+ metadata: call_metadata,
3379
+ retry_policy: @config.rpcs.set_maintenance_policy.retry_policy
3380
+
3381
+ options.apply_defaults timeout: @config.timeout,
3382
+ metadata: @config.metadata,
3383
+ retry_policy: @config.retry_policy
3384
+
3385
+ @cluster_manager_stub.set_maintenance_policy request, options do |result, operation|
3386
+ yield result, operation if block_given?
3387
+ return result
3388
+ end
3389
+ rescue ::Gapic::Rest::Error => e
3390
+ raise ::Google::Cloud::Error.from_error(e)
3391
+ end
3392
+
3393
+ ##
3394
+ # Lists subnetworks that are usable for creating clusters in a project.
3395
+ #
3396
+ # @overload list_usable_subnetworks(request, options = nil)
3397
+ # Pass arguments to `list_usable_subnetworks` via a request object, either of type
3398
+ # {::Google::Cloud::Container::V1::ListUsableSubnetworksRequest} or an equivalent Hash.
3399
+ #
3400
+ # @param request [::Google::Cloud::Container::V1::ListUsableSubnetworksRequest, ::Hash]
3401
+ # A request object representing the call parameters. Required. To specify no
3402
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3403
+ # @param options [::Gapic::CallOptions, ::Hash]
3404
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3405
+ #
3406
+ # @overload list_usable_subnetworks(parent: nil, filter: nil, page_size: nil, page_token: nil)
3407
+ # Pass arguments to `list_usable_subnetworks` via keyword arguments. Note that at
3408
+ # least one keyword argument is required. To specify no parameters, or to keep all
3409
+ # the default parameter values, pass an empty Hash as a request object (see above).
3410
+ #
3411
+ # @param parent [::String]
3412
+ # The parent project where subnetworks are usable.
3413
+ # Specified in the format `projects/*`.
3414
+ # @param filter [::String]
3415
+ # Filtering currently only supports equality on the networkProjectId and must
3416
+ # be in the form: "networkProjectId=[PROJECTID]", where `networkProjectId`
3417
+ # is the project which owns the listed subnetworks. This defaults to the
3418
+ # parent project ID.
3419
+ # @param page_size [::Integer]
3420
+ # The max number of results per page that should be returned. If the number
3421
+ # of available results is larger than `page_size`, a `next_page_token` is
3422
+ # returned which can be used to get the next page of results in subsequent
3423
+ # requests. Acceptable values are 0 to 500, inclusive. (Default: 500)
3424
+ # @param page_token [::String]
3425
+ # Specifies a page token to use. Set this to the nextPageToken returned by
3426
+ # previous list requests to get the next page of results.
3427
+ # @yield [result, operation] Access the result along with the TransportOperation object
3428
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Container::V1::UsableSubnetwork>]
3429
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3430
+ #
3431
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Container::V1::UsableSubnetwork>]
3432
+ #
3433
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3434
+ #
3435
+ # @example Basic example
3436
+ # require "google/cloud/container/v1"
3437
+ #
3438
+ # # Create a client object. The client can be reused for multiple calls.
3439
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
3440
+ #
3441
+ # # Create a request. To set request fields, pass in keyword arguments.
3442
+ # request = Google::Cloud::Container::V1::ListUsableSubnetworksRequest.new
3443
+ #
3444
+ # # Call the list_usable_subnetworks method.
3445
+ # result = client.list_usable_subnetworks request
3446
+ #
3447
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
3448
+ # # over elements, and API calls will be issued to fetch pages as needed.
3449
+ # result.each do |item|
3450
+ # # Each element is of type ::Google::Cloud::Container::V1::UsableSubnetwork.
3451
+ # p item
3452
+ # end
3453
+ #
3454
+ def list_usable_subnetworks request, options = nil
3455
+ raise ::ArgumentError, "request must be provided" if request.nil?
3456
+
3457
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::ListUsableSubnetworksRequest
3458
+
3459
+ # Converts hash and nil to an options object
3460
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3461
+
3462
+ # Customize the options with defaults
3463
+ call_metadata = @config.rpcs.list_usable_subnetworks.metadata.to_h
3464
+
3465
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3466
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3467
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3468
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
3469
+ transports_version_send: [:rest]
3470
+
3471
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3472
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3473
+
3474
+ options.apply_defaults timeout: @config.rpcs.list_usable_subnetworks.timeout,
3475
+ metadata: call_metadata,
3476
+ retry_policy: @config.rpcs.list_usable_subnetworks.retry_policy
3477
+
3478
+ options.apply_defaults timeout: @config.timeout,
3479
+ metadata: @config.metadata,
3480
+ retry_policy: @config.retry_policy
3481
+
3482
+ @cluster_manager_stub.list_usable_subnetworks request, options do |result, operation|
3483
+ result = ::Gapic::Rest::PagedEnumerable.new @cluster_manager_stub, :list_usable_subnetworks, "subnetworks", request, result, options
3484
+ yield result, operation if block_given?
3485
+ return result
3486
+ end
3487
+ rescue ::Gapic::Rest::Error => e
3488
+ raise ::Google::Cloud::Error.from_error(e)
3489
+ end
3490
+
3491
+ ##
3492
+ # Checks the cluster compatibility with Autopilot mode, and returns a list of
3493
+ # compatibility issues.
3494
+ #
3495
+ # @overload check_autopilot_compatibility(request, options = nil)
3496
+ # Pass arguments to `check_autopilot_compatibility` via a request object, either of type
3497
+ # {::Google::Cloud::Container::V1::CheckAutopilotCompatibilityRequest} or an equivalent Hash.
3498
+ #
3499
+ # @param request [::Google::Cloud::Container::V1::CheckAutopilotCompatibilityRequest, ::Hash]
3500
+ # A request object representing the call parameters. Required. To specify no
3501
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3502
+ # @param options [::Gapic::CallOptions, ::Hash]
3503
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3504
+ #
3505
+ # @overload check_autopilot_compatibility(name: nil)
3506
+ # Pass arguments to `check_autopilot_compatibility` via keyword arguments. Note that at
3507
+ # least one keyword argument is required. To specify no parameters, or to keep all
3508
+ # the default parameter values, pass an empty Hash as a request object (see above).
3509
+ #
3510
+ # @param name [::String]
3511
+ # The name (project, location, cluster) of the cluster to retrieve.
3512
+ # Specified in the format `projects/*/locations/*/clusters/*`.
3513
+ # @yield [result, operation] Access the result along with the TransportOperation object
3514
+ # @yieldparam result [::Google::Cloud::Container::V1::CheckAutopilotCompatibilityResponse]
3515
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3516
+ #
3517
+ # @return [::Google::Cloud::Container::V1::CheckAutopilotCompatibilityResponse]
3518
+ #
3519
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3520
+ #
3521
+ # @example Basic example
3522
+ # require "google/cloud/container/v1"
3523
+ #
3524
+ # # Create a client object. The client can be reused for multiple calls.
3525
+ # client = Google::Cloud::Container::V1::ClusterManager::Rest::Client.new
3526
+ #
3527
+ # # Create a request. To set request fields, pass in keyword arguments.
3528
+ # request = Google::Cloud::Container::V1::CheckAutopilotCompatibilityRequest.new
3529
+ #
3530
+ # # Call the check_autopilot_compatibility method.
3531
+ # result = client.check_autopilot_compatibility request
3532
+ #
3533
+ # # The returned object is of type Google::Cloud::Container::V1::CheckAutopilotCompatibilityResponse.
3534
+ # p result
3535
+ #
3536
+ def check_autopilot_compatibility request, options = nil
3537
+ raise ::ArgumentError, "request must be provided" if request.nil?
3538
+
3539
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1::CheckAutopilotCompatibilityRequest
3540
+
3541
+ # Converts hash and nil to an options object
3542
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3543
+
3544
+ # Customize the options with defaults
3545
+ call_metadata = @config.rpcs.check_autopilot_compatibility.metadata.to_h
3546
+
3547
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3548
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3549
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3550
+ gapic_version: ::Google::Cloud::Container::V1::VERSION,
3551
+ transports_version_send: [:rest]
3552
+
3553
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3554
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3555
+
3556
+ options.apply_defaults timeout: @config.rpcs.check_autopilot_compatibility.timeout,
3557
+ metadata: call_metadata,
3558
+ retry_policy: @config.rpcs.check_autopilot_compatibility.retry_policy
3559
+
3560
+ options.apply_defaults timeout: @config.timeout,
3561
+ metadata: @config.metadata,
3562
+ retry_policy: @config.retry_policy
3563
+
3564
+ @cluster_manager_stub.check_autopilot_compatibility request, options do |result, operation|
3565
+ yield result, operation if block_given?
3566
+ return result
3567
+ end
3568
+ rescue ::Gapic::Rest::Error => e
3569
+ raise ::Google::Cloud::Error.from_error(e)
3570
+ end
3571
+
3572
+ ##
3573
+ # Configuration class for the ClusterManager REST API.
3574
+ #
3575
+ # This class represents the configuration for ClusterManager REST,
3576
+ # providing control over timeouts, retry behavior, logging, transport
3577
+ # parameters, and other low-level controls. Certain parameters can also be
3578
+ # applied individually to specific RPCs. See
3579
+ # {::Google::Cloud::Container::V1::ClusterManager::Rest::Client::Configuration::Rpcs}
3580
+ # for a list of RPCs that can be configured independently.
3581
+ #
3582
+ # Configuration can be applied globally to all clients, or to a single client
3583
+ # on construction.
3584
+ #
3585
+ # @example
3586
+ #
3587
+ # # Modify the global config, setting the timeout for
3588
+ # # list_clusters to 20 seconds,
3589
+ # # and all remaining timeouts to 10 seconds.
3590
+ # ::Google::Cloud::Container::V1::ClusterManager::Rest::Client.configure do |config|
3591
+ # config.timeout = 10.0
3592
+ # config.rpcs.list_clusters.timeout = 20.0
3593
+ # end
3594
+ #
3595
+ # # Apply the above configuration only to a new client.
3596
+ # client = ::Google::Cloud::Container::V1::ClusterManager::Rest::Client.new do |config|
3597
+ # config.timeout = 10.0
3598
+ # config.rpcs.list_clusters.timeout = 20.0
3599
+ # end
3600
+ #
3601
+ # @!attribute [rw] endpoint
3602
+ # A custom service endpoint, as a hostname or hostname:port. The default is
3603
+ # nil, indicating to use the default endpoint in the current universe domain.
3604
+ # @return [::String,nil]
3605
+ # @!attribute [rw] credentials
3606
+ # Credentials to send with calls. You may provide any of the following types:
3607
+ # * (`String`) The path to a service account key file in JSON format
3608
+ # * (`Hash`) A service account key as a Hash
3609
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
3610
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
3611
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
3612
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
3613
+ # * (`nil`) indicating no credentials
3614
+ # @return [::Object]
3615
+ # @!attribute [rw] scope
3616
+ # The OAuth scopes
3617
+ # @return [::Array<::String>]
3618
+ # @!attribute [rw] lib_name
3619
+ # The library name as recorded in instrumentation and logging
3620
+ # @return [::String]
3621
+ # @!attribute [rw] lib_version
3622
+ # The library version as recorded in instrumentation and logging
3623
+ # @return [::String]
3624
+ # @!attribute [rw] timeout
3625
+ # The call timeout in seconds.
3626
+ # @return [::Numeric]
3627
+ # @!attribute [rw] metadata
3628
+ # Additional headers to be sent with the call.
3629
+ # @return [::Hash{::Symbol=>::String}]
3630
+ # @!attribute [rw] retry_policy
3631
+ # The retry policy. The value is a hash with the following keys:
3632
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
3633
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
3634
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
3635
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
3636
+ # trigger a retry.
3637
+ # @return [::Hash]
3638
+ # @!attribute [rw] quota_project
3639
+ # A separate project against which to charge quota.
3640
+ # @return [::String]
3641
+ # @!attribute [rw] universe_domain
3642
+ # The universe domain within which to make requests. This determines the
3643
+ # default endpoint URL. The default value of nil uses the environment
3644
+ # universe (usually the default "googleapis.com" universe).
3645
+ # @return [::String,nil]
3646
+ #
3647
+ class Configuration
3648
+ extend ::Gapic::Config
3649
+
3650
+ # @private
3651
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
3652
+ DEFAULT_ENDPOINT = "container.googleapis.com"
3653
+
3654
+ config_attr :endpoint, nil, ::String, nil
3655
+ config_attr :credentials, nil do |value|
3656
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
3657
+ allowed.any? { |klass| klass === value }
3658
+ end
3659
+ config_attr :scope, nil, ::String, ::Array, nil
3660
+ config_attr :lib_name, nil, ::String, nil
3661
+ config_attr :lib_version, nil, ::String, nil
3662
+ config_attr :timeout, nil, ::Numeric, nil
3663
+ config_attr :metadata, nil, ::Hash, nil
3664
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
3665
+ config_attr :quota_project, nil, ::String, nil
3666
+ config_attr :universe_domain, nil, ::String, nil
3667
+
3668
+ # @private
3669
+ def initialize parent_config = nil
3670
+ @parent_config = parent_config unless parent_config.nil?
3671
+
3672
+ yield self if block_given?
3673
+ end
3674
+
3675
+ ##
3676
+ # Configurations for individual RPCs
3677
+ # @return [Rpcs]
3678
+ #
3679
+ def rpcs
3680
+ @rpcs ||= begin
3681
+ parent_rpcs = nil
3682
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
3683
+ Rpcs.new parent_rpcs
3684
+ end
3685
+ end
3686
+
3687
+ ##
3688
+ # Configuration RPC class for the ClusterManager API.
3689
+ #
3690
+ # Includes fields providing the configuration for each RPC in this service.
3691
+ # Each configuration object is of type `Gapic::Config::Method` and includes
3692
+ # the following configuration fields:
3693
+ #
3694
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
3695
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
3696
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
3697
+ # include the following keys:
3698
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
3699
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
3700
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
3701
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
3702
+ # trigger a retry.
3703
+ #
3704
+ class Rpcs
3705
+ ##
3706
+ # RPC-specific configuration for `list_clusters`
3707
+ # @return [::Gapic::Config::Method]
3708
+ #
3709
+ attr_reader :list_clusters
3710
+ ##
3711
+ # RPC-specific configuration for `get_cluster`
3712
+ # @return [::Gapic::Config::Method]
3713
+ #
3714
+ attr_reader :get_cluster
3715
+ ##
3716
+ # RPC-specific configuration for `create_cluster`
3717
+ # @return [::Gapic::Config::Method]
3718
+ #
3719
+ attr_reader :create_cluster
3720
+ ##
3721
+ # RPC-specific configuration for `update_cluster`
3722
+ # @return [::Gapic::Config::Method]
3723
+ #
3724
+ attr_reader :update_cluster
3725
+ ##
3726
+ # RPC-specific configuration for `update_node_pool`
3727
+ # @return [::Gapic::Config::Method]
3728
+ #
3729
+ attr_reader :update_node_pool
3730
+ ##
3731
+ # RPC-specific configuration for `set_node_pool_autoscaling`
3732
+ # @return [::Gapic::Config::Method]
3733
+ #
3734
+ attr_reader :set_node_pool_autoscaling
3735
+ ##
3736
+ # RPC-specific configuration for `set_logging_service`
3737
+ # @return [::Gapic::Config::Method]
3738
+ #
3739
+ attr_reader :set_logging_service
3740
+ ##
3741
+ # RPC-specific configuration for `set_monitoring_service`
3742
+ # @return [::Gapic::Config::Method]
3743
+ #
3744
+ attr_reader :set_monitoring_service
3745
+ ##
3746
+ # RPC-specific configuration for `set_addons_config`
3747
+ # @return [::Gapic::Config::Method]
3748
+ #
3749
+ attr_reader :set_addons_config
3750
+ ##
3751
+ # RPC-specific configuration for `set_locations`
3752
+ # @return [::Gapic::Config::Method]
3753
+ #
3754
+ attr_reader :set_locations
3755
+ ##
3756
+ # RPC-specific configuration for `update_master`
3757
+ # @return [::Gapic::Config::Method]
3758
+ #
3759
+ attr_reader :update_master
3760
+ ##
3761
+ # RPC-specific configuration for `set_master_auth`
3762
+ # @return [::Gapic::Config::Method]
3763
+ #
3764
+ attr_reader :set_master_auth
3765
+ ##
3766
+ # RPC-specific configuration for `delete_cluster`
3767
+ # @return [::Gapic::Config::Method]
3768
+ #
3769
+ attr_reader :delete_cluster
3770
+ ##
3771
+ # RPC-specific configuration for `list_operations`
3772
+ # @return [::Gapic::Config::Method]
3773
+ #
3774
+ attr_reader :list_operations
3775
+ ##
3776
+ # RPC-specific configuration for `get_operation`
3777
+ # @return [::Gapic::Config::Method]
3778
+ #
3779
+ attr_reader :get_operation
3780
+ ##
3781
+ # RPC-specific configuration for `cancel_operation`
3782
+ # @return [::Gapic::Config::Method]
3783
+ #
3784
+ attr_reader :cancel_operation
3785
+ ##
3786
+ # RPC-specific configuration for `get_server_config`
3787
+ # @return [::Gapic::Config::Method]
3788
+ #
3789
+ attr_reader :get_server_config
3790
+ ##
3791
+ # RPC-specific configuration for `get_json_web_keys`
3792
+ # @return [::Gapic::Config::Method]
3793
+ #
3794
+ attr_reader :get_json_web_keys
3795
+ ##
3796
+ # RPC-specific configuration for `list_node_pools`
3797
+ # @return [::Gapic::Config::Method]
3798
+ #
3799
+ attr_reader :list_node_pools
3800
+ ##
3801
+ # RPC-specific configuration for `get_node_pool`
3802
+ # @return [::Gapic::Config::Method]
3803
+ #
3804
+ attr_reader :get_node_pool
3805
+ ##
3806
+ # RPC-specific configuration for `create_node_pool`
3807
+ # @return [::Gapic::Config::Method]
3808
+ #
3809
+ attr_reader :create_node_pool
3810
+ ##
3811
+ # RPC-specific configuration for `delete_node_pool`
3812
+ # @return [::Gapic::Config::Method]
3813
+ #
3814
+ attr_reader :delete_node_pool
3815
+ ##
3816
+ # RPC-specific configuration for `complete_node_pool_upgrade`
3817
+ # @return [::Gapic::Config::Method]
3818
+ #
3819
+ attr_reader :complete_node_pool_upgrade
3820
+ ##
3821
+ # RPC-specific configuration for `rollback_node_pool_upgrade`
3822
+ # @return [::Gapic::Config::Method]
3823
+ #
3824
+ attr_reader :rollback_node_pool_upgrade
3825
+ ##
3826
+ # RPC-specific configuration for `set_node_pool_management`
3827
+ # @return [::Gapic::Config::Method]
3828
+ #
3829
+ attr_reader :set_node_pool_management
3830
+ ##
3831
+ # RPC-specific configuration for `set_labels`
3832
+ # @return [::Gapic::Config::Method]
3833
+ #
3834
+ attr_reader :set_labels
3835
+ ##
3836
+ # RPC-specific configuration for `set_legacy_abac`
3837
+ # @return [::Gapic::Config::Method]
3838
+ #
3839
+ attr_reader :set_legacy_abac
3840
+ ##
3841
+ # RPC-specific configuration for `start_ip_rotation`
3842
+ # @return [::Gapic::Config::Method]
3843
+ #
3844
+ attr_reader :start_ip_rotation
3845
+ ##
3846
+ # RPC-specific configuration for `complete_ip_rotation`
3847
+ # @return [::Gapic::Config::Method]
3848
+ #
3849
+ attr_reader :complete_ip_rotation
3850
+ ##
3851
+ # RPC-specific configuration for `set_node_pool_size`
3852
+ # @return [::Gapic::Config::Method]
3853
+ #
3854
+ attr_reader :set_node_pool_size
3855
+ ##
3856
+ # RPC-specific configuration for `set_network_policy`
3857
+ # @return [::Gapic::Config::Method]
3858
+ #
3859
+ attr_reader :set_network_policy
3860
+ ##
3861
+ # RPC-specific configuration for `set_maintenance_policy`
3862
+ # @return [::Gapic::Config::Method]
3863
+ #
3864
+ attr_reader :set_maintenance_policy
3865
+ ##
3866
+ # RPC-specific configuration for `list_usable_subnetworks`
3867
+ # @return [::Gapic::Config::Method]
3868
+ #
3869
+ attr_reader :list_usable_subnetworks
3870
+ ##
3871
+ # RPC-specific configuration for `check_autopilot_compatibility`
3872
+ # @return [::Gapic::Config::Method]
3873
+ #
3874
+ attr_reader :check_autopilot_compatibility
3875
+
3876
+ # @private
3877
+ def initialize parent_rpcs = nil
3878
+ list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters
3879
+ @list_clusters = ::Gapic::Config::Method.new list_clusters_config
3880
+ get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster
3881
+ @get_cluster = ::Gapic::Config::Method.new get_cluster_config
3882
+ create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster
3883
+ @create_cluster = ::Gapic::Config::Method.new create_cluster_config
3884
+ update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster
3885
+ @update_cluster = ::Gapic::Config::Method.new update_cluster_config
3886
+ update_node_pool_config = parent_rpcs.update_node_pool if parent_rpcs.respond_to? :update_node_pool
3887
+ @update_node_pool = ::Gapic::Config::Method.new update_node_pool_config
3888
+ set_node_pool_autoscaling_config = parent_rpcs.set_node_pool_autoscaling if parent_rpcs.respond_to? :set_node_pool_autoscaling
3889
+ @set_node_pool_autoscaling = ::Gapic::Config::Method.new set_node_pool_autoscaling_config
3890
+ set_logging_service_config = parent_rpcs.set_logging_service if parent_rpcs.respond_to? :set_logging_service
3891
+ @set_logging_service = ::Gapic::Config::Method.new set_logging_service_config
3892
+ set_monitoring_service_config = parent_rpcs.set_monitoring_service if parent_rpcs.respond_to? :set_monitoring_service
3893
+ @set_monitoring_service = ::Gapic::Config::Method.new set_monitoring_service_config
3894
+ set_addons_config_config = parent_rpcs.set_addons_config if parent_rpcs.respond_to? :set_addons_config
3895
+ @set_addons_config = ::Gapic::Config::Method.new set_addons_config_config
3896
+ set_locations_config = parent_rpcs.set_locations if parent_rpcs.respond_to? :set_locations
3897
+ @set_locations = ::Gapic::Config::Method.new set_locations_config
3898
+ update_master_config = parent_rpcs.update_master if parent_rpcs.respond_to? :update_master
3899
+ @update_master = ::Gapic::Config::Method.new update_master_config
3900
+ set_master_auth_config = parent_rpcs.set_master_auth if parent_rpcs.respond_to? :set_master_auth
3901
+ @set_master_auth = ::Gapic::Config::Method.new set_master_auth_config
3902
+ delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster
3903
+ @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config
3904
+ list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations
3905
+ @list_operations = ::Gapic::Config::Method.new list_operations_config
3906
+ get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation
3907
+ @get_operation = ::Gapic::Config::Method.new get_operation_config
3908
+ cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation
3909
+ @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config
3910
+ get_server_config_config = parent_rpcs.get_server_config if parent_rpcs.respond_to? :get_server_config
3911
+ @get_server_config = ::Gapic::Config::Method.new get_server_config_config
3912
+ get_json_web_keys_config = parent_rpcs.get_json_web_keys if parent_rpcs.respond_to? :get_json_web_keys
3913
+ @get_json_web_keys = ::Gapic::Config::Method.new get_json_web_keys_config
3914
+ list_node_pools_config = parent_rpcs.list_node_pools if parent_rpcs.respond_to? :list_node_pools
3915
+ @list_node_pools = ::Gapic::Config::Method.new list_node_pools_config
3916
+ get_node_pool_config = parent_rpcs.get_node_pool if parent_rpcs.respond_to? :get_node_pool
3917
+ @get_node_pool = ::Gapic::Config::Method.new get_node_pool_config
3918
+ create_node_pool_config = parent_rpcs.create_node_pool if parent_rpcs.respond_to? :create_node_pool
3919
+ @create_node_pool = ::Gapic::Config::Method.new create_node_pool_config
3920
+ delete_node_pool_config = parent_rpcs.delete_node_pool if parent_rpcs.respond_to? :delete_node_pool
3921
+ @delete_node_pool = ::Gapic::Config::Method.new delete_node_pool_config
3922
+ complete_node_pool_upgrade_config = parent_rpcs.complete_node_pool_upgrade if parent_rpcs.respond_to? :complete_node_pool_upgrade
3923
+ @complete_node_pool_upgrade = ::Gapic::Config::Method.new complete_node_pool_upgrade_config
3924
+ rollback_node_pool_upgrade_config = parent_rpcs.rollback_node_pool_upgrade if parent_rpcs.respond_to? :rollback_node_pool_upgrade
3925
+ @rollback_node_pool_upgrade = ::Gapic::Config::Method.new rollback_node_pool_upgrade_config
3926
+ set_node_pool_management_config = parent_rpcs.set_node_pool_management if parent_rpcs.respond_to? :set_node_pool_management
3927
+ @set_node_pool_management = ::Gapic::Config::Method.new set_node_pool_management_config
3928
+ set_labels_config = parent_rpcs.set_labels if parent_rpcs.respond_to? :set_labels
3929
+ @set_labels = ::Gapic::Config::Method.new set_labels_config
3930
+ set_legacy_abac_config = parent_rpcs.set_legacy_abac if parent_rpcs.respond_to? :set_legacy_abac
3931
+ @set_legacy_abac = ::Gapic::Config::Method.new set_legacy_abac_config
3932
+ start_ip_rotation_config = parent_rpcs.start_ip_rotation if parent_rpcs.respond_to? :start_ip_rotation
3933
+ @start_ip_rotation = ::Gapic::Config::Method.new start_ip_rotation_config
3934
+ complete_ip_rotation_config = parent_rpcs.complete_ip_rotation if parent_rpcs.respond_to? :complete_ip_rotation
3935
+ @complete_ip_rotation = ::Gapic::Config::Method.new complete_ip_rotation_config
3936
+ set_node_pool_size_config = parent_rpcs.set_node_pool_size if parent_rpcs.respond_to? :set_node_pool_size
3937
+ @set_node_pool_size = ::Gapic::Config::Method.new set_node_pool_size_config
3938
+ set_network_policy_config = parent_rpcs.set_network_policy if parent_rpcs.respond_to? :set_network_policy
3939
+ @set_network_policy = ::Gapic::Config::Method.new set_network_policy_config
3940
+ set_maintenance_policy_config = parent_rpcs.set_maintenance_policy if parent_rpcs.respond_to? :set_maintenance_policy
3941
+ @set_maintenance_policy = ::Gapic::Config::Method.new set_maintenance_policy_config
3942
+ list_usable_subnetworks_config = parent_rpcs.list_usable_subnetworks if parent_rpcs.respond_to? :list_usable_subnetworks
3943
+ @list_usable_subnetworks = ::Gapic::Config::Method.new list_usable_subnetworks_config
3944
+ check_autopilot_compatibility_config = parent_rpcs.check_autopilot_compatibility if parent_rpcs.respond_to? :check_autopilot_compatibility
3945
+ @check_autopilot_compatibility = ::Gapic::Config::Method.new check_autopilot_compatibility_config
3946
+
3947
+ yield self if block_given?
3948
+ end
3949
+ end
3950
+ end
3951
+ end
3952
+ end
3953
+ end
3954
+ end
3955
+ end
3956
+ end
3957
+ end